Re: [RFC v3 12/23] USB: Set usb_hcd->state and flags for shared roothubs.

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

 



On Tue, Mar 08, 2011 at 11:40:33AM -0500, Alan Stern wrote:
> On Mon, 7 Mar 2011, Sarah Sharp wrote:
> > The xHCI driver will need to ensure that HC_STATE_HALT, HC_STATE_RUNNING,
> > and HC_STATE_QUIESCING will be set for both the roothubs.
> 
> Fortunately this is no longer necessary, unless xhci-hcd uses 
> hcd->state internally.

Alan, I tried to remove all references to HC_STATE_HALT and
HC_STATE_RUNNING in the xHCI driver, since it only sets them and never
tests them.

The problem is, the roothub allocation fails in register_root_hub().
HC_STATE_HALT is defined to be zero, and the USB core never sets
HC_STATE_RUNNING in the roothub allocation function, so if the xHCI
driver never sets HC_STATE_RUNNING itself, the roothub allocation will
fail here because of the second conditional in the if statement:

static int register_root_hub(struct usb_hcd *hcd)
{
...
        if (retval == 0) {
                spin_lock_irq (&hcd_root_hub_lock);
                hcd->rh_registered = 1;
                spin_unlock_irq (&hcd_root_hub_lock);

                /* Did the HC die before the root hub was registered? */
                if (HCD_DEAD(hcd) || hcd->state == HC_STATE_HALT)
                        usb_hc_died (hcd);      /* This time clean up */
        }

I really want to move the xHCI driver away from having to set
hcd->state.  Can you rework your hcd->state patch to accommodate drivers
that never touch it?

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