diff options
author | Xu Yang <xu.yang_2@nxp.com> | 2023-02-15 08:49:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-30 13:51:36 +0300 |
commit | 13648f9d017e5c89a40b7cf82931b2f565fca1b6 (patch) | |
tree | 2be1685e50adb8a2215da29f63c4c47b125bb632 /lib/timerqueue.c | |
parent | 6f66201e2aca1beea8cde4a0138639f0a4261108 (diff) | |
download | linux-13648f9d017e5c89a40b7cf82931b2f565fca1b6.tar.xz |
usb: typec: tcpm: fix create duplicate source-capabilities file
commit a826492fc9dfe32afd70fff93955ae8174bbf14b upstream.
The kernel will dump in the below cases:
sysfs: cannot create duplicate filename
'/devices/virtual/usb_power_delivery/pd1/source-capabilities'
1. After soft reset has completed, an Explicit Contract negotiation occurs.
The sink device will receive source capabilitys again. This will cause
a duplicate source-capabilities file be created.
2. Power swap twice on a device that is initailly sink role.
This will unregister existing capabilities when above cases occurs.
Fixes: 8203d26905ee ("usb: typec: tcpm: Register USB Power Delivery Capabilities")
cc: <stable@vger.kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230215054951.238394-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/timerqueue.c')
0 files changed, 0 insertions, 0 deletions