mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "irqchip-bot for Jianmin Lv" <tip-bot2@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, Jianmin Lv <lvjianmin@loongson.cn>,
	Marc Zyngier <maz@kernel.org>,
	tglx@linutronix.de
Subject: [irqchip: irq/irqchip-next] irqchip/loongson-pch-pic: Fix pch_pic_acpi_init calling
Date: Sat, 08 Apr 2023 10:45:13 -0000	[thread overview]
Message-ID: <168095071385.404.4377714261555782246.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230407083453.6305-6-lvjianmin@loongson.cn>

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     48ce2d722f7f108f27bedddf54bee3423a57ce57
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/48ce2d722f7f108f27bedddf54bee3423a57ce57
Author:        Jianmin Lv <lvjianmin@loongson.cn>
AuthorDate:    Fri, 07 Apr 2023 16:34:53 +08:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Sat, 08 Apr 2023 11:29:18 +01:00

irqchip/loongson-pch-pic: Fix pch_pic_acpi_init calling

For dual-bridges scenario, pch_pic_acpi_init() will be called
in following path:

cpuintc_acpi_init
  acpi_cascade_irqdomain_init(in cpuintc driver)
    acpi_table_parse_madt
      eiointc_parse_madt
        eiointc_acpi_init /* this will be called two times
                             correspondingto parsing two
                             eiointc entries in MADT under
                             dual-bridges scenario*/
          acpi_cascade_irqdomain_init(in eiointc driver)
            acpi_table_parse_madt
              pch_pic_parse_madt
                pch_pic_acpi_init /* this will be called depend
                                     on valid parent IRQ domain
                                     handle for one or two times
                                     corresponding to parsing
                                     two pchpic entries in MADT
                                     druring calling
                                     eiointc_acpi_init() under
                                     dual-bridges scenario*/

During the first eiointc_acpi_init() calling, the
pch_pic_acpi_init() will be called just one time since only
one valid parent IRQ domain handle will be found for current
eiointc IRQ domain.

During the second eiointc_acpi_init() calling, the
pch_pic_acpi_init() will be called two times since two valid
parent IRQ domain handles will be found. So in pch_pic_acpi_init(),
we must have a reasonable way to prevent from creating second same
pch_pic IRQ domain.

The patch matches gsi base information in created pch_pic IRQ
domains to check if the target domain has been created to avoid the
bug mentioned above.

Cc: stable@vger.kernel.org
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230407083453.6305-6-lvjianmin@loongson.cn
---
 drivers/irqchip/irq-loongson-pch-pic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c
index 64fa67d..e5fe4d5 100644
--- a/drivers/irqchip/irq-loongson-pch-pic.c
+++ b/drivers/irqchip/irq-loongson-pch-pic.c
@@ -404,6 +404,9 @@ int __init pch_pic_acpi_init(struct irq_domain *parent,
 	int ret, vec_base;
 	struct fwnode_handle *domain_handle;
 
+	if (find_pch_pic(acpi_pchpic->gsi_base) >= 0)
+		return 0;
+
 	vec_base = acpi_pchpic->gsi_base - GSI_MIN_PCH_IRQ;
 
 	domain_handle = irq_domain_alloc_fwnode(&acpi_pchpic->address);

  reply	other threads:[~2023-04-08 10:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  8:34 [PATCH V3 0/5] Fix some issues of irq controllers for dual-bridges scenario Jianmin Lv
2023-04-07  8:34 ` [PATCH V3 1/5] irqchip/loongson-eiointc: Fix returned value on parsing MADT Jianmin Lv
2023-04-08 10:45   ` [irqchip: irq/irqchip-next] " irqchip-bot for Jianmin Lv
2023-04-07  8:34 ` [PATCH V3 2/5] irqchip/loongson-eiointc: Fix incorrect use of acpi_get_vec_parent Jianmin Lv
2023-04-08 10:45   ` [irqchip: irq/irqchip-next] " irqchip-bot for Jianmin Lv
2023-04-07  8:34 ` [PATCH V3 3/5] irqchip/loongson-eiointc: Fix registration of syscore_ops Jianmin Lv
2023-04-08 10:45   ` [irqchip: irq/irqchip-next] " irqchip-bot for Jianmin Lv
2023-04-07  8:34 ` [PATCH V3 4/5] irqchip/loongson-pch-pic: " Jianmin Lv
2023-04-08 10:45   ` [irqchip: irq/irqchip-next] " irqchip-bot for Jianmin Lv
2023-04-07  8:34 ` [PATCH V3 5/5] irqchip/loongson-pch-pic: Fix pch_pic_acpi_init calling Jianmin Lv
2023-04-08 10:45   ` irqchip-bot for Jianmin Lv [this message]
2023-04-09  1:44 ` [PATCH V3 0/5] Fix some issues of irq controllers for dual-bridges scenario Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=168095071385.404.4377714261555782246.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvjianmin@loongson.cn \
    --cc=maz@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®