ehci-tegra issue with deep sleep
Hi. I discovered a problem with USB host mode on a Nexus 7 running Android 4.2.x: USB slave devices will become undetectable ("not accepting address xx, error -71") after the host goes through a deep sleep cycle (60+ seconds loss of external power; running on battery). In this situation the methods tegra_ehci_suspend() and tegra_ehci_resume() are being called. I am _not_ experiencing this issue at all, when the host only goes through a light sleep cycle (less than 20 seconds of power loss). During light sleep, the methods tegra_ehci_suspend() and tegra_ehci_resume() are _not_ being called.
The slave device (a USB DAC; many different products have been tested) is loosing power in both cases. But this does not seem to be the problem, because slave devices stays accessible, when the host (N7) only goes through light sleep.
Is anyone aware of this problem? Has it been fixed since 3.1.10? Thank you.
Timur
Project on github:
http://mehrvarz.github.com/usb-host-mode-power-management-nexus7
Discussion: "Can you charge & USB Host mode simultaneously?"
http://rootzwiki.com/forum/512-nexus-7
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Timur
Hi. I discovered a problem with USB host mode on a Nexus 7 running Android 4.2.x:
Timur,
This mailing list is intended for discussion of the mainline Linux kernel, rather than NVIDIA's modified (and older) downstream kernel, as used on shipping Android devices.
Your best bet for support is to report the issue to [email protected] It may help if you've tried the Ubuntu/L4T install described at:
https://wiki.ubuntu.com/Nexus7
... and reproduced the issue there too; at least some people working on the downstream kernel do have access to Nexus 7s with that software setup.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Stephen Warren
Quoted 2 lines · Timur
Hi. I discovered a problem with USB host mode on a Nexus 7 running Android 4.2.x:
Timur,
This mailing list is intended for discussion of the mainline Linux kernel, rather than NVIDIA's modified (and older) downstream kernel, as used on shipping Android devices.
Quoted 8 lines
Your best bet for support is to report the issue to [email protected] It may help if you've tried the Ubuntu/L4T install described at:
https://wiki.ubuntu.com/Nexus7
... and reproduced the issue there too; at least some people working on the downstream kernel do have access to Nexus 7s with that software setup.
Hi Stephen,
maybe you remember this brief conversation in December. I found the root cause of the reported issue (tegra specific) and I can provide a patch. The outcome is stable, externally powered USB host mode for Nexus 7.
Do you happen to know anyone responsible for the Ubuntu Nexus7 kernel? I would like to contribute the fix, as I think it would be beneficial to that implementation.
Thank you.
Timur
A message that is not in the archive (sent off-list or not yet received): [email protected]
On 01/03/2013 04:52 AM, Timur wrote:
...
Quoted 3 lines
maybe you remember this brief conversation in December. I found the root cause of the reported issue (tegra specific) and I can provide a patch. The outcome is stable, externally powered USB host mode for Nexus 7.
Isn't USB host mode by definition internally powered, and USB device mode by definition externally powered? An externally powered USB host mode sounds quite non-standard. If you allow that mode, how does the system know whether it should be a host or a device when external power is applied; it sounds like this new mode completely breaks the ability to connect the tablet to a PC and use it for Android application development, or MTP (Media Transfer Protocol) to download pictures/movies.
Quoted 3 lines
Do you happen to know anyone responsible for the Ubuntu Nexus7 kernel? I would like to contribute the fix, as I think it would be beneficial to that implementation.
Sorry, I don't know what kernel they're using; the best place to ask would be the Ubuntu project itself.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Stephen Warren
On 01/03/2013 04:52 AM, Timur wrote:
...Quoted 3 lines
maybe you remember this brief conversation in December. I found the root cause of the reported issue (tegra specific) and I can provide a patch. The outcome is stable, externally powered USB host mode for Nexus 7.
Quoted 7 lines
Isn't USB host mode by definition internally powered, and USB device mode by definition externally powered? An externally powered USB host mode sounds quite non-standard. If you allow that mode, how does the system know whether it should be a host or a device when external power is applied; it sounds like this new mode completely breaks the ability to connect the tablet to a PC and use it for Android application development, or MTP (Media Transfer Protocol) to download pictures/movies.
What I am proposing does not result in any loss of original functionality (ADB, MTP, etc.). Also, the described added functionality is fully standard when I look at it. No typical PC needs to switch to battery power, only to connect USB slave devices. You can operate a Nexus 7 on external power. But in order to connect USB slave devices, you *have* to switch to internal battery. Not being able to run USB host mode at all, while using external power, is a serious shortcoming. One that is only caused by the installed kernel. In December, I was having this last difficulty: preserving USB host operations through LP0 phases. But this problem has been solved. Really wanted to clarify this.
Quoted 6 lines
Quoted 4 lines
Do you happen to know anyone responsible for the Ubuntu Nexus7 kernel? I would like to contribute the fix, as I think it would be beneficial to that implementation.
Sorry, I don't know what kernel they're using; the best place to ask would be the Ubuntu project itself.
No, I did not ask what kernel they are using.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 14 lines · Timur Mehrvarz
Quoted 5 lines · Stephen Warren
On 01/03/2013 04:52 AM, Timur wrote:
...Quoted 3 lines
maybe you remember this brief conversation in December. I found the root cause of the reported issue (tegra specific) and I can provide a patch. The outcome is stable, externally powered USB host mode for Nexus 7.
Quoted 7 lines
Isn't USB host mode by definition internally powered, and USB device mode by definition externally powered? An externally powered USB host mode sounds quite non-standard. If you allow that mode, how does the system know whether it should be a host or a device when external power is applied; it sounds like this new mode completely breaks the ability to connect the tablet to a PC and use it for Android application development, or MTP (Media Transfer Protocol) to download pictures/movies.
Quoted 3 lines
What I am proposing does not result in any loss of original functionality (ADB, MTP, etc.). Also, the described added functionality is fully standard when I look at it.
IIUC, a system usually determines if it's a USB host or a USB device based on whether the USB port is being fed with +5v or not; if +5v is fed from the cable, it's a device and if not it's a host.
In order to allow +5v to be fed in from the cable, but operate in host mode, isn't the above convention broken?
Also, doesn't feeding power into the device while it operates in host mode require some kind of non-standard cable in order to inject the power?