From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
David Heidelberg <david@ixit.cz>
Cc: <oe-linux-nfc@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
"Krzysztof Kozlowski" <krzk@kernel.org>
Subject: Re: [PATCH v2] nfc: st95hf: switch to using sleeping variants of gpiod API
Date: Mon, 3 Aug 2026 14:08:55 +0200 [thread overview]
Message-ID: <34ceb4bb-f076-4f32-812b-917fc3dbd0b5@intel.com> (raw)
In-Reply-To: <amPsnh9wDIG2CeSi@google.com>
On 7/25/26 01:00, Dmitry Torokhov wrote:
> The driver does not use gpiod API calls in an atomic context. Switch
> 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@gmail.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
>
> v2: - dropped extra "not" from commit description (Przemek Kitszel)
> - link to v1: https://lore.kernel.org/r/9b77e25c-8942-42f7-b82e-42b492b437d8@intel.com
>
> FTR I am not using this driver but I'm helping clean up legacy gpio APIs
> and stumbled on this. Using "cansleep" where we can is simply a good
> practice.
>
> 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 321fbe8aeca8..4d772a308bff 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);
> }
>
> /*
prev parent reply other threads:[~2026-08-03 12:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 23:00 Dmitry Torokhov
2026-08-03 12:08 ` Przemek Kitszel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34ceb4bb-f076-4f32-812b-917fc3dbd0b5@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=david@ixit.cz \
--cc=dmitry.torokhov@gmail.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®