Skip to contentSkip to conversation

musb-hdrc: "Vbus off, timeout 1100 msec" message does not belong in sysfs

DISCUSSION Pavel Machek 5 participants 8 messages Jul 9, 2015 – Jul 13, 2015

lore
Share & tools
lore
#0 lore raw

Hi!

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

root@n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

:-(.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 10 lines · Pavel Machek

Hi!

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

:-(.

Plus, documentation for this is nowhere to be seen:

pavel at amd:/data/l/linux-n900$ grep -ri musb Documentation/ABI/ pavel at amd:/data/l/linux-n900$

..which is a shame, because it is not really clear how to use this one:

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat mode
b_idle
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# echo a_suspend > mode
-bash: echo: write error: Invalid argument
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# echo a > mode
-bash: echo: write error: Invalid argument
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# echo a_host > mode
-bash: echo: write error: Invalid argument
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# echo b_host > mode
-bash: echo: write error: Invalid argument
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# echo a_idle > mode
-bash: echo: write error: Invalid argument
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# echo b_wait_acon > mode
-bash: echo: write error: Invalid argument
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto#

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
Quoted 45 lines · On Thursday 09 July 2015 23:46:10 Pavel Machek wrote:
Quoted 10 lines · Pavel Machek

Hi!

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/mu sb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

:-(.

Plus, documentation for this is nowhere to be seen:

pavel at amd:/data/l/linux-n900$ grep -ri musb Documentation/ABI/ pavel at amd:/data/l/linux-n900$

..which is a shame, because it is not really clear how to use this one:

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb -hdrc.0.auto# cat mode
b_idle
root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb

(quoted diff) +0 -2
-hdrc.0.auto# echo a_suspend > mode
-bash: echo: write error: Invalid argument

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb

(quoted diff) +0 -2
-hdrc.0.auto# echo a > mode
-bash: echo: write error: Invalid argument

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb

(quoted diff) +0 -2
-hdrc.0.auto# echo a_host > mode
-bash: echo: write error: Invalid argument

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb

(quoted diff) +0 -2
-hdrc.0.auto# echo b_host > mode
-bash: echo: write error: Invalid argument

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb

(quoted diff) +0 -2
-hdrc.0.auto# echo a_idle > mode
-bash: echo: write error: Invalid argument

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb

(quoted diff) +0 -2
-hdrc.0.auto# echo b_wait_acon > mode
-bash: echo: write error: Invalid argument

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb -hdrc.0.auto#

Quoted 1 line

Pavel

Hi!

I remember that this file is used for switching between usb peripheral and host mode. But because n900 HW somehow broken, for usb host mode are needed couple of "hack" patches which workaround HW bugs... This is still not enough and "support" from userspace is needed for it too.

Kernel patches are part of Maemo kernel-power 2.6.28 version and with package usbmode http://maemo.org/packages/view/usbmode/ is it possible to enter usb host mode on n900 (and then connect e.g. usb stick).

And IIRC correct command is:

# echo host > mode
# echo peripheral > mode
Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150709/4145c2fd/attachment.sig>
#3 lore raw
In reply to Pavel Machek
Quoted 2 lines · Pavel Machek
Quoted 1 line · Pavel Machek

Hi!

Hi,

Quoted 8 lines
Quoted 8 lines

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

Quoted 6 lines
Quoted 1 line

:-(.

Plus, documentation for this is nowhere to be seen:

pavel at amd:/data/l/linux-n900$ grep -ri musb Documentation/ABI/ pavel at amd:/data/l/linux-n900$

that is a shame indeed. It is part of the driver since TUSB support was merged via commit 550a7375f ("USB: Add MUSB and TUSB support") about 7 years ago.
The parameter expects the timeout values which is used to poll the port for mode changes (host/device mode) since it can not be detected on its own.
Felipe knows best if it is better to document it or remove it. I can't remember that I needed it on am335x.

Quoted 2 lines

Pavel

Sebastian

#4 lore raw
Quoted 21 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Pavel Machek
Quoted 1 line · Pavel Machek

Hi!

Hi,

Quoted 8 lines
Quoted 8 lines

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

root at n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

Quoted 6 lines
Quoted 1 line

:-(.

Plus, documentation for this is nowhere to be seen:

pavel at amd:/data/l/linux-n900$ grep -ri musb Documentation/ABI/ pavel at amd:/data/l/linux-n900$

Quoted 8 lines

that is a shame indeed. It is part of the driver since TUSB support was merged via commit 550a7375f ("USB: Add MUSB and TUSB support") about 7 years ago.
The parameter expects the timeout values which is used to poll the port for mode changes (host/device mode) since it can not be detected on its own.
Felipe knows best if it is better to document it or remove it. I can't remember that I needed it on am335x.

N900's usersland relies on it, IIRC. But it could be that it was used just for testing. I'm not entirely sure.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150713/9c93be7f/attachment-0001.sig>
#5 lore raw
In reply to Pavel Machek

Hi,

Quoted 10 lines · Pavel Machek

Hi!

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

root@n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

:-(.

patches are always welcome.

Signature · 1 line
balbi
#6 lore raw
Quoted 8 lines · Felipe Balbi

Hi,

Quoted 5 lines · Pavel Machek

Hi!

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

Quoted 7 lines
Quoted 5 lines

root@n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

:-(.

patches are always welcome.

You'd have to at least describe how you'd like to see it solved if you wanted to pretend you maintain it... 2 new attributes? What should be their names?

MAINTAINERS +1 -1
index f6362d7..2e85300 100644
@@ -6900,7 +6900,7 @@ MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
 M:	Felipe Balbi <[email protected]>
 L:	[email protected]
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
-S:	Maintained
+S:	Odd fixes
 F:	drivers/usb/musb/
 
 MXL5007T MEDIA DRIVER
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#7 lore raw
Quoted 28 lines · Pavel Machek
Quoted 8 lines · Felipe Balbi

Hi,

Quoted 5 lines · Pavel Machek

Hi!

sysfs should contain one value per file. This one has at least two, with nice english sentence as a bonus.

Quoted 7 lines
Quoted 5 lines

root@n900:/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto# cat vbus
Vbus off, timeout 1100 msec

:-(.

patches are always welcome.

You'd have to at least describe how you'd like to see it solved if you wanted to pretend you maintain it... 2 new attributes? What should be their names?

MAINTAINERS +0 -0
index f6362d7..2e85300 100644

MAINTAINERS MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER · line 6904

Quoted 6 lines
MAINTAINERS +1 -1
@@ -6900,7 +6900,7 @@ MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
 M:	Felipe Balbi <[email protected]>
 L:	[email protected]
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
-S:	Maintained
+S:	Odd fixes
 F:	drivers/usb/musb/

Don't be a jerk, you are _this_ close to being added to my killfile...