Re: [PATCH 2/3] xhci: Wait for host to start running.

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

 



On Mon, Jun 07, 2010 at 02:01:45PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> Sarah Sharp wrote:
> 
> >When the run bit is set in the xHCI command register, it may take a few
> >microseconds for the host to start running.  We cannot ring any doorbells
> >until the host is actually running, so wait until the status register says
> >the host is running.
> 
> >Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
> >Reported-by: Shinya Saito <shinya.saito.sx@xxxxxxxxxxx>
> 
> [...]
> 
> >diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> >index 79ccfe5..8a49c67 100644
> >--- a/drivers/usb/host/xhci.c
> >+++ b/drivers/usb/host/xhci.c
> [...]
> >@@ -460,13 +487,11 @@ int xhci_run(struct usb_hcd *hcd)
> > 	if (NUM_TEST_NOOPS > 0)
> > 		doorbell = xhci_setup_one_noop(xhci);
> >-	temp = xhci_readl(xhci, &xhci->op_regs->command);
> >-	temp |= (CMD_RUN);
> >-	xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
> >-			temp);
> >-	xhci_writel(xhci, temp, &xhci->op_regs->command);
> >-	/* Flush PCI posted writes */
> >-	temp = xhci_readl(xhci, &xhci->op_regs->command);
> >+	if (xhci_start(xhci)) {
> >+		xhci_halt(xhci);
> >+		return -ENODEV;
> >+	}
> >+
> > 	xhci_dbg(xhci, "// @%p = 0x%x\n", &xhci->op_regs->command, temp);
> 
>    Didn't notice this the first time: shouldn't you have removed
> this line also as you're not reading the comamnd register here
> anymore?

Yes, you're right.  I'll send a patch shortly.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux