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: <9b77e25c-8942-42f7-b82e-42b492b437d8@intel.com>
Date: Tue, 20 Aug 2024 10:10:37 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Krzysztof
 Kozlowski" <krzk@...nel.org>
Subject: Re: [PATCH net-next] nfc: st95hf: switch to using sleeping variants
 of gpiod API

On 8/20/24 03:10, Dmitry Torokhov wrote:
> The driver does not not use gpiod API calls in an atomic context. Switch

please remove one "not"

> to gpiod_set_value_cansleep() calls to allow using the driver with GPIO
> controllers that might need process context to operate.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>

Code is fine, but why not as a fix?

> ---
>   drivers/nfc/st95hf/core.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
> index ffe5b4eab457..5b3451fc4491 100644
> --- a/drivers/nfc/st95hf/core.c
> +++ b/drivers/nfc/st95hf/core.c
> @@ -450,19 +450,19 @@ static int st95hf_select_protocol(struct st95hf_context *stcontext, int type)
>   static void st95hf_send_st95enable_negativepulse(struct st95hf_context *st95con)
>   {
>   	/* First make irq_in pin high */
> -	gpiod_set_value(st95con->enable_gpiod, HIGH);
> +	gpiod_set_value_cansleep(st95con->enable_gpiod, HIGH);
>   
>   	/* wait for 1 milisecond */
>   	usleep_range(1000, 2000);
>   
>   	/* Make irq_in pin low */
> -	gpiod_set_value(st95con->enable_gpiod, LOW);
> +	gpiod_set_value_cansleep(st95con->enable_gpiod, LOW);
>   
>   	/* wait for minimum interrupt pulse to make st95 active */
>   	usleep_range(1000, 2000);
>   
>   	/* At end make it high */
> -	gpiod_set_value(st95con->enable_gpiod, HIGH);
> +	gpiod_set_value_cansleep(st95con->enable_gpiod, HIGH);
>   }
>   
>   /*


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ