mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX
@ 2026-08-25 11:41 Abel Vesa
  2026-08-26  9:23 ` Bartosz Golaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Abel Vesa @ 2026-08-25 11:41 UTC (permalink / raw)
  To: Bartosz Golaszewski, Manivannan Sadhasivam, Bjorn Helgaas,
	Krishna Chaitanya Chundru, Bjorn Andersson
  Cc: linux-pci, linux-kernel, Abel Vesa

The RESX GPIO may be provided by a sleeping GPIO controller, such as an
I2C or SPI I/O expander. Calling gpiod_set_value() for such a GPIO
triggers the following warning:

  WARNING: ... drivers/gpio/gpiolib.c:4030 at gpiod_set_value()

The TC9563 power-on and power-off callbacks already sleep while enabling
or disabling regulators and while waiting for oscillator stabilization.
Use gpiod_set_value_cansleep() for RESX so it can be driven without
triggering the warning.

Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563")
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
---
 drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
index fd53a7db9875..1b7718d07d15 100644
--- a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
+++ b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
@@ -481,7 +481,7 @@ static int tc9563_pwrctrl_power_off(struct pci_pwrctrl *pwrctrl)
 	struct tc9563_pwrctrl *tc9563 = container_of(pwrctrl,
 					    struct tc9563_pwrctrl, pwrctrl);
 
-	gpiod_set_value(tc9563->reset_gpio, 1);
+	gpiod_set_value_cansleep(tc9563->reset_gpio, 1);
 
 	regulator_bulk_disable(ARRAY_SIZE(tc9563->supplies), tc9563->supplies);
 
@@ -501,7 +501,7 @@ static int tc9563_pwrctrl_power_on(struct pci_pwrctrl *pwrctrl)
 	if (ret < 0)
 		return dev_err_probe(dev, ret, "cannot enable regulators\n");
 
-	gpiod_set_value(tc9563->reset_gpio, 0);
+	gpiod_set_value_cansleep(tc9563->reset_gpio, 0);
 
 	fsleep(TC9563_OSC_STAB_DELAY_US);
 

---
base-commit: 4b18edbd8e70f7e6860d56370f13244896d0f95c
change-id: 20260825-pci-pwrctl-tc9563-use-cansleep-for-resx-f6e1f65547fc

Best regards,
--  
Abel Vesa <abel.vesa@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX
  2026-08-25 11:41 [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX Abel Vesa
@ 2026-08-26  9:23 ` Bartosz Golaszewski
  2026-09-02 14:08 ` Manivannan Sadhasivam
  2026-09-03 20:48 ` Bjorn Helgaas
  2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2026-08-26  9:23 UTC (permalink / raw)
  To: Abel Vesa
  Cc: linux-pci, linux-kernel, Bartosz Golaszewski,
	Manivannan Sadhasivam, Bjorn Helgaas, Krishna Chaitanya Chundru,
	Bjorn Andersson

On Tue, 25 Aug 2026 13:41:31 +0200, Abel Vesa <abel.vesa@oss.qualcomm.com> said:
> The RESX GPIO may be provided by a sleeping GPIO controller, such as an
> I2C or SPI I/O expander. Calling gpiod_set_value() for such a GPIO
> triggers the following warning:
>
>   WARNING: ... drivers/gpio/gpiolib.c:4030 at gpiod_set_value()
>
> The TC9563 power-on and power-off callbacks already sleep while enabling
> or disabling regulators and while waiting for oscillator stabilization.
> Use gpiod_set_value_cansleep() for RESX so it can be driven without
> triggering the warning.
>
> Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563")
> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
> ---

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX
  2026-08-25 11:41 [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX Abel Vesa
  2026-08-26  9:23 ` Bartosz Golaszewski
@ 2026-09-02 14:08 ` Manivannan Sadhasivam
  2026-09-03 20:48 ` Bjorn Helgaas
  2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2026-09-02 14:08 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Bartosz Golaszewski, Bjorn Helgaas, Krishna Chaitanya Chundru,
	Bjorn Andersson, linux-pci, linux-kernel

On Tue, Aug 25, 2026 at 02:41:31PM +0300, Abel Vesa wrote:
> The RESX GPIO may be provided by a sleeping GPIO controller, such as an
> I2C or SPI I/O expander. Calling gpiod_set_value() for such a GPIO
> triggers the following warning:
> 
>   WARNING: ... drivers/gpio/gpiolib.c:4030 at gpiod_set_value()
> 
> The TC9563 power-on and power-off callbacks already sleep while enabling
> or disabling regulators and while waiting for oscillator stabilization.
> Use gpiod_set_value_cansleep() for RESX so it can be driven without
> triggering the warning.
> 
> Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563")
> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

- Mani

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX
  2026-08-25 11:41 [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX Abel Vesa
  2026-08-26  9:23 ` Bartosz Golaszewski
  2026-09-02 14:08 ` Manivannan Sadhasivam
@ 2026-09-03 20:48 ` Bjorn Helgaas
  2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2026-09-03 20:48 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Bartosz Golaszewski, Manivannan Sadhasivam, Bjorn Helgaas,
	Krishna Chaitanya Chundru, Bjorn Andersson, linux-pci,
	linux-kernel

On Tue, Aug 25, 2026 at 02:41:31PM +0300, Abel Vesa wrote:
> The RESX GPIO may be provided by a sleeping GPIO controller, such as an
> I2C or SPI I/O expander. Calling gpiod_set_value() for such a GPIO
> triggers the following warning:
> 
>   WARNING: ... drivers/gpio/gpiolib.c:4030 at gpiod_set_value()
> 
> The TC9563 power-on and power-off callbacks already sleep while enabling
> or disabling regulators and while waiting for oscillator stabilization.
> Use gpiod_set_value_cansleep() for RESX so it can be driven without
> triggering the warning.
> 
> Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563")
> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>

Applied to pci/pwrctrl for v7.4 with subject line:

  PCI/pwrctrl: tc9563: Allow RESX reset assertion to sleep

to focus on the behavioral change.  Let me know if this doesn't
capture it correctly.

> ---
>  drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
> index fd53a7db9875..1b7718d07d15 100644
> --- a/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
> +++ b/drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
> @@ -481,7 +481,7 @@ static int tc9563_pwrctrl_power_off(struct pci_pwrctrl *pwrctrl)
>  	struct tc9563_pwrctrl *tc9563 = container_of(pwrctrl,
>  					    struct tc9563_pwrctrl, pwrctrl);
>  
> -	gpiod_set_value(tc9563->reset_gpio, 1);
> +	gpiod_set_value_cansleep(tc9563->reset_gpio, 1);
>  
>  	regulator_bulk_disable(ARRAY_SIZE(tc9563->supplies), tc9563->supplies);
>  
> @@ -501,7 +501,7 @@ static int tc9563_pwrctrl_power_on(struct pci_pwrctrl *pwrctrl)
>  	if (ret < 0)
>  		return dev_err_probe(dev, ret, "cannot enable regulators\n");
>  
> -	gpiod_set_value(tc9563->reset_gpio, 0);
> +	gpiod_set_value_cansleep(tc9563->reset_gpio, 0);
>  
>  	fsleep(TC9563_OSC_STAB_DELAY_US);
>  
> 
> ---
> base-commit: 4b18edbd8e70f7e6860d56370f13244896d0f95c
> change-id: 20260825-pci-pwrctl-tc9563-use-cansleep-for-resx-f6e1f65547fc
> 
> Best regards,
> --  
> Abel Vesa <abel.vesa@oss.qualcomm.com>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-03 20:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-25 11:41 [PATCH] PCI/pwrctrl: tc9563: Use gpiod_set_value_cansleep() for RESX Abel Vesa
2026-08-26  9:23 ` Bartosz Golaszewski
2026-09-02 14:08 ` Manivannan Sadhasivam
2026-09-03 20:48 ` Bjorn Helgaas

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®