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

Commit 77636c86 authored by Boris Todorov's avatar Boris Todorov Committed by Greg Kroah-Hartman
Browse files

USB: EHCI: Fix test mode sequence



The sequence to put port in test mode is not complete.
According EHCI specification all enabled ports must be
put in suspend.

Signed-off-by: default avatarBoris Todorov <boris.st.todorov@gmail.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1862cdd5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1046,7 +1046,19 @@ static int ehci_hub_control (
			if (!selector || selector > 5)
				goto error;
			ehci_quiesce(ehci);

			/* Put all enabled ports into suspend */
			while (ports--) {
				u32 __iomem *sreg =
						&ehci->regs->port_status[ports];

				temp = ehci_readl(ehci, sreg) & ~PORT_RWC_BITS;
				if (temp & PORT_PE)
					ehci_writel(ehci, temp | PORT_SUSPEND,
							sreg);
			}
			ehci_halt(ehci);
			temp = ehci_readl(ehci, status_reg);
			temp |= selector << 16;
			ehci_writel(ehci, temp, status_reg);
			break;