usb: typec: ucsi: Skip CAM query when partner has no alt modes
Subsystems (3)
PATCH v2 1/1 usb: typec: ucsi: Skip CAM query when partner has no alt modes
Since Thunderbolt alternate mode support was added, ucsi_altmode_update_active() is called on every Connector Partner Changed event. This made the driver send UCSI_GET_CURRENT_CAM to PPMs even when the partner had no alternate modes registered. Firmware that does not support the optional alternate mode details answered Not Supported, which produced a spurious error on every partner change:
``` ucsi_acpi USBC000:00: GET_CURRENT_CAM command failed ```
Fixed by skipping the command when there is nothing to update.
---
v2:
- skip the invoke of ucsi_altmode_update_active() in ucsi_handle_connector_change()
v1: https://lore.kernel.org/linux-usb/[email protected]/
drivers/usb/typec/ucsi/ucsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/typec/ucsi/ucsi.c +2 -1
@@ -1519,7 +1519,8 @@ static void ucsi_handle_connector_change(struct work_struct *work)if (con->partner && (change &UCSI_CONSTAT_PARTNER_CHANGE )) {ucsi_partner_change (con); -ucsi_altmode_update_active (con); +if (con->partner_altmode[0 ]) +ucsi_altmode_update_active (con);/* Complete pending data role swap */ if (!completion_done (&con->complete))
--
2.55.0
Quoted 12 lines · Gris Ge
Since Thunderbolt alternate mode support was added,
ucsi_altmode_update_active()is called on every Connector Partner Changed event. This made the driver sendUCSI_GET_CURRENT_CAMto PPMs even when the partner had no alternate modes registered. Firmware that does not support the optional alternate mode details answered Not Supported, which produced a spurious error on every partner change:``` ucsi_acpi USBC000:00: GET_CURRENT_CAM command failed ```
Quoted 6 lines
Fixed by skipping the command when there is nothing to update.
Fixes da87d45b1951 ("usb: typec: ucsi: Add Thunderbolt alternate mode support")Cc [email protected] # v7.0+Assisted-by Codex:deepseek-v4.1-flashSigned-off-by Gris Ge <[email protected]>
Quoted 26 lines
---
v2:
- skip the invoke ofucsi_altmode_update_active()inucsi_handle_connector_change()
v1: https://lore.kernel.org/linux-usb/[email protected]/drivers/usb/typec/ucsi/ucsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/usb/typec/ucsi/ucsi.c +2
-2@@ -1519,7 +1519,8 @@ static void ucsi_handle_connector_change(struct work_struct *work)if (con->partner && (change &UCSI_CONSTAT_PARTNER_CHANGE )) {ucsi_partner_change (con); -ucsi_altmode_update_active (con); +if (con->partner_altmode[0 ]) +ucsi_altmode_update_active (con);/* Complete pending data role swap */ if (!completion_done (&con->complete)) --2.55.0
Quoted 11 lines · Gris Ge
Since Thunderbolt alternate mode support was added,
ucsi_altmode_update_active()is called on every Connector Partner Changed event. This made the driver sendUCSI_GET_CURRENT_CAMto PPMs even when the partner had no alternate modes registered. Firmware that does not support the optional alternate mode details answered Not Supported, which produced a spurious error on every partner change:``` ucsi_acpi USBC000:00: GET_CURRENT_CAM command failed ```
Quoted 6 lines
Fixed by skipping the command when there is nothing to update.
Fixes da87d45b1951 ("usb: typec: ucsi: Add Thunderbolt alternate mode support")Cc [email protected] # v7.0+Assisted-by Codex:deepseek-v4.1-flashSigned-off-by Gris Ge <[email protected]>
Quoted 25 lines
---
v2:
- skip the invoke ofucsi_altmode_update_active()inucsi_handle_connector_change()
v1: https://lore.kernel.org/linux-usb/[email protected]/drivers/usb/typec/ucsi/ucsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/usb/typec/ucsi/ucsi.c +2
-2@@ -1519,7 +1519,8 @@ static void ucsi_handle_connector_change(struct work_struct *work)if (con->partner && (change &UCSI_CONSTAT_PARTNER_CHANGE )) {ucsi_partner_change (con); -ucsi_altmode_update_active (con); +if (con->partner_altmode[0 ]) +ucsi_altmode_update_active (con);/* Complete pending data role swap */ if (!completion_done (&con->complete)) --2.55.0
Signature · 1 line
heikki