net: ipa: don't bother zeroing an already zero register
authorAlex Elder <elder@linaro.org>
Fri, 23 Feb 2024 13:39:30 +0000 (07:39 -0600)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 27 Feb 2024 10:24:04 +0000 (11:24 +0100)
In ipa_interrupt_suspend_clear_all(), if the SUSPEND_INFO register
read contains no set bits, there's no interrupt condition to clear.
Skip the write to the clear register in that case.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ipa/ipa_interrupt.c

index 501962cc4e90fe2ac47c5138f6155db108b7a7c7..4d80bf77a53239d58873b48f8b1485ddc86b5a35 100644 (file)
@@ -59,7 +59,7 @@ static void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt)
                val = ioread32(ipa->reg_virt + reg_n_offset(reg, unit));
 
                /* SUSPEND interrupt status isn't cleared on IPA version 3.0 */
-               if (ipa->version == IPA_VERSION_3_0)
+               if (!val || ipa->version == IPA_VERSION_3_0)
                        continue;
 
                reg = ipa_reg(ipa, IRQ_SUSPEND_CLR);