lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o7xp3pz2.wl-maz@kernel.org>
Date:   Sat, 16 Jul 2022 18:52:01 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     <Lewis.Hanly@...rochip.com>
Cc:     <linux-riscv@...ts.infradead.org>, <Conor.Dooley@...rochip.com>,
        <brgl@...ev.pl>, <linux-gpio@...r.kernel.org>,
        <linus.walleij@...aro.org>, <palmer@...belt.com>,
        <linux-kernel@...r.kernel.org>, <Daire.McNamara@...rochip.com>
Subject: Re: [PATCH v3 1/1] gpio: mpfs: add polarfire soc gpio support

On Sat, 16 Jul 2022 16:21:48 +0100,
<Lewis.Hanly@...rochip.com> wrote:
> 
> Thanks Marc,
> 
> On Sat, 2022-07-16 at 11:33 +0100, Marc Zyngier wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > know the content is safe
> > 
> > On Sat, 16 Jul 2022 08:11:13 +0100,
> > <lewis.hanly@...rochip.com> wrote:
> > > From: Lewis Hanly <lewis.hanly@...rochip.com>
> > > 
> > > Add a driver to support the Polarfire SoC gpio controller.
> > > 
> > > Signed-off-by: Lewis Hanly <lewis.hanly@...rochip.com>
> > 
> > [...]
> > 
> > > +static int mpfs_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
> > > +                                        unsigned int child,
> > > +                                        unsigned int child_type,
> > > +                                        unsigned int *parent,
> > > +                                        unsigned int *parent_type)
> > > +{
> > > +     struct mpfs_gpio_chip *mpfs_gpio = gpiochip_get_data(gc);
> > > +     struct irq_data *d = irq_get_irq_data(mpfs_gpio-
> > > >irq_number[child]);
> > 
> > This looks totally wrong. It means that you have already instantiated
> > part of the hierarchy, and it is likely that you will get multiple
> > hierarchy sharing some levels, which isn't intended.
> 
> Some background why I use the above.
> We need to support both direct and non-direct IRQ connections to the
> PLIC. 
> In direct mode the GPIO IRQ's are connected directly to the PLIC and
> certainly no need for the above. GPIO's can also be configured in non-
> direct, which means they use a shared IRQ, hence the above.

That's unfortunately not acceptable. You need to distinguish which one
is which, and separate them. Your non-direct mode certainly requires
special handling, and is not fit for a hierarchical mode.

	M.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ