Re: [PATCH v3] ehci: fix EHCI host controller initialization sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 10, 2021 at 10:37:37AM +0300, Eugene Korenevsky wrote:
> > > -	ehci_readl(ehci, &ehci->regs->command);	/* unblock posted writes */
> 
> > You should not remove the ehci_readl call above.  With that line gone, 
> > the PCI bus might not send the new value of configured_flag to the 
> > controller until after the 5-ms sleep has ended, which makes the msleep 
> > useless.
> 
> Could not find reads from USBCMD in similar drivers (for
> example here: https://github.com/NetBSD/src/blob/trunk/sys/dev/usb/ehci.c#L625).

I don't know why NetBSD doesn't do this.  However, note that the 
following poll loop does a read every millisecond, so the first time 
through the loop, the earlier writes will be unblocked.

> Is this feature (reading from USBCMD for unblocking posted writes)
> documented anywhere or it is found empirically?

USBCMD is nothing special; it's just a convenient register to read.  Any 
other register in the controller would do just as well.

This is part of the PCI spec.  Writes are posted (meaning they aren't 
delivered to the device right away), but a read will cause all 
previously posted writes for any address on the same device to be 
delivered before the read finishes.

Alan Stern



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux