OMAP HSMMC: fix a racing case between kmmcd and omap_hsmmc_suspend
Subsystems (2)
PATCH 1/1 OMAP HSMMC: fix a racing case between kmmcd and omap_hsmmc_suspend
If suspend called when kmmcd is doing host->ops->disable,
as kmmcd already increased host->en_dis_recurs to 1, the mmc_host_enable in suspend function will return directly without increase the nesting_cnt, which will cause the followed register access carried out to the disabled host.
mmc_suspend_host will enable host itself. No need to enable host before it. Also works on kmmcd will get flushed in mmc_suspend_host, enable host after it will be safe. So make the mmc_host_enable after it.
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/omap_hsmmc.c +1 -1
@@ -2291,8 +2291,8 @@ static int omap_hsmmc_suspend(struct device *dev) } }cancel_work_sync (&host->mmc_carddetect_work); -mmc_host_enable (host->mmc); ret =mmc_suspend_host (host->mmc); +mmc_host_enable (host->mmc);if (ret ==0 ) {omap_hsmmc_disable_irq (host); OMAP_HSMMC_WRITE(host->base, HCTL,
--
1.5.6.5
Quoted 10 lines · Ethan Du
If suspend called when kmmcd is doing
host->ops->disable,
as kmmcd already increasedhost->en_dis_recursto 1, themmc_host_enablein suspend function will return directly without increase thenesting_cnt, which will cause the followed register access carried out to the disabled host.
mmc_suspend_hostwill enable host itself. No need to enable host before it. Also works on kmmcd will get flushed inmmc_suspend_host, enable host after it will be safe. So make themmc_host_enableafter it.Signed-off-by Ethan <[email protected]>
Looks good to me
Quoted 25 lines
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mmc/host/omap_hsmmc.c +1
-2@@ -2291,8 +2291,8 @@ static int omap_hsmmc_suspend(struct device *dev) } }cancel_work_sync (&host->mmc_carddetect_work); -mmc_host_enable (host->mmc); ret =mmc_suspend_host (host->mmc); +mmc_host_enable (host->mmc);if (ret ==0 ) {omap_hsmmc_disable_irq (host); OMAP_HSMMC_WRITE(host->base, HCTL, --1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Hunter Adrian (Nokia-D/Helsinki)
Quoted 9 lines · Ethan Du
If suspend called when kmmcd is doing
host->ops->disable,
as kmmcd already increasedhost->en_dis_recursto 1, themmc_host_enablein suspend function will return directly without increase thenesting_cnt, which will cause the followed register access carried out to the disabled host.
mmc_suspend_hostwill enable host itself. No need to enable host before it. Also works on kmmcd will get flushed inmmc_suspend_host, enable host after it will be safe. So make themmc_host_enableafter it.
Quoted 6 lines
Quoted 1 line
Signed-off-by Ethan <[email protected]>Looks good to me
Acked-by Adrian Hunter <[email protected]>
Ping?
Ethan asked me what is happening to this.
Is is OK Madhu?
Andrew can you take it?
Quoted 31 lines
Quoted 19 lines
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mmc/host/omap_hsmmc.c +1
-2@@ -2291,8 +2291,8 @@ static int omap_hsmmc_suspend(struct device *dev) } }cancel_work_sync (&host->mmc_carddetect_work); -mmc_host_enable (host->mmc); ret =mmc_suspend_host (host->mmc); +mmc_host_enable (host->mmc);if (ret ==0 ) {omap_hsmmc_disable_irq (host); OMAP_HSMMC_WRITE(host->base, HCTL, --Quoted 6 lines
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Madhusudhan
Acked-byQuoted 33 lines
-----Original Message-----
From: Adrian Hunter [mailto:[email protected]]
Sent: Tuesday, July 06, 2010 1:11 PM
To: Madhusudhan Chikkature
Cc: Hunter Adrian (Nokia-D/Helsinki); Ethan Du; linux-mmc; Andrew Morton
Subject: Re: [PATCH] OMAP HSMMC: fix a racing case between kmmcd andomap_hsmmc_suspendQuoted 3 lines · Hunter Adrian (Nokia-D/Helsinki)
Quoted 2 lines · Ethan Du
If suspend called when kmmcd is doing
host->ops->disable, as kmmcd already increasedhost->en_dis_recursto 1, the
mmc_host_enableQuoted 1 line
Quoted 1 line
in suspend function will return directly without increase the
nesting_cnt,Quoted 1 line
Quoted 1 line
which will cause the followed register access carried out to the
disabled host.
Quoted 2 lines
Quoted 2 lines
mmc_suspend_hostwill enable host itself. No need to enable host beforeit.
Quoted 1 line
Quoted 1 line
Also works on kmmcd will get flushed in
mmc_suspend_host, enable hostafter
Quoted 8 lines
Quoted 3 lines
it will be safe. So make the
mmc_host_enableafter it.Signed-off-by Ethan <[email protected]>Looks good to me
Acked-by Adrian Hunter <[email protected]>
Quoted 8 lines
Ping?
Ethan asked me what is happening to this.
Is is OK Madhu?
Andrew can you take it?
Sorry, I missed to look at this patch. It looks good.
Quoted 32 lines
Quoted 5 lines
Review
Quoted 5 lines
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/mmc/host/omap_hsmmc.cQuoted 26 lines
Quoted 14 lines
index b032828..fc74263 100644
drivers/mmc/host/omap_hsmmc.c +1
-2@@ -2291,8 +2291,8 @@ static int omap_hsmmc_suspend(struct device *dev) } }cancel_work_sync (&host->mmc_carddetect_work); -mmc_host_enable (host->mmc); ret =mmc_suspend_host (host->mmc); +mmc_host_enable (host->mmc);if (ret ==0 ) {omap_hsmmc_disable_irq (host); OMAP_HSMMC_WRITE(host->base, HCTL, --Quoted 6 lines
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH RESEND 1/1 OMAP HSMMC: fix a racing case between kmmcd and omap_hsmmc_suspend
In reply to Ethan DuHi,
This doesn't seem to have been merged -- Andrew, could you take it?
From: Ethan Du <[email protected]>
Date: Mon, 21 Jun 2010 19:20:41 +0800
If suspend called when kmmcd is doing host->ops->disable,
as kmmcd already increased host->en_dis_recurs to 1, the mmc_host_enable in suspend function will return directly without increase the nesting_cnt, which will cause the followed register access carried out to the disabled host.
mmc_suspend_host will enable host itself. No need to enable host before it. Also works on kmmcd will get flushed in mmc_suspend_host, enable host after it will be safe. So make the mmc_host_enable after it.
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/omap_hsmmc.c +1 -1
@@ -2323,8 +2323,8 @@ static int omap_hsmmc_suspend(struct device *dev) } }cancel_work_sync (&host->mmc_carddetect_work); -mmc_host_enable (host->mmc); ret =mmc_suspend_host (host->mmc); +mmc_host_enable (host->mmc);if (ret ==0 ) {omap_hsmmc_disable_irq (host); OMAP_HSMMC_WRITE(host->base, HCTL,
--
1.7.0.1
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child