Commit a8f08d86dbf1b7bb5869cf1807d2fd40ec9d6d0a
Committed by
Sarah Sharp
1 parent
b214f191d9
Exists in
master
and in
39 other branches
usbcore: Bug fix: system can't suspend with USB3.0 device connected to USB3.0 hub
This patch clear PORT_POWER when suspend a USB3.0 device behind a USB3.0 external hub, so the system can suspend and resume. Note USB3.0 device may not work after system resume and this is a temporary workaround. The correct fix will be in future patches. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Showing 1 changed file with 11 additions and 1 deletions Side-by-side Diff
drivers/usb/core/hub.c
... | ... | @@ -2285,7 +2285,17 @@ |
2285 | 2285 | } |
2286 | 2286 | |
2287 | 2287 | /* see 7.1.7.6 */ |
2288 | - status = set_port_feature(hub->hdev, port1, USB_PORT_FEAT_SUSPEND); | |
2288 | + /* Clear PORT_POWER if it's a USB3.0 device connected to USB 3.0 | |
2289 | + * external hub. | |
2290 | + * FIXME: this is a temporary workaround to make the system able | |
2291 | + * to suspend/resume. | |
2292 | + */ | |
2293 | + if ((hub->hdev->parent != NULL) && hub_is_superspeed(hub->hdev)) | |
2294 | + status = clear_port_feature(hub->hdev, port1, | |
2295 | + USB_PORT_FEAT_POWER); | |
2296 | + else | |
2297 | + status = set_port_feature(hub->hdev, port1, | |
2298 | + USB_PORT_FEAT_SUSPEND); | |
2289 | 2299 | if (status) { |
2290 | 2300 | dev_dbg(hub->intfdev, "can't suspend port %d, status %d\n", |
2291 | 2301 | port1, status); |