linux-mainline/drivers/usb/typec
Mario Limonciello c9ca8de2eb usb: typec: ucsi: Use GET_CAPABILITY attributes data to set power supply scope
On some OEM systems, adding a W7900 dGPU triggers RAS errors and hangs
at a black screen on startup.  This issue occurs only if `ucsi_acpi` has
loaded before `amdgpu` has loaded.  The reason for this failure is that
`amdgpu` uses power_supply_is_system_supplied() to determine if running
on AC or DC power at startup. If this value is reported incorrectly the
dGPU will also be programmed incorrectly and trigger errors.

power_supply_is_system_supplied() reports the wrong value because UCSI
power supplies provided as part of the system don't properly report the
scope as "DEVICE" scope (not powering the system).

In order to fix this issue check the capabilities reported from the UCSI
power supply to ensure that it supports charging a battery and that it can
be powered by AC.  Mark the scope accordingly.

Cc: stable@vger.kernel.org
Fixes: a7fbfd44c0 ("usb: typec: ucsi: Mark dGPUs as DEVICE scope")
Link: https://www.intel.com/content/www/us/en/products/docs/io/universal-serial-bus/usb-type-c-ucsi-spec.html p28
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231009184643.129986-1-mario.limonciello@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-11 11:39:25 +02:00
..
altmodes usb: typec: altmodes/displayport: Signal hpd low when exiting mode 2023-10-11 11:38:06 +02:00
mux Merge 6.5-rc6 into usb-next 2023-08-14 22:22:31 +02:00
tcpm usb: typec: qcom: Update the logic of regulator enable and disable 2023-10-02 13:39:01 +02:00
tipd Merge 6.4-rc5 into usb-next 2023-06-05 07:39:02 +02:00
ucsi usb: typec: ucsi: Use GET_CAPABILITY attributes data to set power supply scope 2023-10-11 11:39:25 +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
class.c usb: typec: Use sysfs_emit_at when concatenating the string 2023-07-25 17:45:29 +02:00
class.h
hd3ss3220.c usb: Switch i2c drivers back to use .probe() 2023-05-29 15:53:11 +01:00
Kconfig
Makefile
mux.c usb: typec: mux: Remove alt mode parameters from the API 2023-05-29 15:17:52 +01:00
mux.h
pd.c usb: typec: Fix fast_role_swap_current show function 2023-06-13 12:16:07 +02:00
pd.h
port-mapper.c
retimer.c
retimer.h
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