linux/drivers/usb/typec
RD Babiera c97cd0b4b5 usb: typec: tcpm: set initial svdm version based on pd revision
When sending Discover Identity messages to a Port Partner that uses Power
Delivery v2 and SVDM v1, we currently send PD v2 messages with SVDM v2.0,
expecting the port partner to respond with its highest supported SVDM
version as stated in Section 6.4.4.2.3 in the Power Delivery v3
specification. However, sending SVDM v2 to some Power Delivery v2 port
partners results in a NAK whereas sending SVDM v1 does not.

NAK messages can be handled by the initiator (PD v3 section 6.4.4.2.5.1),
and one solution could be to resend Discover Identity on a lower SVDM
version if possible. But, Section 6.4.4.3 of PD v2 states that "A NAK
response Should be taken as an indication not to retry that particular
Command."

Instead, we can set the SVDM version to the maximum one supported by the
negotiated PD revision. When operating in PD v2, this obeys Section
6.4.4.2.3, which states the SVDM field "Shall be set to zero to indicate
Version 1.0." In PD v3, the SVDM field "Shall be set to 01b to indicate
Version 2.0."

Fixes: c34e85fa69 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work")
Cc: stable@vger.kernel.org
Signed-off-by: RD Babiera <rdbabiera@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230731165926.1815338-1-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-23 11:10:53 +02:00
..
altmodes usb: typec: altmodes/displayport: add support for embedded DP cases 2023-08-22 14:45:53 +02:00
mux Merge 6.5-rc6 into usb-next 2023-08-14 22:22:31 +02:00
tcpm usb: typec: tcpm: set initial svdm version based on pd revision 2023-08-23 11:10:53 +02:00
tipd Merge 6.4-rc5 into usb-next 2023-06-05 07:39:02 +02:00
ucsi usb: typec: ucsi: Add debugfs for ucsi commands 2023-08-08 10:36:18 +02:00
anx7411.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
bus.c usb: typec: bus: verify partner exists in typec_altmode_attention 2023-08-22 14:44:28 +02:00
bus.h USB: mark all struct bus_type as const 2023-03-23 13:22:00 +01:00
class.c usb: typec: Use sysfs_emit_at when concatenating the string 2023-07-25 17:45:29 +02:00
class.h usb: typec: Add retimer handle to port 2022-07-14 16:24:05 +02:00
hd3ss3220.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
Kconfig usb: typec: qcom: Add Qualcomm PMIC Type-C driver 2023-05-13 19:03:46 +09:00
Makefile usb: typec: qcom: Add Qualcomm PMIC Type-C driver 2023-05-13 19:03:46 +09:00
mux.c usb: typec: mux: Remove alt mode parameters from the API 2023-05-29 15:17:52 +01:00
mux.h usb: typec: mux: Introduce indirection 2022-04-26 13:47:13 +02:00
pd.c usb: typec: Fix fast_role_swap_current show function 2023-06-13 12:16:07 +02:00
pd.h usb: typec: Separate USB Power Delivery from USB Type-C 2022-06-12 06:49:47 +02:00
port-mapper.c ACPI: bus: Introduce acpi_bus_for_each_dev() 2022-03-02 20:55:47 +01:00
retimer.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
retimer.h usb: typec: Make bus switch code retimer-aware 2023-01-17 17:29:00 +01:00
rt1719.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
stusb160x.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
wusb3801.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00