Skip to contentSkip to conversation

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

PATCH In review Vitaly Wool 2 participants 4 messages Nov 23, 2006 – Nov 27, 2006 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

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

Hello Pierre,

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

The patch inlined below fixes this problem.

 drivers/mmc/mmc_queue.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/mmc_queue.c +3 -1
Index: linux-2.6.18/drivers/mmc/mmc_queue.c
===================================================================
@@ -84,8 +84,10 @@ static int mmc_queue_thread(void *d)
 		spin_unlock_irq(q->queue_lock);
 
 		if (!req) {
-			if (mq->flags & MMC_QUEUE_EXIT)
+			if (mq->flags & MMC_QUEUE_EXIT) {
+				set_current_state(TASK_RUNNING);
 				break;
+			}
 			up(&mq->thread_sem);
 			schedule();
 			down(&mq->thread_sem);
#1 lore raw
Quoted 7 lines · Vitaly Wool

Hello Pierre,

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

Hmm... I can't find any such requirement in HEAD, or 2.6.18. What kernel are you running?

Rgds

Signature · 5 lines
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org
#2 lore raw
Quoted 2 lines · Pierre Ossman

Hmm... I can't find any such requirement in HEAD, or 2.6.18. What kernel are you running?

2.6.18 + -rt patches by Ingo.

Vitaly

#3 lore raw
Quoted 6 lines · Vitaly Wool
Quoted 2 lines · Pierre Ossman

Hmm... I can't find any such requirement in HEAD, or 2.6.18. What kernel are you running?

2.6.18 + -rt patches by Ingo.

I guess the check is in the rt set somewhere then.

Anyway, the mmc queue thread has undergone some changes so your patch needs a bit of a tweak. But I'll put it on my todo and make sure it gets in during the next merge window.

Rgds

Signature · 5 lines
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org