Re: [PATCH] ARM: at91: fix rtc irq mask for sam9x5 SoCs
From: Andrew Morton
Date: Thu May 29 2014 - 19:09:53 EST
On Fri, 9 May 2014 18:36:52 +0200 Johan Hovold <johan@xxxxxxxxxx> wrote:
> On Thu, May 08, 2014 at 07:28:04PM +0200, Boris BREZILLON wrote:
>
> > > You should also keep the flush (read of IMR) regardless (to make sure
> > > the write has reached the peripheral), and remember to remove the now
> > > unused mask variable.
> >
> > Does it has something to do with memory barriers ?
> > If so, why not using writel instead of writel_relaxed ?
>
> You only need to use the non-relaxed version when synchronising with DMA
> operations.
>
> The read-back of a register on the same device is a common technique to
> make sure that preceding write has actually reached the peripheral
> (write posting or flushing). In this case, it is used to make
> (reasonably) sure that interrupts have actually been masked before
> returning. (In the general case, you'd even need to verify the read-back
> value to be certain that the device has changed its state.)
>
So I grabbed this patch as it's tied to "rtc: rtc-at91rm9200: fix
uninterruptible wait for ACKUPD" and is not in linux-next. Someone
shout at me if that was a mistake.
From: Boris BREZILLON <boris.brezillon@xxxxxxxxxxxxxxxxxx>
Subject: ARM: at91: fix rtc irq mask for sam9x5 SoCs
The RTC IMR register is not reliable on sam9x5 SoCs, hence why me have to
mask all interrupts no matter what IMR claims about already masked irqs.
Mark said:
: Atmel actually has this issue in the Errata of the SAM9G25 and SAM9G35
: datasheets which might be worth referencing in the description?
Signed-off-by: Boris BREZILLON <boris.brezillon@xxxxxxxxxxxxxxxxxx>
Reported-by: Bryan Evenson <bevenson@xxxxxxxxxxxxxx>
Tested-by: Bryan Evenson <bevenson@xxxxxxxxxxxxxx>
Cc: Andrew Victor <linux@xxxxxxxxxxxx>
Cc: Nicolas Ferre <nicolas.ferre@xxxxxxxxx>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@xxxxxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Cc: Mark Roszko <mark.roszko@xxxxxxxxx>
Cc: Johan Hovold <johan@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
arch/arm/mach-at91/sysirq_mask.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff -puN arch/arm/mach-at91/sysirq_mask.c~arm-at91-fix-rtc-irq-mask-for-sam9x5-socs arch/arm/mach-at91/sysirq_mask.c
--- a/arch/arm/mach-at91/sysirq_mask.c~arm-at91-fix-rtc-irq-mask-for-sam9x5-socs
+++ a/arch/arm/mach-at91/sysirq_mask.c
@@ -37,12 +37,7 @@ void __init at91_sysirq_mask_rtc(u32 rtc
if (!base)
return;
- mask = readl_relaxed(base + AT91_RTC_IMR);
- if (mask) {
- pr_info("AT91: Disabling rtc irq\n");
- writel_relaxed(mask, base + AT91_RTC_IDR);
- (void)readl_relaxed(base + AT91_RTC_IMR); /* flush */
- }
+ writel_relaxed(0x1f, base + AT91_RTC_IDR);
iounmap(base);
}
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/