memory: tegra: Do not handle spurious interrupts
authorDmitry Osipenko <digetx@gmail.com>
Mon, 9 Apr 2018 19:28:27 +0000 (22:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:38 +0000 (07:50 +0200)
[ Upstream commit bf3fbdfbec947cdd04b2f2c4bce11534c8786eee ]

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 <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/memory/tegra/mc.c

index a4803ac192bbc86f550d35f4e8eb236c77aeafd6..d2005b99582193879c0722a6cd3d47cbc7ed5c53 100644 (file)
@@ -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, &status, 32) {
                const char *error = status_names[bit] ?: "unknown";