mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH v2 3/4] pinctrl: renesas: rzt2h: fix reading pin value in IRQ function
Date: Sun, 13 Sep 2026 09:51:38 +0200	[thread overview]
Message-ID: <aqZWCqBi71yjl_xg@black.igk.intel.com> (raw)
In-Reply-To: <20260910160226.489183-4-cosmin-gabriel.tanislav.xa@renesas.com>

On Thu, Sep 10, 2026 at 07:02:25PM +0300, Cosmin Tanislav wrote:
> rzt2h_gpio_get() only reports a level for pins in input or output mode
> and returns -EINVAL otherwise. When a pin is requested as an interrupt
> it is switched to IRQ function and its I/O mode is set to Hi-Z, so its
> value can no longer be read.
> 
> gpiolib calls gpiod_get_value_cansleep() to determine the edge's
> direction when a line is watched with GPIO_V2_LINE_FLAG_EDGE_BOTH.
> Non-zero values are translated to a rising edge, zero to a falling edge.
> 
> Since gpiod_get_value_cansleep() ends up calling rzt2h_gpio_get() which
> returns -EINVAL when the pin is in IRQ function, every edge is reported
> as rising.
> 
> When using the IRQ function, the input buffers are enabled and the PINm
> registers reflect the live state of the input.
> 
> Report the input level even when the pin is used as an IRQ.

...

> +static u8 rzt2h_pin_read_pfc(struct rzt2h_pinctrl *pctrl, u8 port, u8 pin)
> +{
> +	u64 reg64 = rzt2h_pinctrl_readq(pctrl, port, PFC(port));
> +
> +	return field_get(PFC_PIN_MASK(pin), reg64);
> +}

This is a dead code. Add it when it has users.
Especially this is weird to have in the patch with Fixes tag and Cc to stable@.
Bad rebase?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-09-13  7:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 16:02 [PATCH v2 0/4] Renesas RZ/T2H pinctrl fixes and cleanups Cosmin Tanislav
2026-09-10 16:02 ` [PATCH v2 1/4] pinctrl: renesas: rzt2h: restore correct pin mode on IRQ free Cosmin Tanislav
2026-09-10 16:02 ` [PATCH v2 2/4] pinctrl: renesas: rzt2h: setup IRQ in .irq_{request,release}_resources() Cosmin Tanislav
2026-09-10 16:02 ` [PATCH v2 3/4] pinctrl: renesas: rzt2h: fix reading pin value in IRQ function Cosmin Tanislav
2026-09-13  7:51   ` Andy Shevchenko [this message]
2026-09-13  7:55     ` Cosmin-Gabriel Tanislav
2026-09-10 16:02 ` [PATCH v2 4/4] pinctrl: renesas: rzt2h: reuse helpers Cosmin Tanislav
2026-09-13  8:07   ` Andy Shevchenko

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=aqZWCqBi71yjl_xg@black.igk.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=brgl@kernel.org \
    --cc=cosmin-gabriel.tanislav.xa@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=stable@kernel.org \
    /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®