All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huacai Chen <chenhc@lemote.com>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Marc Zyngier <maz@kernel.org>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	Fuxin Zhang <zhangfx@lemote.com>, stable <stable@vger.kernel.org>
Subject: Re: [PATCH 3/3] irqchip/loongson-pch-pic: Reserve legacy LPC irqs
Date: Thu, 10 Sep 2020 09:40:58 +0800	[thread overview]
Message-ID: <CAAhV-H5vigV8jfrOK3uciRjkwE_c1Or+YpmzDb0CSfraNLtc3g@mail.gmail.com> (raw)
In-Reply-To: <be0840ac-ecb4-1c93-828f-0773f348f4b0@flygoat.com>

Hi, Jiaxun,

On Thu, Sep 10, 2020 at 8:52 AM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
>
>
>
> 在 2020/9/9 12:09, Huacai Chen 写道:
> > Reserve legacy LPC irqs (0~15) to avoid spurious interrupts.
>
> It doesn't make sense at all.
>
> How can you allocate IRQ without irqchip backing it?
>
> - Jiaxun
As you know, this patch resolves the kdump problem, and 0~15 is really
needed to reserve for LPC, right?

Huacai
>
> >
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Huacai Chen <chenhc@lemote.com>
> > ---
> >   drivers/irqchip/irq-loongson-pch-pic.c | 19 ++++++++++++++++++-
> >   1 file changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c
> > index 9bf6b9a..9f6719c 100644
> > --- a/drivers/irqchip/irq-loongson-pch-pic.c
> > +++ b/drivers/irqchip/irq-loongson-pch-pic.c
> > @@ -35,6 +35,7 @@
> >
> >   struct pch_pic {
> >       void __iomem            *base;
> > +     struct irq_domain       *lpc_domain;
> >       struct irq_domain       *pic_domain;
> >       u32                     ht_vec_base;
> >       raw_spinlock_t          pic_lock;
> > @@ -184,9 +185,9 @@ static void pch_pic_reset(struct pch_pic *priv)
> >   static int pch_pic_of_init(struct device_node *node,
> >                               struct device_node *parent)
> >   {
> > +     int i, base, err;
> >       struct pch_pic *priv;
> >       struct irq_domain *parent_domain;
> > -     int err;
> >
> >       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> >       if (!priv)
> > @@ -213,6 +214,22 @@ static int pch_pic_of_init(struct device_node *node,
> >               goto iounmap_base;
> >       }
> >
> > +     base = irq_alloc_descs(-1, 0, NR_IRQS_LEGACY, 0);
> > +     if (base < 0) {
> > +             pr_err("Failed to allocate LPC IRQ numbers\n");
> > +             goto iounmap_base;
> > +     }
> > +
> > +     priv->lpc_domain = irq_domain_add_legacy(node, NR_IRQS_LEGACY, 0, 0,
> > +                                              &irq_domain_simple_ops, NULL);
> > +     if (!priv->lpc_domain) {
> > +             pr_err("Failed to add irqdomain for LPC controller");
> > +             goto iounmap_base;
> > +     }
> > +
> > +     for (i = 0; i < NR_IRQS_LEGACY; i++)
> > +             irq_set_chip_and_handler(i, &dummy_irq_chip, handle_simple_irq);
> > +
> >       priv->pic_domain = irq_domain_create_hierarchy(parent_domain, 0,
> >                                                      PIC_COUNT,
> >                                                      of_node_to_fwnode(node),

  reply	other threads:[~2020-09-10  2:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09  4:09 [PATCH 1/3] MIPS: Loongson64: Increase NR_IRQS to 320 Huacai Chen
2020-09-09  4:09 ` [PATCH 2/3] irqchip/loongson-htvec: Fix initial interrupts clearing Huacai Chen
2020-09-09  4:09 ` [PATCH 3/3] irqchip/loongson-pch-pic: Reserve legacy LPC irqs Huacai Chen
2020-09-10  0:51   ` Jiaxun Yang
2020-09-10  1:40     ` Huacai Chen [this message]
2020-09-10 10:08   ` Marc Zyngier
2020-09-11  4:13     ` Huacai Chen
2020-09-11  7:50       ` Marc Zyngier
2020-09-11 10:12         ` Huacai Chen
2020-09-10 16:34   ` Sasha Levin
2020-09-11  0:12     ` Huacai Chen
2020-09-10 10:10 ` [PATCH 1/3] MIPS: Loongson64: Increase NR_IRQS to 320 Marc Zyngier
2020-09-11  3:24   ` Huacai Chen
2020-09-11  7:44     ` Marc Zyngier
2020-09-11  8:43       ` Huacai Chen
2020-09-11  9:03         ` Marc Zyngier
2020-09-11  9:14           ` Huacai Chen
2020-09-11  9:23             ` Marc Zyngier
2020-09-11  9:40               ` Huacai Chen
2020-09-10 16:34 ` Sasha Levin
2020-09-11  0:11   ` 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=CAAhV-H5vigV8jfrOK3uciRjkwE_c1Or+YpmzDb0CSfraNLtc3g@mail.gmail.com \
    --to=chenhc@lemote.com \
    --cc=jason@lakedaemon.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    --cc=zhangfx@lemote.com \
    /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.