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: <20230528180913.21493d80@jic23-huawei>
Date: Sun, 28 May 2023 18:09:13 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Matti Vaittinen <mazziesaccount@...il.com>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>, Andy Shevchenko
 <andriy.shevchenko@...ux.intel.com>, Daniel Scally <djrscally@...il.com>,
 Heikki Krogerus <heikki.krogerus@...ux.intel.com>, Sakari Ailus
 <sakari.ailus@...ux.intel.com>, Greg Kroah-Hartman
 <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
 Wolfram Sang <wsa@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
 Michael Hennerich <Michael.Hennerich@...log.com>, Andreas Klinger
 <ak@...klinger.de>, Marcin Wojtas <mw@...ihalf.com>, Russell King
 <linux@...linux.org.uk>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
 Abeni <pabeni@...hat.com>, Jonathan Neuschäfer
 <j.neuschaefer@....net>, Linus Walleij <linus.walleij@...aro.org>, Paul
 Cercueil <paul@...pouillou.net>, Akhil R <akhilrajeev@...dia.com>,
 linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-i2c@...r.kernel.org, linux-iio@...r.kernel.org,
 netdev@...r.kernel.org, openbmc@...ts.ozlabs.org,
 linux-gpio@...r.kernel.org, linux-mips@...r.kernel.org
Subject: Re: [PATCH v6 8/8] i2c: i2c-smbus: fwnode_irq_get_byname() return
 value fix

On Fri, 26 May 2023 09:39:37 +0300
Matti Vaittinen <mazziesaccount@...il.com> wrote:

> The fwnode_irq_get_byname() was changed to not return 0 upon failure so
> return value check can be adjusted to reflect the change.
> 
> Reviewed-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Matti Vaittinen <mazziesaccount@...il.com>
> 

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

Comments follow though...
> ---
> Revision history:
> v5 =>:
>  - No changes
> v4 => v5:
>  - Added back after this was accidentally dropped at v4.
> 
> Depends on the mentioned return value change which is in patch 1/2. The

1/8?  Or just use 1/N and you never have to update it.

> return value change does also cause a functional change here. Eg. when
> IRQ mapping fails, the fwnode_irq_get_byname() no longer returns zero.
> This will cause also the probe here to return nonzero failure. I guess
> this is desired behaviour - but I would appreciate any confirmation.
> 
> Please, see also previous discussion here:
> https://lore.kernel.org/all/fbd52f5f5253b382b8d7b3e8046134de29f965b8.1666710197.git.mazziesaccount@gmail.com/
> 
> Another suggestion has been to drop the check altogether. I am slightly
> reluctant on doing that unless it gets confirmed that is the "right
> thing to do".

I'd be more inclined to also fail in the setup->irq < 0 path and drop the later check
on basis I can't see the driver doing anything useful wtihout an interrupt.

> ---
>  drivers/i2c/i2c-smbus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
> index 138c3f5e0093..893fe7cd3e41 100644
> --- a/drivers/i2c/i2c-smbus.c
> +++ b/drivers/i2c/i2c-smbus.c
> @@ -129,7 +129,7 @@ static int smbalert_probe(struct i2c_client *ara)
>  	} else {
>  		irq = fwnode_irq_get_byname(dev_fwnode(adapter->dev.parent),
>  					    "smbus_alert");
> -		if (irq <= 0)
> +		if (irq < 0)
>  			return irq;
>  	}
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ