mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Merlijn Wajer <merlijn@wizzup.org>
To: Bin Liu <b-liu@ti.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Pali Rohár" <pali.rohar@gmail.com>,
	"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
	linux-omap@vger.kernel.org
Subject: usb: musb: "(null)" in sysfs mode file after disabling a gadget (and at other times, system hangs)
Date: Fri, 2 Mar 2018 00:47:07 +0100	[thread overview]
Message-ID: <f7a8cfac-e70b-046a-b465-7b37630d5d86@wizzup.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1813 bytes --]

Hi,

I found that the "mode" file in musb sys node will return "(null)" when
one would expect it show b_idle.

Wrong /mode file:

[Fresh boot, cable not connected yet]
root@n900devuan:~# modprobe g_nokia
[Insert cable connected to PC]
root@n900devuan:~# cat
/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode
b_peripheral
[Remove cable connected to PC]
root@n900devuan:~# cat
/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode
b_idle
root@n900devuan:~# rmmod g_nokia
root@n900devuan:~# cat
/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode
(null)
[Insert cable connected to PC]
root@n900devuan:~# cat
/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode
b_idle

I would expect it to state "b_idle" instead of "(null)".
I have also been able to reproduce this "(null)" state using only
configfs (and not deprecated g_nokia module), but this example is more
cumbersome to write up)


Sometimes it crashes the entire system (reproducibly):

[Fresh boot, USB cable connect to PC at all times]
root@n900devuan:~# cat
/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode
b_idle
root@n900devuan:~# modprobe g_nokia
root@n900devuan:~# cat
/sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode
b_peripheral
root@n900devuan:~# rmmod g_nokia
(Hangs, reboots after a few seconds, probably due to watchdog)


This occurs on Nokia N900 (RX-51). Kernel config has:

CONFIG_USB_LIBCOMPOSITE=m
CONFIG_USB_F_*=m
CONFIG_USB_G_*=m

I don't have a trace because I don't have a serial on my Nokia N900. I
have not yet tested this on other musb devices, but I can do that if
that helps reproducing the issue.

Cheers,
Merlijn


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

             reply	other threads:[~2018-03-01 23:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 23:47 Merlijn Wajer [this message]
2018-03-02 15:27 ` Bin Liu
2018-03-02 16:47   ` Merlijn Wajer
2018-03-02 16:54     ` Pali Rohár
2018-03-05 19:28       ` Bin Liu
2018-03-05 19:44         ` Merlijn Wajer
2018-03-06 14:36           ` Bin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7a8cfac-e70b-046a-b465-7b37630d5d86@wizzup.org \
    --to=merlijn@wizzup.org \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®