diff options
author | Alex Elder <elder@linaro.org> | 2021-07-27 21:46:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-27 22:02:06 +0200 |
commit | e70e410f8e7c000b5f44ecba8a1b40d2a2b8c6f1 (patch) | |
tree | 9c227a32b02bf957884c2dd76521e8b4359e4d95 /drivers/net/ipa | |
parent | net: ipa: make IPA interrupt handler threaded only (diff) | |
download | linux-e70e410f8e7c000b5f44ecba8a1b40d2a2b8c6f1.tar.xz linux-e70e410f8e7c000b5f44ecba8a1b40d2a2b8c6f1.zip |
net: ipa: clear disabled IPA interrupt conditions
We ignore any IPA interrupt that has no handler. If any interrupt
conditions without a handler exist when an IPA interrupt occurs,
clear those conditions. Add a debug message to report which ones
are being cleared.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa')
-rw-r--r-- | drivers/net/ipa/ipa_interrupt.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 7dee4ebaf5a9..c12d0c33557c 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -79,6 +79,7 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) { struct ipa *ipa = interrupt->ipa; u32 enabled = interrupt->enabled; + u32 pending; u32 offset; u32 mask; @@ -87,8 +88,8 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) * only the enabled ones. */ offset = ipa_reg_irq_stts_offset(ipa->version); - mask = ioread32(ipa->reg_virt + offset); - while ((mask &= enabled)) { + pending = ioread32(ipa->reg_virt + offset); + while ((mask = pending & enabled)) { do { u32 irq_id = __ffs(mask); @@ -96,7 +97,17 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) ipa_interrupt_process(interrupt, irq_id); } while (mask); - mask = ioread32(ipa->reg_virt + offset); + pending = ioread32(ipa->reg_virt + offset); + } + + /* If any disabled interrupts are pending, clear them */ + if (pending) { + struct device *dev = &ipa->pdev->dev; + + dev_dbg(dev, "clearing disabled IPA interrupts 0x%08x\n", + pending); + offset = ipa_reg_irq_clr_offset(ipa->version); + iowrite32(pending, ipa->reg_virt + offset); } } |