* [PATCH v2] pwm: tegra: check reset deassertion status
@ 2026-10-14 3:20 Pengpeng Hou
2026-12-01 18:10 ` Uwe Kleine-König
0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-10-14 3:20 UTC (permalink / raw)
To: Thierry Reding
Cc: Pengpeng Hou, Uwe Kleine-König, Jonathan Hunter,
Philipp Zabel, linux-pwm, linux-tegra, linux-kernel
Check reset_control_deassert() before registering the PWM chip and
use the existing runtime-PM cleanup path if it reports an error.
This is an API-consistency change, not a claim of an observed failure on
supported Tegra systems. Keep the existing reset assertion before PM
teardown in remove and the pwmchip_add() failure path.
The issue was found by our static-analysis tool and manually reviewed.
Acked-by: Thierry Reding <treding@nvidia.com>
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
Changes since v1:
- drop Fixes and stable-backport implications, as Thierry requested
- retain the small status check and Thierry's Acked-by
- keep explicit reset ownership: moving assert to devres would put it
after the driver's PM teardown, rather than preserve the existing order
Previous version:
https://lore.kernel.org/all/20260830125843.99132-1-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 5cdbe120ba2d8dafd81ea5520f1a637827d8eecf..d9fa16a7b31f43bd9d75474f851899956159d836 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: 4056b3c9d3c92ea45955641dbafeb9b960e146ef
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] pwm: tegra: check reset deassertion status
2026-10-14 3:20 [PATCH v2] pwm: tegra: check reset deassertion status Pengpeng Hou
@ 2026-12-01 18:10 ` Uwe Kleine-König
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2026-12-01 18:10 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: 895 bytes --]
Hello,
On Wed, Oct 14, 2026 at 11:20:27AM +0800, Pengpeng Hou wrote:
> diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
> index 5cdbe120ba2d8dafd81ea5520f1a637827d8eecf..d9fa16a7b31f43bd9d75474f851899956159d836 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;
reset_control_deassert() doesn't emit an error message on failure, so a
dev_err_probe() is deserved here.
(The driver doesn't use dev_err_probe() yet, but this is addressed in
https://lore.kernel.org/linux-pwm/280e3b3af15fc6d5a9531639f9114ad79e2033c8.1796147495.git.u.kleine-koenig@baylibre.com/.)
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 18:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 3:20 [PATCH v2] pwm: tegra: check reset deassertion status Pengpeng Hou
2026-12-01 18:10 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox