mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pengpeng Hou <hppiscas@163.com>
To: Thierry Reding <thierry.reding@kernel.org>
Cc: "Pengpeng Hou" <hppiscas@163.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Uwe Kleine-König" <ukleinek@kernel.org>
Subject: [PATCH v3] pwm: tegra: check reset deassertion status
Date: Thu,  3 Dec 2026 11:32:40 +0800	[thread overview]
Message-ID: <20261203033240.57399-1-hppiscas@163.com> (raw)

If reset_control_deassert() fails in tegra_pwm_probe(), the PWM chip is
still registered. Report the reset error and take the existing runtime
PM cleanup path before registration. Leave the reset assertion order on
removal unchanged.

The issue was found by our static-analysis tool and manually reviewed.

Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
Changes since v2:
Report the deassertion error with dev_err_probe() before unwinding PM.
Previous version: https://lore.kernel.org/r/20261014032027.9508-1-hppiscas@163.com

Codex assisted with patch preparation and the changelog.
Current review: Codex (Assisted-by: gpt 5).
Static review only; this revision was not built.

 drivers/pwm/pwm-tegra.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 6d468a673ded2d9109c6f46a43ffbf3ba5df09f6..17014be2c68124592cc57b1f5405d62ee9300205 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -393,7 +393,11 @@ 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) {
+		dev_err_probe(&pdev->dev, ret, "Failed to deassert reset\n");
+		goto put_pm;
+	}
 
 	chip->ops = &tegra_pwm_ops;
 

base-commit: d323c02b23e6fb5fa793da658ca11a50d9dfbee5


                 reply	other threads:[~2026-12-03  3:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261203033240.57399-1-hppiscas@163.com \
    --to=hppiscas@163.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=thierry.reding@kernel.org \
    --cc=ukleinek@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®