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] [day] [month] [year] [list]
Message-ID: <ZkzCCkOx8AtjPWSE@smile.fi.intel.com>
Date: Tue, 21 May 2024 18:47:22 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: Devyn Liu <liudingyuan@...wei.com>, linus.walleij@...aro.org,
	brgl@...ev.pl, f.fangjian@...wei.com, linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
	jonathan.cameron@...wei.com, yangyicong@...wei.com,
	yisen.zhuang@...wei.com, kong.kongxinwei@...ilicon.com
Subject: Re: [PATCH] gpiolib: acpi: Fix failed in acpi_gpiochip_find() by
 adding parent node match

On Mon, May 20, 2024 at 07:37:49AM +0300, Mika Westerberg wrote:
> On Mon, May 13, 2024 at 03:59:01PM +0800, Devyn Liu wrote:
> > Previous patch modified the standard used by acpi_gpiochip_find()
> > to match device nodes. Using the device node set in gc->gpiodev->d-
> > ev instead of gc->parent.
> > 
> > However, there is a situation in gpio-dwapb where the GPIO device
> > driver will set gc->fwnode for each port corresponding to a child
> > node under a GPIO device, so gc->gpiodev->dev will be assigned the
> > value of each child node in gpiochip_add_data().
> > 
> > gpio-dwapb.c:
> > 128,31 static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
> > 			       struct dwapb_port_property *pp,
> > 			       unsigned int offs);
> > port->gc.fwnode = pp->fwnode;
> > 
> > 693,39 static int dwapb_gpio_probe;
> > err = dwapb_gpio_add_port(gpio, &pdata->properties[i], i);
> > 
> > When other drivers request GPIO pin resources through the GPIO device
> > node provided by ACPI (corresponding to the parent node), the change
> > of the matching object to gc->gpiodev->dev in acpi_gpiochip_find()
> > only allows finding the value of each port (child node), resulting
> > in a failed request.
> > 
> > Reapply the condition of using gc->parent for match in acpi_gpio-
> > chip_find() in the code can compatible with the problem of gpio-dwapb,
> > and will not affect the two cases mentioned in the patch:
> > 1. There is no setting for gc->fwnode.
> > 2. The case that depends on using gc->fwnode for match.
> > 
> > Fixes: 5062e4c14b75 ("gpiolib: acpi: use the fwnode in acpi_gpiochip_find()")
> > Fixes: 067dbc1ea5ce ("gpiolib: acpi: Don't use GPIO chip fwnode in acpi_gpiochip_find()")
> > Signed-off-by: Devyn Liu <liudingyuan@...wei.com>
> 
> Reviewed-by: Mika Westerberg <mika.westerberg@...ux.intel.com>

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ