Showing error 549

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: 824
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:19:02 UTC


Source:

 794                        spin_unlock(chip->mutex);
 795                        cfi_udelay(1);
 796                        spin_lock(chip->mutex);
 797                        /* Nobody will touch it while it's in state FL_ERASE_SUSPENDING.
 798                           So we can just loop here. */
 799                }
 800                chip->state = FL_STATUS;
 801                return 0;
 802
 803        case FL_XIP_WHILE_ERASING:
 804                if (mode != FL_READY && mode != FL_POINT &&
 805                    (mode != FL_WRITING || !cfip || !(cfip->SuspendCmdSupport&1)))
 806                        goto sleep;
 807                chip->oldstate = chip->state;
 808                chip->state = FL_READY;
 809                return 0;
 810
 811        case FL_SHUTDOWN:
 812                /* The machine is rebooting now,so no one can get chip anymore */
 813                return -EIO;
 814        case FL_POINT:
 815                /* Only if there's no operation suspended... */
 816                if (mode == FL_READY && chip->oldstate == FL_READY)
 817                        return 0;
 818                /* Fall through */
 819        default:
 820        sleep:
 821                set_current_state(TASK_UNINTERRUPTIBLE);
 822                add_wait_queue(&chip->wq, &wait);
 823                spin_unlock(chip->mutex);
 824                schedule();
 825                remove_wait_queue(&chip->wq, &wait);
 826                spin_lock(chip->mutex);
 827                return -EAGAIN;
 828        }
 829}
 830
 831static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode)
 832{
 833        int ret;
 834        DECLARE_WAITQUEUE(wait, current);
Show full sources