* [PATCH] pwm: tegra: fail probe on reset deassert errors
@ 2026-08-30 12:58 Pengpeng Hou
2026-09-10 14:34 ` Uwe Kleine-König
2026-09-11 10:43 ` Thierry Reding
0 siblings, 2 replies; 3+ messages in thread
From: Pengpeng Hou @ 2026-08-30 12:58 UTC (permalink / raw)
To: Thierry Reding
Cc: Pengpeng Hou, Uwe Kleine-König, Jonathan Hunter,
Philipp Zabel, linux-pwm, linux-tegra, linux-kernel
tegra_pwm_probe() registers the PWM provider after deasserting the reset
control without checking whether the reset controller accepted the request.
Propagate the failure through the existing runtime-PM cleanup path instead
of publishing a PWM controller whose hardware may still be reset.
Fixes: 5dfbd2bd5439 ("pwm: tegra: Add support for reset control")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/pwm/pwm-tegra.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 5cdbe120ba2d8..d9fa16a7b31f4 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -379,7 +379,9 @@ static int tegra_pwm_probe(struct platform_device *pdev)
goto put_pm;
}
- reset_control_deassert(pc->rst);
+ ret = reset_control_deassert(pc->rst);
+ if (ret)
+ goto put_pm;
chip->ops = &tegra_pwm_ops;
base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
--
2.50.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] pwm: tegra: fail probe on reset deassert errors
2026-08-30 12:58 [PATCH] pwm: tegra: fail probe on reset deassert errors Pengpeng Hou
@ 2026-09-10 14:34 ` Uwe Kleine-König
2026-09-11 10:43 ` Thierry Reding
1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2026-09-10 14:34 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Thierry Reding, Jonathan Hunter, Philipp Zabel, linux-pwm,
linux-tegra, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 612 bytes --]
Hello,
On Sun, Aug 30, 2026 at 08:58:43PM +0800, Pengpeng Hou wrote:
> diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
> index 5cdbe120ba2d8..d9fa16a7b31f4 100644
> --- a/drivers/pwm/pwm-tegra.c
> +++ b/drivers/pwm/pwm-tegra.c
> @@ -379,7 +379,9 @@ static int tegra_pwm_probe(struct platform_device *pdev)
> goto put_pm;
> }
>
> - reset_control_deassert(pc->rst);
> + ret = reset_control_deassert(pc->rst);
> + if (ret)
> + goto put_pm;
Alternatively use devm_reset_control_get_exclusive_deasserted() instead
of devm_reset_control_get_exclusive().
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pwm: tegra: fail probe on reset deassert errors
2026-08-30 12:58 [PATCH] pwm: tegra: fail probe on reset deassert errors Pengpeng Hou
2026-09-10 14:34 ` Uwe Kleine-König
@ 2026-09-11 10:43 ` Thierry Reding
1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2026-09-11 10:43 UTC (permalink / raw)
To: Pengpeng Hou
Cc: Uwe Kleine-König, Jonathan Hunter, Philipp Zabel, linux-pwm,
linux-tegra, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]
On Sun, Aug 30, 2026 at 08:58:43PM +0800, Pengpeng Hou wrote:
> tegra_pwm_probe() registers the PWM provider after deasserting the reset
> control without checking whether the reset controller accepted the request.
>
> Propagate the failure through the existing runtime-PM cleanup path instead
> of publishing a PWM controller whose hardware may still be reset.
>
> Fixes: 5dfbd2bd5439 ("pwm: tegra: Add support for reset control")
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
> drivers/pwm/pwm-tegra.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
This is probably purely cosmetic since I've never seen a reset fail to
assert or deassert on Tegra (old generations can only fail if the reset
ID is invalid, meaning it's a bug in the framework, and new generations
may fail if for some reason the BPMP is not operational, in which case
the boot will fail much earlier).
Anyway, not saying NAK because from an API point of view it's correct to
check this. However, the Fixes: tag is a bit overkill. This does not
need to be backported to 10 years' worth of stable kernels.
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-11 10:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-30 12:58 [PATCH] pwm: tegra: fail probe on reset deassert errors Pengpeng Hou
2026-09-10 14:34 ` Uwe Kleine-König
2026-09-11 10:43 ` Thierry Reding
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®