irqchip/mbigen: Don't clear eventid when freeing an MSI
authorJianguo Chen <chenjianguo3@huawei.com>
Wed, 20 Mar 2019 18:54:21 +0000 (18:54 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 21 Mar 2019 11:08:26 +0000 (11:08 +0000)
mbigen_write_msg clears eventid bits of a mbigen register
when free a interrupt, because msi_domain_deactivate memset
struct msg to zero. Then multiple mbigen pins with zero eventid
will report the same interrupt number.

The eventid clear call trace:
                free_irq
                __free_irq
                irq_shutdown
                irq_domain_deactivate_irq
                __irq_domain_deactivate_irq
                __irq_domain_deactivate_irq
                msi_domain_deactivate
                platform_msi_write_msg
                mbigen_write_msg

Signed-off-by: Jianguo Chen <chenjianguo3@huawei.com>
[maz: massaged subject]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-mbigen.c

index 567b29c476081056232f13eed15a27c8d8d4fa64..98b6e1d4b1a68cf8a247f4c75a67d09fd11b6b08 100644 (file)
@@ -161,6 +161,9 @@ static void mbigen_write_msg(struct msi_desc *desc, struct msi_msg *msg)
        void __iomem *base = d->chip_data;
        u32 val;
 
+       if (!msg->address_lo && !msg->address_hi)
+               return;
        base += get_mbigen_vec_reg(d->hwirq);
        val = readl_relaxed(base);