public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC
@ 2015-05-18 14:23 Prabu Thangamuthu
  2015-05-22 13:21 ` Ulf Hansson
  0 siblings, 1 reply; 4+ messages in thread
From: Prabu Thangamuthu @ 2015-05-18 14:23 UTC (permalink / raw)
  To: Seungwon Jeon, Jaehoon Chung, Ulf Hansson,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
  Cc: Manjunath M Bettegowda, prabu.t@synopsys.com

Removing dw_mmc driver immediately after inserting the dw_mmc driver is 
getting hung for eMMC device. Root cause for this issue is, dw_mci_remove
will disable all the interrupts then it will call dw_mci_cleanup_slot.
dw_mci_cleanup_slot is issuing CMD6 to disable boot partition access and
it's waiting for command complete interrupt. Since INTMASK was already
cleared by dw_mci_remove, command complete interrupt is not reaching 
the system. This leads to process hung.

Signed-off-by: Prabu Thangamuthu <prabu.t@synopsys.com>
---
 drivers/mmc/host/dw_mmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 5f5adaf..f0a0aff 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2941,15 +2941,15 @@ void dw_mci_remove(struct dw_mci *host)
 {
 	int i;
 
-	mci_writel(host, RINTSTS, 0xFFFFFFFF);
-	mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
-
 	for (i = 0; i < host->num_slots; i++) {
 		dev_dbg(host->dev, "remove slot %d\n", i);
 		if (host->slot[i])
 			dw_mci_cleanup_slot(host->slot[i], i);
 	}
 
+	mci_writel(host, RINTSTS, 0xFFFFFFFF);
+	mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
+
 	/* disable clock to CIU */
 	mci_writel(host, CLKENA, 0);
 	mci_writel(host, CLKSRC, 0);
-- 
1.7.6.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC
  2015-05-18 14:23 [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC Prabu Thangamuthu
@ 2015-05-22 13:21 ` Ulf Hansson
  2015-05-27  1:50   ` Jaehoon Chung
  0 siblings, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2015-05-22 13:21 UTC (permalink / raw)
  To: Prabu Thangamuthu
  Cc: Seungwon Jeon, Jaehoon Chung, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Manjunath M Bettegowda

On 18 May 2015 at 16:23, Prabu Thangamuthu <Prabu.T@synopsys.com> wrote:
> Removing dw_mmc driver immediately after inserting the dw_mmc driver is

I guess it hangs even if you remove it after a couple of days? :-)

Perhaps makes this a bit more clear?

> getting hung for eMMC device. Root cause for this issue is, dw_mci_remove
> will disable all the interrupts then it will call dw_mci_cleanup_slot.
> dw_mci_cleanup_slot is issuing CMD6 to disable boot partition access and
> it's waiting for command complete interrupt. Since INTMASK was already
> cleared by dw_mci_remove, command complete interrupt is not reaching
> the system. This leads to process hung.

/s dw_mci_remove / dw_mci_remove()

>
> Signed-off-by: Prabu Thangamuthu <prabu.t@synopsys.com>

This patch looks good overall, but please send a new version with
updated changelog. Moreover, please use "mmc: dw_mmc:" as prefix for
the commit message header.

Kind regards
Uffe

> ---
>  drivers/mmc/host/dw_mmc.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 5f5adaf..f0a0aff 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2941,15 +2941,15 @@ void dw_mci_remove(struct dw_mci *host)
>  {
>         int i;
>
> -       mci_writel(host, RINTSTS, 0xFFFFFFFF);
> -       mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
> -
>         for (i = 0; i < host->num_slots; i++) {
>                 dev_dbg(host->dev, "remove slot %d\n", i);
>                 if (host->slot[i])
>                         dw_mci_cleanup_slot(host->slot[i], i);
>         }
>
> +       mci_writel(host, RINTSTS, 0xFFFFFFFF);
> +       mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
> +
>         /* disable clock to CIU */
>         mci_writel(host, CLKENA, 0);
>         mci_writel(host, CLKSRC, 0);
> --
> 1.7.6.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC
  2015-05-22 13:21 ` Ulf Hansson
@ 2015-05-27  1:50   ` Jaehoon Chung
  2015-05-27  5:15     ` Prabu Thangamuthu
  0 siblings, 1 reply; 4+ messages in thread
From: Jaehoon Chung @ 2015-05-27  1:50 UTC (permalink / raw)
  To: Ulf Hansson, Prabu Thangamuthu
  Cc: Seungwon Jeon, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Manjunath M Bettegowda

Hi, Pradu.

Sorry for late.
I will wait for your next version than i will check yours.

To Ulf.

Thanks for review!

Best Regards,
Jaehoon Chung

On 05/22/2015 10:21 PM, Ulf Hansson wrote:
> On 18 May 2015 at 16:23, Prabu Thangamuthu <Prabu.T@synopsys.com> wrote:
>> Removing dw_mmc driver immediately after inserting the dw_mmc driver is
> 
> I guess it hangs even if you remove it after a couple of days? :-)
> 
> Perhaps makes this a bit more clear?
> 
>> getting hung for eMMC device. Root cause for this issue is, dw_mci_remove
>> will disable all the interrupts then it will call dw_mci_cleanup_slot.
>> dw_mci_cleanup_slot is issuing CMD6 to disable boot partition access and
>> it's waiting for command complete interrupt. Since INTMASK was already
>> cleared by dw_mci_remove, command complete interrupt is not reaching
>> the system. This leads to process hung.
> 
> /s dw_mci_remove / dw_mci_remove()
> 
>>
>> Signed-off-by: Prabu Thangamuthu <prabu.t@synopsys.com>
> 
> This patch looks good overall, but please send a new version with
> updated changelog. Moreover, please use "mmc: dw_mmc:" as prefix for
> the commit message header.
> 
> Kind regards
> Uffe
> 
>> ---
>>  drivers/mmc/host/dw_mmc.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 5f5adaf..f0a0aff 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -2941,15 +2941,15 @@ void dw_mci_remove(struct dw_mci *host)
>>  {
>>         int i;
>>
>> -       mci_writel(host, RINTSTS, 0xFFFFFFFF);
>> -       mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
>> -
>>         for (i = 0; i < host->num_slots; i++) {
>>                 dev_dbg(host->dev, "remove slot %d\n", i);
>>                 if (host->slot[i])
>>                         dw_mci_cleanup_slot(host->slot[i], i);
>>         }
>>
>> +       mci_writel(host, RINTSTS, 0xFFFFFFFF);
>> +       mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
>> +
>>         /* disable clock to CIU */
>>         mci_writel(host, CLKENA, 0);
>>         mci_writel(host, CLKSRC, 0);
>> --
>> 1.7.6.5
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC
  2015-05-27  1:50   ` Jaehoon Chung
@ 2015-05-27  5:15     ` Prabu Thangamuthu
  0 siblings, 0 replies; 4+ messages in thread
From: Prabu Thangamuthu @ 2015-05-27  5:15 UTC (permalink / raw)
  To: Ulf Hansson, Jaehoon Chung
  Cc: Seungwon Jeon, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Manjunath M Bettegowda,
	prabu.t@synopsys.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2666 bytes --]

Hi Ulf, Jaehoon,

Thanks for your comments, I will update and send a new Patch.

> On  05/27/2015 7:20 AM, Jaehoon Chung Wrote:
>
> Hi, Pradu.
> 
> Sorry for late.
No Problem.
> I will wait for your next version than i will check yours.
> To Ulf.
> 
> Thanks for review!
> 
> Best Regards,
> Jaehoon Chung
> 
> On 05/22/2015 10:21 PM, Ulf Hansson wrote:
> > On 18 May 2015 at 16:23, Prabu Thangamuthu <Prabu.T@synopsys.com>
> wrote:
> >> Removing dw_mmc driver immediately after inserting the dw_mmc driver
> >> is
> >
> > I guess it hangs even if you remove it after a couple of days? :-)
> >
> > Perhaps makes this a bit more clear?
> >
> >> getting hung for eMMC device. Root cause for this issue is,
> >> dw_mci_remove will disable all the interrupts then it will call
> dw_mci_cleanup_slot.
> >> dw_mci_cleanup_slot is issuing CMD6 to disable boot partition access
> >> and it's waiting for command complete interrupt. Since INTMASK was
> >> already cleared by dw_mci_remove, command complete interrupt is not
> >> reaching the system. This leads to process hung.
> >
> > /s dw_mci_remove / dw_mci_remove()
> >
> >>
> >> Signed-off-by: Prabu Thangamuthu <prabu.t@synopsys.com>
> >
> > This patch looks good overall, but please send a new version with
> > updated changelog. Moreover, please use "mmc: dw_mmc:" as prefix for
> > the commit message header.
> >
> > Kind regards
> > Uffe
> >
> >> ---
> >>  drivers/mmc/host/dw_mmc.c |    6 +++---
> >>  1 files changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> >> index 5f5adaf..f0a0aff 100644
> >> --- a/drivers/mmc/host/dw_mmc.c
> >> +++ b/drivers/mmc/host/dw_mmc.c
> >> @@ -2941,15 +2941,15 @@ void dw_mci_remove(struct dw_mci *host)  {
> >>         int i;
> >>
> >> -       mci_writel(host, RINTSTS, 0xFFFFFFFF);
> >> -       mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */
> >> -
> >>         for (i = 0; i < host->num_slots; i++) {
> >>                 dev_dbg(host->dev, "remove slot %d\n", i);
> >>                 if (host->slot[i])
> >>                         dw_mci_cleanup_slot(host->slot[i], i);
> >>         }
> >>
> >> +       mci_writel(host, RINTSTS, 0xFFFFFFFF);
> >> +       mci_writel(host, INTMASK, 0); /* disable all mmc interrupt
> >> + first */
> >> +
> >>         /* disable clock to CIU */
> >>         mci_writel(host, CLKENA, 0);
> >>         mci_writel(host, CLKSRC, 0);
> >> --
> >> 1.7.6.5
> >

Thanks & Regards,
Prabu Thangamuthu.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-27  5:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 14:23 [PATCH 1/1] dw_mmc: insmod followed by rmmod will hung for eMMC Prabu Thangamuthu
2015-05-22 13:21 ` Ulf Hansson
2015-05-27  1:50   ` Jaehoon Chung
2015-05-27  5:15     ` Prabu Thangamuthu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox