[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251125092039.524-1-vulab@iscas.ac.cn>
Date: Tue, 25 Nov 2025 17:20:39 +0800
From: Haotian Zhang <vulab@...as.ac.cn>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org,
Haotian Zhang <vulab@...as.ac.cn>
Subject: [PATCH v2] usb: typec: ucsi: Treat alt mode and status failures as non-fatal
The ucsi_register_altmodes() and ucsi_get_connector_status() can fail
for reasons that should not prevent the port from being registered.
These failures should be logged but should not cause the entire port
registration to fail.
Set ret to 0 in these error paths to allow registration to continue.
Fixes: b9aa02ca39a4 ("usb: typec: ucsi: Add polling mechanism for partner tasks like alt mode checking")
Suggested-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
---
Changes in v2:
- Instead of unregistering the port on alt mode/status failures,
treat these errors as non-fatal by setting ret = 0
- Changed Fixes tag to b9aa02ca39a4.
---
drivers/usb/typec/ucsi/ucsi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 3f568f790f39..77b05cd3917e 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1656,6 +1656,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
if (ret) {
dev_err(ucsi->dev, "con%d: failed to register alt modes\n",
con->num);
+ ret = 0;
goto out;
}
@@ -1663,6 +1664,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
ret = ucsi_get_connector_status(con, false);
if (ret) {
dev_err(ucsi->dev, "con%d: failed to get status\n", con->num);
+ ret = 0;
goto out;
}
--
2.25.1
Powered by blists - more mailing lists