All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: firas ashkar <firas.ashkar@savoirfairelinux.com>
Cc: alex@digriz.org.uk, tglx@linutronix.de,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] irqchip: add TS7800v1 fpga based controller driver
Date: Sat, 22 Oct 2022 11:04:37 +0100	[thread overview]
Message-ID: <87fsfggone.wl-maz@kernel.org> (raw)
In-Reply-To: <118f1bcc4583612423aa0dca0421c4eea3cd648d.camel@savoirfairelinux.com>

On Fri, 21 Oct 2022 19:14:48 +0100,
firas ashkar <firas.ashkar@savoirfairelinux.com> wrote:
> > > > > +static void ts7800_ic_chained_handle_irq(struct irq_desc
> > > > > *desc)
> > > > > +{
> > > > > +       struct ts7800_irq_data *data =
> > > > > irq_desc_get_handler_data(desc);
> > > > > +       struct irq_chip *chip = irq_desc_get_chip(desc);
> > > > > +       u32 mask_bits = readl(data->base + IRQ_MASK_REG);
> > > > > +       u32 status = readl(data->bridge);
> > > > > +
> > > > > +       chained_irq_enter(chip, desc);
> > > > > +
> > > > > +       if (unlikely(status == 0)) {
> > > > > +               handle_bad_irq(desc);
> > > > > +               goto out;
> > > > > +       }
> > > > > +
> > > > > +       do {
> > > > > +               unsigned int bit = __ffs(status);
> > > > > +               int irq = irq_find_mapping(data->domain, bit);
> > > > > +
> > > > > +               if (irq && (mask_bits & BIT(bit)))
> > > > > +                       generic_handle_irq(irq);
> > > > 
> > > > Again, this is not appropriate. I've pointed you to the right API
> > > > in
> > > > my previous review of this patch.
> > > 'generic_handle_domain_irq' causing some issues
> > 
> > Which issue?
> # insmod /tmp/virt-dma.ko 
> # insmod /tmp/ts-dmac.ko 
> generic_handle_domain_irq failed, error -22
> irq 2, desc: a285c39f, depth: 0, count: 0, unhandled: 0
> ->handle_irq():  e7046ee9, ts7800_ic_chained_handle_irq+0x0/0x1ec
> [irq_ts7800]
> ->irq_data.chip(): 70d81143, 0xc14db44c
> ->action(): f799c8dd
> ->action->handler(): dcf07981, bad_chained_irq+0x0/0x64
>      IRQ_LEVEL set
>    IRQ_NOPROBE set
>  IRQ_NOREQUEST set
>   IRQ_NOTHREAD set
> unexpected IRQ trap at vector 02
> generic_handle_domain_irq failed, error -22

[...]

News flash, your code is buggy. How about you debug it? The domain
name you use definitely indicates that you "know how" to do it...

	M.

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

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

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: firas ashkar <firas.ashkar@savoirfairelinux.com>
Cc: alex@digriz.org.uk, tglx@linutronix.de,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] irqchip: add TS7800v1 fpga based controller driver
Date: Sat, 22 Oct 2022 11:04:37 +0100	[thread overview]
Message-ID: <87fsfggone.wl-maz@kernel.org> (raw)
In-Reply-To: <118f1bcc4583612423aa0dca0421c4eea3cd648d.camel@savoirfairelinux.com>

On Fri, 21 Oct 2022 19:14:48 +0100,
firas ashkar <firas.ashkar@savoirfairelinux.com> wrote:
> > > > > +static void ts7800_ic_chained_handle_irq(struct irq_desc
> > > > > *desc)
> > > > > +{
> > > > > +       struct ts7800_irq_data *data =
> > > > > irq_desc_get_handler_data(desc);
> > > > > +       struct irq_chip *chip = irq_desc_get_chip(desc);
> > > > > +       u32 mask_bits = readl(data->base + IRQ_MASK_REG);
> > > > > +       u32 status = readl(data->bridge);
> > > > > +
> > > > > +       chained_irq_enter(chip, desc);
> > > > > +
> > > > > +       if (unlikely(status == 0)) {
> > > > > +               handle_bad_irq(desc);
> > > > > +               goto out;
> > > > > +       }
> > > > > +
> > > > > +       do {
> > > > > +               unsigned int bit = __ffs(status);
> > > > > +               int irq = irq_find_mapping(data->domain, bit);
> > > > > +
> > > > > +               if (irq && (mask_bits & BIT(bit)))
> > > > > +                       generic_handle_irq(irq);
> > > > 
> > > > Again, this is not appropriate. I've pointed you to the right API
> > > > in
> > > > my previous review of this patch.
> > > 'generic_handle_domain_irq' causing some issues
> > 
> > Which issue?
> # insmod /tmp/virt-dma.ko 
> # insmod /tmp/ts-dmac.ko 
> generic_handle_domain_irq failed, error -22
> irq 2, desc: a285c39f, depth: 0, count: 0, unhandled: 0
> ->handle_irq():  e7046ee9, ts7800_ic_chained_handle_irq+0x0/0x1ec
> [irq_ts7800]
> ->irq_data.chip(): 70d81143, 0xc14db44c
> ->action(): f799c8dd
> ->action->handler(): dcf07981, bad_chained_irq+0x0/0x64
>      IRQ_LEVEL set
>    IRQ_NOPROBE set
>  IRQ_NOREQUEST set
>   IRQ_NOTHREAD set
> unexpected IRQ trap at vector 02
> generic_handle_domain_irq failed, error -22

[...]

News flash, your code is buggy. How about you debug it? The domain
name you use definitely indicates that you "know how" to do it...

	M.

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

  reply	other threads:[~2022-10-22 10:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 14:13 [PATCH v2] irqchip: add TS7800v1 fpga based controller driver Firas Ashkar
2022-10-20 14:13 ` Firas Ashkar
2022-10-21  9:22 ` Marc Zyngier
2022-10-21  9:22   ` Marc Zyngier
2022-10-21 16:19   ` firas ashkar
2022-10-21 16:19     ` firas ashkar
2022-10-21 17:18     ` Marc Zyngier
2022-10-21 17:18       ` Marc Zyngier
2022-10-21 18:14       ` firas ashkar
2022-10-21 18:14         ` firas ashkar
2022-10-22 10:04         ` Marc Zyngier [this message]
2022-10-22 10:04           ` Marc Zyngier
2022-10-24 20:08           ` firas ashkar
2022-10-24 20:08             ` firas ashkar

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=87fsfggone.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alex@digriz.org.uk \
    --cc=firas.ashkar@savoirfairelinux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@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 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.