All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pengpeng Hou <hppiscas@163.com>
To: b-liu@ti.com
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	s.nawrocki@samsung.com, kishon@kernel.org, balbi@ti.com,
	tony@atomide.com, hppiscas@163.com
Subject: [PATCH v2 3/3] usb: musb: omap2430: report system-resume PHY setup failures
Date: Tue, 22 Sep 2026 08:44:14 +0800	[thread overview]
Message-ID: <20260922004414.4192-4-hppiscas@163.com> (raw)
In-Reply-To: <20260922004414.4192-1-hppiscas@163.com>

omap2430_resume() ignores PHY setup failures and always reports success.

Return the result of the ownership-aware PHY setup helper. End the
system-sleep deferral even on failure: leaving phy_suspended set would
make later runtime resumes skip the PHY permanently. The independent
reference flags still record which resources need cleanup or retry.

A later suspend or platform exit therefore releases only references
actually held, while a runtime resume can retry setup without adding a
second initialization reference left over from a failed cleanup.

The issue was found by our static-analysis tool.

Fixes: 68d9f95d6fd5 ("usb: musb: Fix suspend and resume issues for PHYs on I2C and SPI")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
 drivers/usb/musb/omap2430.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 382d6cd4a9e6..951e60906f2c 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -657,14 +657,16 @@ static int omap2430_resume(struct device *dev)
 {
 	struct omap2430_glue *glue = dev_get_drvdata(dev);
 	struct musb *musb = glue_to_musb(glue);
+	int ret;
 
 	if (!musb)
 		return 0;
 
-	omap2430_phy_power_on(glue);
+	ret = omap2430_phy_power_on(glue);
+	/* End system-sleep deferral so a later runtime resume can retry. */
 	glue->phy_suspended = 0;
 
-	return 0;
+	return ret;
 }
 
 static const struct dev_pm_ops omap2430_pm_ops = {

base-commit: f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
-- 
2.50.1 (Apple Git-155)


  parent reply	other threads:[~2026-09-22  0:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  0:44 [PATCH v2 0/3] usb: musb: omap2430: handle PHY setup failures across PM Pengpeng Hou
2026-09-22  0:44 ` [PATCH v2 1/3] usb: musb: omap2430: track PHY references and check initial setup Pengpeng Hou
2026-09-22  0:44 ` [PATCH v2 2/3] usb: musb: omap2430: stop runtime resume after PHY setup failure Pengpeng Hou
2026-09-22  0:44 ` Pengpeng Hou [this message]
2026-11-20 14:08   ` [PATCH v2 3/3] usb: musb: omap2430: report system-resume PHY setup failures Greg KH

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=20260922004414.4192-4-hppiscas@163.com \
    --to=hppiscas@163.com \
    --cc=b-liu@ti.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.