mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 17:46:23 +07:00
USB: fix up EHCI startup synchronization
A recent patch added software synchronization during EHCI startup, so ports aren't switched away from the companion controllers after resets have started. This patch adds a short delay letting hardware finish that port switching before any new resets begin ... so both ends of that hardware race window are closed. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Dave Miller <davem@davemloft.net> Cc: Dely Sy <dely.l.sy@intel.com> Cc: stable <stable@kernel.org> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
5cf1973a44
commit
1cb52658b4
@ -575,12 +575,15 @@ static int ehci_run (struct usb_hcd *hcd)
|
|||||||
* from the companions to the EHCI controller. If any of the
|
* from the companions to the EHCI controller. If any of the
|
||||||
* companions are in the middle of a port reset at the time, it
|
* companions are in the middle of a port reset at the time, it
|
||||||
* could cause trouble. Write-locking ehci_cf_port_reset_rwsem
|
* could cause trouble. Write-locking ehci_cf_port_reset_rwsem
|
||||||
* guarantees that no resets are in progress.
|
* guarantees that no resets are in progress. After we set CF,
|
||||||
|
* a short delay lets the hardware catch up; new resets shouldn't
|
||||||
|
* be started before the port switching actions could complete.
|
||||||
*/
|
*/
|
||||||
down_write(&ehci_cf_port_reset_rwsem);
|
down_write(&ehci_cf_port_reset_rwsem);
|
||||||
hcd->state = HC_STATE_RUNNING;
|
hcd->state = HC_STATE_RUNNING;
|
||||||
ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
|
ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
|
||||||
ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
|
ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
|
||||||
|
msleep(5);
|
||||||
up_write(&ehci_cf_port_reset_rwsem);
|
up_write(&ehci_cf_port_reset_rwsem);
|
||||||
|
|
||||||
temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
|
temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
|
||||||
|
Loading…
Reference in New Issue
Block a user