virtual hub and suspend/resume/reset questions

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

 



Hi !

The USB spec is twisting my brain sideways trying to figure out how to
properly handle suspend/resume in the case of the aspeed vHub.

Reminder: This is a combo-gadget HW that has 5 UDC "ports" (gadgets)
and a virtual hub above them, so it looks to the host as a hub with 5
ports, the hub functionality is partially done in HW, partially in SW
in my driver.

So first what I think is the easy case of explicit port suspend/resume
by SetPortFeature/ClearPortFeature.

In that case, I can just call the gadget suspend() callback for that
port, keep track that the port is suspended, and *maybe* also disable
the HW so it doesn't respond on any pipe.

Same goes with the obvious resume case above I assume. A port reset
would probably also "resume" though I would forward a reset to the
gadget rather than a resume, right ? (but clear my "suspended" state
flag).

Now where things become interesting:

 - A wakeup() from the gadget. If the port is suspended but nothing
else above it, what do I do ? Mark the port resumed and move on ? Do I
need to call the gadget resume() callback ?

 - If I get a suspend from the host. IE. the top level port of the vhub
detects a suspend state on the bus (the HW signals that to me). I
assume here I should call "suspend" on all my downstream gadgets, at
least those who weren't already suspended. But do I also change the
internal state to "suspended" for all the ports ? 

 - Then I get a resume from the host, ie, the upstream bus resumes,
should I resume *all* my downstream ports ? What if a downstream port
had been explicitly suspended with SetPortFeature before the host
suspended the whole bus, will the bus resume also clear that suspend
state or should that port remain suspended until a ClearPortFeature or
reset occurs ?

 - I assume a bus reset (after set address) will result in broadcasting
a reset to all the downstream ports. What if they were suspended,
should I call resume first then reset or just reset on the gadgets ?

 - Should my virtual hub "emulate" the various timings/delays of a hub
switching between those different states ? Esp. from resume or reset to
enabled, is it ok if it's more/less immediate ?

 - When a downstream port is suspended, I assume I need to actively
block activity on its pipes ? ie, not forward setup packets and NAK
everything to it, or is this unnecessary ?

Thanks !

Cheers,
Ben.

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