linux/drivers/usb/typec
Myrrh Periwinkle 3907130abb usb: typec: ucsi: Check if power role change actually happened before handling
[ Upstream commit b80e7d34c7 ]

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

Cc: stable <stable@kernel.org>
Fixes: 7616f006db ("usb: typec: ucsi: Update power_supply on power role change")
Signed-off-by: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
Reported-and-tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20260519-ucsi-fix-2-v1-1-6f1239535187@qtmlabs.xyz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-06-19 13:33:48 +02:00
..
altmodes usb: typec: altmodes/displayport: validate count before reading Status Update VDO 2026-06-19 13:33:26 +02:00
mux usb: typec: intel_pmc_mux: Defer probe if SCU IPC isn't present 2025-08-28 16:24:19 +02:00
tcpm usb: typec: tcpm: reset internal port states on soft reset AMS 2026-06-19 13:33:43 +02:00
tipd usb: typec: tipd: Fix spurious fwnode_handle_put in error path 2022-12-31 13:14:27 +01:00
ucsi usb: typec: ucsi: Check if power role change actually happened before handling 2026-06-19 13:33:48 +02:00
bus.c usb: typec: bus: verify partner exists in typec_altmode_attention 2023-09-19 12:22:53 +02:00
bus.h usb: typec: Organize the private headers properly 2021-04-05 09:07:41 +02:00
class.c usb: typec: fix unreleased fwnode_handle in typec_port_register_altmodes() 2024-11-08 16:25:54 +01:00
class.h usb: typec: Link all ports during connector registration 2021-04-09 16:00:00 +02:00
hd3ss3220.c usb: typec: hd3ss3220: Use OF graph API to get the connector fwnode 2020-10-02 15:28:18 +02:00
Kconfig usb: typec: STUSB160X should select REGMAP_I2C 2021-11-18 19:16:54 +01:00
Makefile usb: typec: Port mapping utility 2021-04-09 16:00:00 +02:00
mux.c usb: typec: mux: Check dev_set_name() return value 2022-06-14 18:36:05 +02:00
mux.h usb: typec: mux: Use device type instead of device name for matching 2021-05-27 09:23:57 +02:00
port-mapper.c usb: typec: silence a static checker warning 2021-04-14 15:15:40 +02:00
qcom-pmic-typec.c usb: typec: Add QCOM PMIC typec detection driver 2020-10-09 15:14:43 +02:00
stusb160x.c usb: typec: stusb160x: Don't block probing of consumer of "connector" nodes 2021-07-21 09:16:40 +02:00