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: <20240418044907.GO112498@black.fi.intel.com>
Date: Thu, 18 Apr 2024 07:49:07 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-gpio@...r.kernel.org, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Linus Walleij <linus.walleij@...aro.org>,
	Bartosz Golaszewski <brgl@...ev.pl>
Subject: Re: [PATCH v1 1/2] gpiolib: acpi: Add fwnode name to the GPIO
 interrupt label

On Wed, Apr 17, 2024 at 01:37:27PM +0300, Andy Shevchenko wrote:
> It's ambiguous to have a device-related index in the GPIO interrupt
> label as most of the devices will have it the same or very similar.
> Extend label with fwnode name for better granularity. It significantly
> reduces the scope of searching among devices.

Can you add an example here how it looks like before and after the
patch?

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/gpio/gpiolib-acpi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index 909113312a1b..0b0c8729fc6e 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -1035,6 +1035,7 @@ struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,
>  int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id, int index,
>  				  bool *wake_capable)
>  {
> +	struct fwnode_handle *fwnode = acpi_fwnode_handle(adev);
>  	int idx, i;
>  	unsigned int irq_flags;
>  	int ret;
> @@ -1044,7 +1045,7 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id,
>  		struct gpio_desc *desc;
>  
>  		/* Ignore -EPROBE_DEFER, it only matters if idx matches */
> -		desc = __acpi_find_gpio(acpi_fwnode_handle(adev), con_id, i, true, &info);
> +		desc = __acpi_find_gpio(fwnode, con_id, i, true, &info);
>  		if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER)
>  			return PTR_ERR(desc);
>  
> @@ -1064,7 +1065,7 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id,
>  			acpi_gpio_update_gpiod_flags(&dflags, &info);
>  			acpi_gpio_update_gpiod_lookup_flags(&lflags, &info);
>  
> -			snprintf(label, sizeof(label), "GpioInt() %d", index);
> +			snprintf(label, sizeof(label), "%pfwP GpioInt(%d)", fwnode, index);
>  			ret = gpiod_configure_flags(desc, label, lflags, dflags);
>  			if (ret < 0)
>  				return ret;
> -- 
> 2.43.0.rc1.1336.g36b5255a03ac

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ