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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZICY4dTgZZGpiDPY@surfacebook>
Date:   Wed, 7 Jun 2023 17:49:05 +0300
From:   andy.shevchenko@...il.com
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc:     andy.shevchenko@...il.com, oe-kbuild-all@...ts.linux.dev,
        linus.walleij@...aro.org, brgl@...ev.pl, palmer@...belt.com,
        paul.walmsley@...ive.com, linux-gpio@...r.kernel.org,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] gpio: ath79: Add missing check for platform_get_irq

Wed, Jun 07, 2023 at 03:08:19PM +0800, Jiasheng Jiang kirjoitti:
> On Tue, 6 Jun 2023 17:46:36 +0800 Andy Shevchenko wrote:
> > Tue, Jun 06, 2023 at 12:28:17PM +0300, andy.shevchenko@...il.com kirjoitti:
> >> Tue, Jun 06, 2023 at 11:18:41AM +0800, Jiasheng Jiang kirjoitti:

...

> >> > Add the missing check for platform_get_irq() and return error
> >> > if it fails.
> >> > The returned error code will be dealed with in
> >> > module_platform_driver(ath79_gpio_driver) and the driver will not
> >> > be registered.
> >> 
> >> No, this functional change and has not to be for the fixes unless _this_ is the
> >> regression you are fixing. Did the driver work before at some point as after
> >> this change?
> 
> I will remove the fixes tag in v4.
> 
> > To be more clear, answer to the following questions:
> > 1) does driver work with wrong DT configuration?
> > 2a) if yes, does it make sense, i.e. the hardware functioning usefully?
> > 2b) if yes, can we guarantee there are no broken configurations in the wild?
> > 
> > Depending on the answers correct your code and/or commit message.

The above is a list of the questions you need to investigate.
(Note, it takes several minutes on elixir.bootlin.com to check
 some of this, but I'm not the author of the code)

> >> Otherwise you have to _justify_ that this functional change won't break
> >> existing setups (with broked IRQ in Device Tree, for example).
> 
> Sorry, I do not quite understand what you mean.
> I have no idea how these questions are related to my patch.

The IRQ is usually provided by Device Tree or ACPI (here is DT only case).
Then the platform code converts that to resource which this driver consumes.
That resource is used when instantiating GPIO (IRQ) chip.

> Do you mean I should not fail the ->probe() if there is wrong IRQ numbering in the DT?

I don't know. The commit message of your change should elaborate this.

> Please tell me the relationship between these questions and my patch.

The tight relationship. The patch changes the flow. Either
you shouldn't do that, or be aware and explain why it's not
a problem. Or get it done differently.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ