Re: Command ring abort xhci_handshake question

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

 



> On Apr 25, 2019, at 9:22 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Are you certain that those places with the very long timeouts are 
> called with interrupts disabled?

I must admit, I have not reviewed all uses of the long xhci_handshakes.  :)  I have reviewed the following instance.

In usb/host/xhci-ring.c:xhci_abort_cmd_ring():

    ret = xhci_handshake(&xhci->op_regs->cmd_ring,
            CMD_RING_RUNNING, 0, 5 * 1000 * 1000);
    if (ret < 0) {
        xhci_err(xhci, "Abort failed to stop command ring: %d\n", ret);
        xhci_halt(xhci);
        xhci_hc_died(xhci);
        return ret;
    }
    /*
     * Writing the CMD_RING_ABORT bit should cause a cmd completion event,
     * however on some host hw the CMD_RING_RUNNING bit is correctly cleared
     * but the completion event in never sent. Wait 2 secs (arbitrary
     * number) to handle those cases after negation of CMD_RING_RUNNING.
     */
    spin_unlock_irqrestore(&xhci->lock, flags);

The spin_unlock occurs before the completion wait, so I assume that interrupts are disabled in the spin above.  Also, the system does nothing during this period.  No SSH, no serial, no log messages, etc.

Seth




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

  Powered by Linux