All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Anup Patel <apatel@ventanamicro.com>
Cc: Dmitry Dunaev <dunaev@tecon.ru>,
	dunaich@mail.ru, Thomas Gleixner <tglx@linutronix.de>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] irqchip/riscv-intc: Mark INTC nodes for secondary CPUs as initialized.
Date: Wed, 04 Oct 2023 11:18:09 +0100	[thread overview]
Message-ID: <86il7mofmm.wl-maz@kernel.org> (raw)
In-Reply-To: <CAK9=C2UiBNQtv0Q2yJMKqc5pMX_jam+ZmfRz3Rme0ZYuqN68HA@mail.gmail.com>

On Tue, 26 Sep 2023 11:36:31 +0100,
Anup Patel <apatel@ventanamicro.com> wrote:
> 
> On Tue, Sep 26, 2023 at 3:59 PM Dmitry Dunaev <dunaev@tecon.ru> wrote:
> >
> > The current Linux driver irq-riscv-intc initialize IRQ domain only once,
> > when init function called on primary hart. In other cases no IRQ domain is
> > created and no operation on interrupt-controller node is performed.
> > This is cause of that no common Linux driver can use per-cpu interrupts
> > mapped to several CPUs because fwnode of secondary cores INTC is not
> > marked as initialized. This device is always will be marked as deferred.
> > For example the system with devicetree
> >
> >     cpu0: cpu@0 {
> >         cpu0_intc: interrupt-controller {
> >             interrupt-controller;
> >             compatible = riscv,cpu-intc;
> >         };
> >     };
> >
> >     cpu1: cpu@1 {
> >         cpu1_intc: interrupt-controller {
> >             interrupt-controller;
> >             compatible = riscv,cpu-intc;
> >         };
> >     };
> >
> >     buserr {
> >         compatible = riscv,buserr;
> >         interrupts-extended = <&cpu0_intc 16 &cpu1_intc 16>;
> >     };
> >
> > will always report 'buserr' node as deferred without calling any
> > bus probe function.
> >
> > This patch will mark all secondary nodes passed to irq-riscv-intc
> > driver init function as initialized to be able to act as correct
> > IRQ phandle node.
> >
> > Signed-off-by: Dmitry Dunaev <dunaev@tecon.ru>
> > ---
> >  drivers/irqchip/irq-riscv-intc.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c
> > index 4adeee1bc391..c01a4e8d4983 100644
> > --- a/drivers/irqchip/irq-riscv-intc.c
> > +++ b/drivers/irqchip/irq-riscv-intc.c
> > @@ -155,8 +155,10 @@ static int __init riscv_intc_init(struct device_node *node,
> >          * for each INTC DT node. We only need to do INTC initialization
> >          * for the INTC DT node belonging to boot CPU (or boot HART).
> >          */
> > -       if (riscv_hartid_to_cpuid(hartid) != smp_processor_id())
> > +       if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) {
> > +               fwnode_dev_initialized(of_node_to_fwnode(node), true);
> 
> There is already a patch on LKML to address this.
> https://www.spinics.net/lists/kernel/msg4929886.html

If this is a fix, why is it buried in a huge series and not brought
forward as an independent fix that needs to be picked early?

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Anup Patel <apatel@ventanamicro.com>
Cc: Dmitry Dunaev <dunaev@tecon.ru>,
	dunaich@mail.ru, Thomas Gleixner <tglx@linutronix.de>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] irqchip/riscv-intc: Mark INTC nodes for secondary CPUs as initialized.
Date: Wed, 04 Oct 2023 11:18:09 +0100	[thread overview]
Message-ID: <86il7mofmm.wl-maz@kernel.org> (raw)
In-Reply-To: <CAK9=C2UiBNQtv0Q2yJMKqc5pMX_jam+ZmfRz3Rme0ZYuqN68HA@mail.gmail.com>

On Tue, 26 Sep 2023 11:36:31 +0100,
Anup Patel <apatel@ventanamicro.com> wrote:
> 
> On Tue, Sep 26, 2023 at 3:59 PM Dmitry Dunaev <dunaev@tecon.ru> wrote:
> >
> > The current Linux driver irq-riscv-intc initialize IRQ domain only once,
> > when init function called on primary hart. In other cases no IRQ domain is
> > created and no operation on interrupt-controller node is performed.
> > This is cause of that no common Linux driver can use per-cpu interrupts
> > mapped to several CPUs because fwnode of secondary cores INTC is not
> > marked as initialized. This device is always will be marked as deferred.
> > For example the system with devicetree
> >
> >     cpu0: cpu@0 {
> >         cpu0_intc: interrupt-controller {
> >             interrupt-controller;
> >             compatible = riscv,cpu-intc;
> >         };
> >     };
> >
> >     cpu1: cpu@1 {
> >         cpu1_intc: interrupt-controller {
> >             interrupt-controller;
> >             compatible = riscv,cpu-intc;
> >         };
> >     };
> >
> >     buserr {
> >         compatible = riscv,buserr;
> >         interrupts-extended = <&cpu0_intc 16 &cpu1_intc 16>;
> >     };
> >
> > will always report 'buserr' node as deferred without calling any
> > bus probe function.
> >
> > This patch will mark all secondary nodes passed to irq-riscv-intc
> > driver init function as initialized to be able to act as correct
> > IRQ phandle node.
> >
> > Signed-off-by: Dmitry Dunaev <dunaev@tecon.ru>
> > ---
> >  drivers/irqchip/irq-riscv-intc.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c
> > index 4adeee1bc391..c01a4e8d4983 100644
> > --- a/drivers/irqchip/irq-riscv-intc.c
> > +++ b/drivers/irqchip/irq-riscv-intc.c
> > @@ -155,8 +155,10 @@ static int __init riscv_intc_init(struct device_node *node,
> >          * for each INTC DT node. We only need to do INTC initialization
> >          * for the INTC DT node belonging to boot CPU (or boot HART).
> >          */
> > -       if (riscv_hartid_to_cpuid(hartid) != smp_processor_id())
> > +       if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) {
> > +               fwnode_dev_initialized(of_node_to_fwnode(node), true);
> 
> There is already a patch on LKML to address this.
> https://www.spinics.net/lists/kernel/msg4929886.html

If this is a fix, why is it buried in a huge series and not brought
forward as an independent fix that needs to be picked early?

	M.

-- 
Without deviation from the norm, progress is not possible.

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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 10:28 [PATCH] irqchip/riscv-intc: Mark INTC nodes for secondary CPUs as initialized Dmitry Dunaev
2023-09-26 10:28 ` Dmitry Dunaev
2023-09-26 10:36 ` Anup Patel
2023-09-26 10:36   ` Anup Patel
2023-10-04 10:18   ` Marc Zyngier [this message]
2023-10-04 10:18     ` Marc Zyngier
2023-10-04 14:59     ` Anup Patel
2023-10-04 14:59       ` Anup Patel
2023-10-04 15:32       ` Marc Zyngier
2023-10-04 15:32         ` Marc Zyngier
2023-10-04 16:08         ` Anup Patel
2023-10-04 16:08           ` Anup Patel
2023-09-26 20:44 ` kernel test robot
2023-09-26 20:44   ` kernel test robot
2023-10-07 12:00 ` [irqchip: irq/irqchip-fixes] irqchip/riscv-intc: Mark all INTC nodes " irqchip-bot for Anup Patel

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=86il7mofmm.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=apatel@ventanamicro.com \
    --cc=dunaev@tecon.ru \
    --cc=dunaich@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.