Showing error 548

User: Jiri Slaby
Error type: Calling function from invalid context
Error type description: Some function is called at inappropriate place like sleep inside critical sections or interrupt handlers
File location: drivers/mtd/chips/cfi_cmdset_0001.c
Line in file: 908
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:19:02 UTC


Source:

 878                        spin_lock(chip->mutex);
 879
 880                        if (ret == -EAGAIN) {
 881                                spin_unlock(contender->mutex);
 882                                goto retry;
 883                        }
 884                        if (ret) {
 885                                spin_unlock(contender->mutex);
 886                                return ret;
 887                        }
 888                        spin_lock(&shared->lock);
 889
 890                        /* We should not own chip if it is already
 891                         * in FL_SYNCING state. Put contender and retry. */
 892                        if (chip->state == FL_SYNCING) {
 893                                put_chip(map, contender, contender->start);
 894                                spin_unlock(contender->mutex);
 895                                goto retry;
 896                        }
 897                        spin_unlock(contender->mutex);
 898                }
 899
 900                /* Check if we already have suspended erase
 901                 * on this chip. Sleep. */
 902                if (mode == FL_ERASING && shared->erasing
 903                    && shared->erasing->oldstate == FL_ERASING) {
 904                        spin_unlock(&shared->lock);
 905                        set_current_state(TASK_UNINTERRUPTIBLE);
 906                        add_wait_queue(&chip->wq, &wait);
 907                        spin_unlock(chip->mutex);
 908                        schedule();
 909                        remove_wait_queue(&chip->wq, &wait);
 910                        spin_lock(chip->mutex);
 911                        goto retry;
 912                }
 913
 914                /* We now own it */
 915                shared->writing = chip;
 916                if (mode == FL_ERASING)
 917                        shared->erasing = chip;
 918                spin_unlock(&shared->lock);
Show full sources