Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7671bd1e authored by Zhuang Jin Can's avatar Zhuang Jin Can Committed by Greg Kroah-Hartman
Browse files

Revert "usb: Reset USB-3 devices on USB-3 link bounce"

This revert a82b76f7.

The commit causes an extra reset in remote wakeup as described in:
http://www.spinics.net/lists/linux-usb/msg119080.html



Signed-off-by: default avatarZhuang Jin Can <jin.can.zhuang@intel.com>
Acked-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 673016d9
Loading
Loading
Loading
Loading
+9 −25
Original line number Diff line number Diff line
@@ -4886,7 +4886,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
static void port_event(struct usb_hub *hub, int port1)
		__must_hold(&port_dev->status_lock)
{
	int connect_change, reset_device = 0;
	int connect_change;
	struct usb_port *port_dev = hub->ports[port1 - 1];
	struct usb_device *udev = port_dev->child;
	struct usb_device *hdev = hub->hdev;
@@ -4974,24 +4974,7 @@ static void port_event(struct usb_hub *hub, int port1)
			if (hub_port_reset(hub, port1, NULL,
					HUB_BH_RESET_TIME, true) < 0)
				hub_port_disable(hub, port1, 1);
		} else
			reset_device = 1;
	}

	/*
	 * On disconnect USB3 protocol ports transit from U0 to
	 * SS.Inactive to Rx.Detect. If this happens a warm-
	 * reset is not needed, but a (re)connect may happen
	 * before hub_wq runs and sees the disconnect, and the
	 * device may be an unknown state.
	 *
	 * If the port went through SS.Inactive without hub_wq
	 * seeing it the C_LINK_STATE change flag will be set,
	 * and we reset the dev to put it in a known state.
	 */
	if (reset_device || (udev && hub_is_superspeed(hub->hdev)
				&& (portchange & USB_PORT_STAT_C_LINK_STATE)
				&& (portstatus & USB_PORT_STAT_CONNECTION))) {
		} else {
			usb_unlock_port(port_dev);
			usb_lock_device(udev);
			usb_reset_device(udev);
@@ -4999,6 +4982,7 @@ static void port_event(struct usb_hub *hub, int port1)
			usb_lock_port(port_dev);
			connect_change = 0;
		}
	}

	if (connect_change)
		hub_port_connect_change(hub, port1, portstatus, portchange);