Commit 7b30d281b9c115890c75d11eaf06881261c256da

Authored by Vitaly Wool
Committed by Pierre Ossman
1 parent f3a8efa90b

mmc: fix "prev->state: 2 != TASK_RUNNING??" problem on SD/MMC card removal

Currently on SD/MMC card removal the system exhibits the following message (the platform is ARM Versatile):

    prev->state: 2 != TASK_RUNNING??
    mmcqd/762[CPU#0]: BUG in __schedule at linux-2.6/kernel/sched.c:3826

(akpm: someone tried to fix this, but it's still wrong)

Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

drivers/mmc/mmc_queue.c
... ... @@ -78,8 +78,10 @@
78 78 spin_unlock_irq(q->queue_lock);
79 79  
80 80 if (!req) {
81   - if (kthread_should_stop())
  81 + if (kthread_should_stop()) {
  82 + set_current_state(TASK_RUNNING);
82 83 break;
  84 + }
83 85 up(&mq->thread_sem);
84 86 schedule();
85 87 down(&mq->thread_sem);