]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
USB: remove LPM management from usb_driver_claim_interface()
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 10 Sep 2018 17:58:51 +0000 (13:58 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:20 +0000 (19:51 -0600)
commitf253c51e9ad5f1373983ebf60063abc2597d33d2
tree43af0bf1e5d8556e412bcb45b28d3d7103b551a0
parent87391fdd4eb1c329d2b1eb8cf6d6c4b9a5ca041f
USB: remove LPM management from usb_driver_claim_interface()

BugLink: https://bugs.launchpad.net/bugs/1836287
commit c183813fcee44a249339b7c46e1ad271ca1870aa upstream.

usb_driver_claim_interface() disables and re-enables Link Power
Management, but it shouldn't do either one, for the reasons listed
below.  This patch removes the two LPM-related function calls from the
routine.

The reason for disabling LPM in the analogous function
usb_probe_interface() is so that drivers won't have to deal with
unwanted LPM transitions in their probe routine.  But
usb_driver_claim_interface() doesn't call the driver's probe routine
(or any other callbacks), so that reason doesn't apply here.

Furthermore, no driver other than usbfs will ever call
usb_driver_claim_interface() unless it is already bound to another
interface in the same device, which means disabling LPM here would be
redundant.  usbfs doesn't interact with LPM at all.

Lastly, the error return from usb_unlocked_disable_lpm() isn't handled
properly; the code doesn't clean up its earlier actions before
returning.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Fixes: 8306095fd2c1 ("USB: Disable USB 3.0 LPM in critical sections.")
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/core/driver.c