Re: [PATCH 1/3] usb: gadget: dummy_hcd: refactor dummy_start to be DRY

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

 



On Tue, 3 Jun 2014, Pantelis  Koukousoulas wrote:

> On Mon, Jun 2, 2014 at 6:04 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > No, this is completely wrong.  When the driver uses SuperSpeed support,
> > there are two hcds: the high speed one and the SuperSpeed one.  They
> > are different structures and they both need to be initialized.
> >
> > It sounds like you have confused struct dummy (there's only one of
> > these) with struct dummy_hcd (there are two of these).
> 
> I think that indeed I was completely wrong but I wasn't confused about the
> structures, but regarding some details of what is executed when, in which
> order and in which context.
> 
> The reason was that when I simply removed the timer / list initialization
> from dummy_start_ss(), (because they belong to the shared struct dummy_hcd
> so they better only be initialized in one place)

That's the same mistake as before -- struct dummy_hcd _isn't_ shared.  
Only struct dummy is shared.

>  I got a hard lockup
> during testing,
> when I started dummy_hcd in superspeed mode and added a device.
> 
> I think that now I understand why this happened, but I will read the
> relevant bits
> from dummy_hcd and xhci once more (especially what happens if there is
> a suspend / resume between the initialization of the highspeed hcd and the
> superspeed hcd) and come back with a different approach that will hopefully
> be both correct and DRY.

The current version of xhci-pci prevents any suspends from occurring
between the initialization of the two hcds; see commit bcffae7708eb.  
You might need to make dummy-hcd do the same thing.

Alan Stern

--
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