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: <CACRpkdbAq1Cqr4X8fjEjOTxw7ky9b6V0ye1NYKfDy5E1BmAX6g@mail.gmail.com>
Date: Tue, 28 May 2024 13:54:29 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org, 
	linux-gpio@...r.kernel.org, linux-pwm@...r.kernel.org, 
	Alexandru Ardelean <alexandru.ardelean@...log.com>, Bartosz Golaszewski <brgl@...ev.pl>, 
	Conor Dooley <conor+dt@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Lee Jones <lee@...nel.org>, 
	Rob Herring <robh@...nel.org>, Uwe Kleine-König <ukleinek@...nel.org>, 
	Haibo Chen <haibo.chen@....com>
Subject: Re: [PATCH 4/5] gpio: adp5585: Add Analog Devices ADP5585 support

Hi Laurent/Haibo,

thanks for your patch!

On Mon, May 20, 2024 at 9:59 PM Laurent Pinchart
<laurent.pinchart@...asonboard.com> wrote:

> From: Haibo Chen <haibo.chen@....com>
>
> The ADP5585 is a 10/11 input/output port expander with a built in keypad
> matrix decoder, programmable logic, reset generator, and PWM generator.
> This driver supports the GPIO function using the platform device
> registered by the core MFD driver.
>
> The driver is derived from an initial implementation from NXP, available
> in commit 451f61b46b76 ("MLK-25917-2 gpio: adp5585-gpio: add
> adp5585-gpio support") in their BSP kernel tree. It has been extensively
> rewritten.
>
> Signed-off-by: Haibo Chen <haibo.chen@....com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

(...)

> +static int adp5585_gpio_direction_input(struct gpio_chip *chip, unsigned int off)
> +{
> +       struct adp5585_gpio_dev *adp5585_gpio = gpiochip_get_data(chip);
> +       unsigned int bank = ADP5585_BANK(off);
> +       unsigned int bit = ADP5585_BIT(off);
> +
> +       guard(mutex)(&adp5585_gpio->lock);
> +
> +       return regmap_update_bits(adp5585_gpio->regmap,
> +                                 ADP5585_GPIO_DIRECTION_A + bank,
> +                                 bit, 0);

First, I love the guarded mutex!

But doesn't regmap already contain a mutex? Or is this one of those
cases where regmap has been instantiated without a lock?

> +       gc = &adp5585_gpio->gpio_chip;
> +       gc->parent = dev;
> +       gc->direction_input  = adp5585_gpio_direction_input;
> +       gc->direction_output = adp5585_gpio_direction_output;

And chance to implemen ->get_direction()?

Other than this I think the driver is ready for merge, so with the
comments fixed or addressed:
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ