Re: [PATCH v4 05/15] memory: tegra: Do not handle spurious interrupts

2018-04-27 Thread Thierry Reding
On Mon, Apr 09, 2018 at 10:28:27PM +0300, Dmitry Osipenko wrote:
> The ISR reads interrupts-enable mask, but doesn't utilize it. Apply the
> mask to the interrupt status and don't handle interrupts that MC driver
> haven't asked for. Kernel would disable spurious MC IRQ and report the
> error. This would happen only in a case of a very severe bug.
> 
> Signed-off-by: Dmitry Osipenko 
> ---
>  drivers/memory/tegra/mc.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH v4 05/15] memory: tegra: Do not handle spurious interrupts

2018-04-27 Thread Thierry Reding
On Mon, Apr 09, 2018 at 10:28:27PM +0300, Dmitry Osipenko wrote:
> The ISR reads interrupts-enable mask, but doesn't utilize it. Apply the
> mask to the interrupt status and don't handle interrupts that MC driver
> haven't asked for. Kernel would disable spurious MC IRQ and report the
> error. This would happen only in a case of a very severe bug.
> 
> Signed-off-by: Dmitry Osipenko 
> ---
>  drivers/memory/tegra/mc.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry


signature.asc
Description: PGP signature


[PATCH v4 05/15] memory: tegra: Do not handle spurious interrupts

2018-04-09 Thread Dmitry Osipenko
The ISR reads interrupts-enable mask, but doesn't utilize it. Apply the
mask to the interrupt status and don't handle interrupts that MC driver
haven't asked for. Kernel would disable spurious MC IRQ and report the
error. This would happen only in a case of a very severe bug.

Signed-off-by: Dmitry Osipenko 
---
 drivers/memory/tegra/mc.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index a4803ac192bb..d2005b995821 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -252,8 +252,11 @@ static irqreturn_t tegra_mc_irq(int irq, void *data)
unsigned int bit;
 
/* mask all interrupts to avoid flooding */
-   status = mc_readl(mc, MC_INTSTATUS);
mask = mc_readl(mc, MC_INTMASK);
+   status = mc_readl(mc, MC_INTSTATUS) & mask;
+
+   if (!status)
+   return IRQ_NONE;
 
for_each_set_bit(bit, , 32) {
const char *error = status_names[bit] ?: "unknown";
-- 
2.16.3



[PATCH v4 05/15] memory: tegra: Do not handle spurious interrupts

2018-04-09 Thread Dmitry Osipenko
The ISR reads interrupts-enable mask, but doesn't utilize it. Apply the
mask to the interrupt status and don't handle interrupts that MC driver
haven't asked for. Kernel would disable spurious MC IRQ and report the
error. This would happen only in a case of a very severe bug.

Signed-off-by: Dmitry Osipenko 
---
 drivers/memory/tegra/mc.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index a4803ac192bb..d2005b995821 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -252,8 +252,11 @@ static irqreturn_t tegra_mc_irq(int irq, void *data)
unsigned int bit;
 
/* mask all interrupts to avoid flooding */
-   status = mc_readl(mc, MC_INTSTATUS);
mask = mc_readl(mc, MC_INTMASK);
+   status = mc_readl(mc, MC_INTSTATUS) & mask;
+
+   if (!status)
+   return IRQ_NONE;
 
for_each_set_bit(bit, , 32) {
const char *error = status_names[bit] ?: "unknown";
-- 
2.16.3