summaryrefslogtreecommitdiff
path: root/drivers/usb/typec
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2020-09-01 11:25:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-04 16:41:22 +0200
commitcfd54fa83a5068b61b7eb28d3c117d8354c74c7a (patch)
tree1247c3f4ba39ad8da031ed77d6378f720a2db2f8 /drivers/usb/typec
parent6b6c71e897e2bfa6acf8583daf80970cb0a9f87e (diff)
usb: Fix out of sync data toggle if a configured device is reconfigured
Userspace drivers that use a SetConfiguration() request to "lightweight" reset an already configured usb device might cause data toggles to get out of sync between the device and host, and the device becomes unusable. The xHCI host requires endpoints to be dropped and added back to reset the toggle. If USB core notices the new configuration is the same as the current active configuration it will avoid these extra steps by calling usb_reset_configuration() instead of usb_set_configuration(). A SetConfiguration() request will reset the device side data toggles. Make sure usb_reset_configuration() function also drops and adds back the endpoints to ensure data toggles are in sync. To avoid code duplication split the current usb_disable_device() function and reuse the endpoint specific part. Cc: stable <stable@vger.kernel.org> Tested-by: Martin Thierer <mthierer@gmail.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200901082528.12557-1-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec')
0 files changed, 0 insertions, 0 deletions