> -----Original Message----- > From: Maxim Levitsky [mailto:maximlevitsky@xxxxxxxxx] > Sent: Thursday, August 05, 2010 5:43 PM > To: Madhusudhan > Cc: linux-mmc@xxxxxxxxxxxxxxx; 'Pierre Ossman' > Subject: Re: MMC card removal in suspend state > > On Thu, 2010-08-05 at 16:45 -0500, Madhusudhan wrote: > > Hi, > > > > Recently, while looking at some stuff I saw the below patch done by > Pierre > > which is part of the drivers/mmc/card/queue.c file. I wonder if someone > can > > through more light on this to understand where could be a potential > deadlock > > without calling mmc_queue_resume. > > > > Is there a need for the mmc queue to be resumed before calling > > del_gendisk(md->disk) in the card removal path?? > > Very recently I have seen that memstick core hangs if queue is > suspended, and del_gendisk is called, so that hang is real. Sorry, I have no clue what is memstick core. Do mean that calling del_gendisk when the queue is suspended could potentially hang? Regards, Madhu > It probably so happens that disk queue is already running at that point > so that users don't hit that hang. > > Best regards, > Maxim Levitsky > > > > > > Regards, > > Madhu > > > > commit d2b46f66b4b342be07a4194bd5e82384d07e470d > > Author: Pierre Ossman <drzeus@xxxxxxxxx> > > Date: Sat Apr 28 16:52:12 2007 +0200 > > > > mmc: allow suspended block driver to be removed > > > > Make sure we don't deadlock when removing a suspended block > > queue, something that might happen if the card is removed during > > suspend. > > > > Signed-off-by: Pierre Ossman <drzeus@xxxxxxxxx> > > > > diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c > > index aa75ac1..2e77963 100644 > > --- a/drivers/mmc/card/queue.c > > +++ b/drivers/mmc/card/queue.c > > @@ -191,6 +191,9 @@ void mmc_cleanup_queue(struct mmc_queue *mq) > > q->queuedata = NULL; > > spin_unlock_irqrestore(q->queue_lock, flags); > > > > + /* Make sure the queue isn't suspended, as that will deadlock */ > > + mmc_queue_resume(mq); > > + > > /* Then terminate our worker thread */ > > kthread_stop(mq->thread); > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > > the body of a message to majordomo@xxxxxxxxxxxxxxx > > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html