* [PATCH] tmio_mmc: Make ack_mmc_irqs() write-only
@ 2010-07-20 7:51 Yusuke Goda
2010-07-23 11:10 ` Magnus Damm
2010-08-20 15:12 ` Arnd Hannemann
0 siblings, 2 replies; 4+ messages in thread
From: Yusuke Goda @ 2010-07-20 7:51 UTC (permalink / raw)
To: ian, damm, sameo, Paul Mundt, g.liakhovetski, linux-mmc,
linux-kernel
Cc: Andrew Morton
This patch updates ack_mmc_irqs() to acknowledge using write instead
of read-modify-write. Without this fix the old read-modify-write
implementation may acknowledge interrupt sources by mistake. The
driver may if so lock-up waiting forever for an interrupt that will
never come. Observed with the TMIO_STAT_RXRDY bit together with CMD53
on AR6002 and BCM4318 SDIO cards in polled mode.
Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
---
drivers/mmc/host/tmio_mmc.h | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 64f7d5d..7944604 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -82,10 +82,7 @@
#define ack_mmc_irqs(host, i) \
do { \
- u32 mask;\
- mask = sd_ctrl_read32((host), CTL_STATUS); \
- mask &= ~((i) & TMIO_MASK_IRQ); \
- sd_ctrl_write32((host), CTL_STATUS, mask); \
+ sd_ctrl_write32((host), CTL_STATUS, ~(i)); \
} while (0)
--
1.7.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tmio_mmc: Make ack_mmc_irqs() write-only
2010-07-20 7:51 [PATCH] tmio_mmc: Make ack_mmc_irqs() write-only Yusuke Goda
@ 2010-07-23 11:10 ` Magnus Damm
2010-08-20 15:12 ` Arnd Hannemann
1 sibling, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2010-07-23 11:10 UTC (permalink / raw)
To: Yusuke Goda
Cc: ian, damm, sameo, Paul Mundt, g.liakhovetski, linux-mmc,
linux-kernel, Andrew Morton
2010/7/20 Yusuke Goda <yusuke.goda.sx@renesas.com>:
> This patch updates ack_mmc_irqs() to acknowledge using write instead
> of read-modify-write. Without this fix the old read-modify-write
> implementation may acknowledge interrupt sources by mistake. The
> driver may if so lock-up waiting forever for an interrupt that will
> never come. Observed with the TMIO_STAT_RXRDY bit together with CMD53
> on AR6002 and BCM4318 SDIO cards in polled mode.
>
> Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Simple testing with a BCM4318 card and a MMC card on sh7372 and SDHI
shows no problems.
Acked-by: Magnus Damm <damm@opensource.se>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tmio_mmc: Make ack_mmc_irqs() write-only
2010-07-20 7:51 [PATCH] tmio_mmc: Make ack_mmc_irqs() write-only Yusuke Goda
2010-07-23 11:10 ` Magnus Damm
@ 2010-08-20 15:12 ` Arnd Hannemann
2010-08-20 22:55 ` Magnus Damm
1 sibling, 1 reply; 4+ messages in thread
From: Arnd Hannemann @ 2010-08-20 15:12 UTC (permalink / raw)
To: Yusuke Goda
Cc: ian, damm, sameo, Paul Mundt, g.liakhovetski, linux-mmc,
linux-kernel, Andrew Morton
Am 20.07.2010 09:51, schrieb Yusuke Goda:
> This patch updates ack_mmc_irqs() to acknowledge using write instead
> of read-modify-write. Without this fix the old read-modify-write
> implementation may acknowledge interrupt sources by mistake. The
> driver may if so lock-up waiting forever for an interrupt that will
> never come. Observed with the TMIO_STAT_RXRDY bit together with
> CMD53 on AR6002 and BCM4318 SDIO cards in polled mode.
>
> Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Tested on AP4EVB (sh7372) with SDHC and MMC cards - no regression.
Tested-by: Arnd Hannemann <arnd@arndnet.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tmio_mmc: Make ack_mmc_irqs() write-only
2010-08-20 15:12 ` Arnd Hannemann
@ 2010-08-20 22:55 ` Magnus Damm
0 siblings, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2010-08-20 22:55 UTC (permalink / raw)
To: Arnd Hannemann, Andrew Morton
Cc: Yusuke Goda, ian, damm, sameo, Paul Mundt, g.liakhovetski,
linux-mmc, linux-kernel
On Sat, Aug 21, 2010 at 12:12 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
> Am 20.07.2010 09:51, schrieb Yusuke Goda:
>> This patch updates ack_mmc_irqs() to acknowledge using write instead
>> of read-modify-write. Without this fix the old read-modify-write
>> implementation may acknowledge interrupt sources by mistake. The
>> driver may if so lock-up waiting forever for an interrupt that will
>> never come. Observed with the TMIO_STAT_RXRDY bit together with
>> CMD53 on AR6002 and BCM4318 SDIO cards in polled mode.
>>
>> Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
>
> Tested on AP4EVB (sh7372) with SDHC and MMC cards - no regression.
>
> Tested-by: Arnd Hannemann <arnd@arndnet.de>
Thanks, Arnd!
Andrew, is there anything you need to (re)pick-up this patch?
At the current point this patch has:
Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Tested-by: Arnd Hannemann <arnd@arndnet.de>
Ian Molton also gave his "Acked-by" in a different email thread,
please see below:
On Tue, Jul 27, 2010 at 5:11 PM, Ian Molton <ian@mnementh.co.uk> wrote:
> Right now, the docs in question are on my dead fileserver.
>
> Given that, I'll say two things:
>
> 1) Its safe to assume anywhere that does a RMW does it because my
> original docs said so. I dont recall having ever "just done it because
> I had to" when I wrote this.
> 2) The code as is is clearly broken.
>
> I'm not really sure what to do about this. It got made 'doubly broken'
> when we added asic3 support because it was the first platform added
> where you couldnt just do a 32 bit RMW on the pair of registers.
>
> I'm inclined to say "Go Go Go" and see if anything breaks on this one.
> I cant see why the docs want it to be RMW as theres nothing stopping
> the hardware asserting an IRQ even if the CPU disables IRQs / did the
> RMW as an atomic op.
>
> This one therefore,
>
> Acked-by: Ian Molton <ian@mnementh.co.uk>
Thanks for the help everyone and sorry about the confused state of things.
/ magnus
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-20 22:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20 7:51 [PATCH] tmio_mmc: Make ack_mmc_irqs() write-only Yusuke Goda
2010-07-23 11:10 ` Magnus Damm
2010-08-20 15:12 ` Arnd Hannemann
2010-08-20 22:55 ` Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox