FAILED: patch "[PATCH] usb: typec: ucsi: Check if power role change actually" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x b80e7d34c7ea6a564525119d6138fbb577a23dba
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026060417-headless-faceless-e4a9@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b80e7d34c7ea6a564525119d6138fbb577a23dba Mon Sep 17 00:00:00 2001
From: Myrrh Periwinkle <[email protected]>
Date: Tue, 19 May 2026 18:41:39 +0700
Subject: [PATCH] usb: typec: ucsi: Check if power role change actually
happened before handling
The CrOS EC may send a connector status change event with the power direction changed flag set even if the power direction hasn't actually changed after initiating a SET_PDR command internally [1]. In practice this happens on every system suspend due to other changes performed by the EC [2][3][4], causing suspend to fail.
Fix this by checking if the power role change actually happened before handling it.
[1]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=1689;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
[2]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=3923;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
[3]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=5094;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
[4]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=2229;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
drivers/usb/typec/ucsi/ucsi.c +4 -2
@@ -1277,7 +1277,7 @@ static void ucsi_handle_connector_change(struct work_struct *work) work);struct ucsi *ucsi = con->ucsi;u8 curr_scale, volt_scale; -enum typec_role role; +enum typec_role role, prev_role;u16 change;int ret;u32 val;
@@ -1288,6 +1288,8 @@ static void ucsi_handle_connector_change(struct work_struct *work)dev_err_once (ucsi->dev,"%s entered without EVENT_PENDING\n" , __func__); + prev_role =UCSI_CONSTAT (con,PWR_DIR ); + ret =ucsi_get_connector_status (con, true);if (ret) { dev_err(ucsi->dev, "%s: GET_CONNECTOR_STATUS failed (%d)\n",
@@ -1304,7 +1306,7 @@ static void ucsi_handle_connector_change(struct work_struct *work) change =UCSI_CONSTAT (con,CHANGE ); role =UCSI_CONSTAT (con,PWR_DIR ); -if (change &UCSI_CONSTAT_POWER_DIR_CHANGE ) { +if ((change &UCSI_CONSTAT_POWER_DIR_CHANGE ) && role != prev_role) {typec_set_pwr_role (con->port, role);ucsi_port_psy_changed (con);
Sasha Levin
maintainerPATCH 1/1 usb: typec: ucsi: Check if power role change actually happened before handling
From: Myrrh Periwinkle <[email protected]>
[ Upstream commit b80e7d34c7ea6a564525119d6138fbb577a23dba ]
The CrOS EC may send a connector status change event with the power direction changed flag set even if the power direction hasn't actually changed after initiating a SET_PDR command internally [1]. In practice this happens on every system suspend due to other changes performed by the EC [2][3][4], causing suspend to fail.
Fix this by checking if the power role change actually happened before handling it.
[1]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=1689;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
[2]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=3923;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
[3]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=5094;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
[4]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=2229;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
--- drivers/usb/typec/ucsi/ucsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/typec/ucsi/ucsi.c +4 -2
@@ -884,7 +884,7 @@ static void ucsi_handle_connector_change(struct work_struct *work) struct ucsi_connector *con = container_of(work, struct ucsi_connector, work);struct ucsi *ucsi = con->ucsi; -enum typec_role role; +enum typec_role role, prev_role;u64 command;int ret;
@@ -892,6 +892,8 @@ static void ucsi_handle_connector_change(struct work_struct *work) command =UCSI_GET_CONNECTOR_STATUS |UCSI_CONNECTOR_NUMBER (con->num); + prev_role = !!(con->status.flags &UCSI_CONSTAT_PWR_DIR ); + ret =ucsi_send_command_common (ucsi, command, &con->status,sizeof (con->status), true);if (ret <0 ) {
@@ -908,7 +910,7 @@ static void ucsi_handle_connector_change(struct work_struct *work) role = !!(con->status.flags &UCSI_CONSTAT_PWR_DIR ); -if (con->status.change &UCSI_CONSTAT_POWER_DIR_CHANGE ) { +if ((con->status.change &UCSI_CONSTAT_POWER_DIR_CHANGE ) && role != prev_role) {typec_set_pwr_role (con->port, role);ucsi_port_psy_changed (con);
Signature · 1 line
2.53.0