linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Martin Kepplinger <martin.kepplinger@puri.sm>,
	linux-usb@vger.kernel.org, gregkh@linuxfoundation.org
Cc: kernel@puri.sm, linux-kernel@vger.kernel.org, p.zabel@pengutronix.de
Subject: Re: suspend problem with dwc3 gadget / g_multi when usb disconnected
Date: Tue, 10 Dec 2019 13:39:47 +0200	[thread overview]
Message-ID: <87blsgl88s.fsf@gmail.com> (raw)
In-Reply-To: <38edc05e-680b-d881-49fc-e8230a93b2c8@puri.sm>

[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]


Hi,

Martin Kepplinger <martin.kepplinger@puri.sm> writes:
> I'm running today's linux-next with this defconfig on a librem 5 devkit:
>
> https://source.puri.sm/martin.kepplinger/linux-next/blob/next-20191205/librem5/arch/arm64/configs/librem5_defconfig
>
> So I want to have host and gadget mode (G_MULTI, most importantly a
> serial ACM console), and I'm having trouble with S3 suspend:
>
> * The most interesting case here: When I boot with USB disconnected
> (from the battery) I can't suspend or unload dwc3. After "echo mem >
> /sys/power/state" I get nothing in the my logs except
>
> [   18.107380] PM: suspend entry (deep)
>
> and the system hangs. similarly, I can't work around this by rmmod -f
> dwc3. What can go wrong here? I don't know enough about usb hci and why
> this shouldn't work. What can I do to help you here?
>
> * When I boot with USB connected, then unplug USB, I get:
>
> [   19.289602] dwc3 38100000.usb: request 000000006a19695c was not
> queued to ep3in

please capture ftrace logs from dwc3. We have documentation for this:

https://www.kernel.org/doc/html/latest/driver-api/usb/dwc3.html

(note to self: update email address :-)

> and then try to suspend:
>
> root@pureos:/home/purism# echo mem > /sys/power/state
> [   37.863066] xhci-hcd xhci-hcd.0.auto: xHCI host controller not
> responding, assume dead
> [   37.871345] xhci-hcd xhci-hcd.0.auto: HC died; cleaning up
> [   37.877260] PM: dpm_run_callback(): platform_pm_suspend+0x0/0x78
> returns -22
> [   37.884626] PM: Device xhci-hcd.0.auto failed to suspend async: error -22
> [   37.891728] PM: Some devices failed to suspend, or early wake event
> detected
> bash: echo: write error: Invalid argument
>
>
> * When I keep USB connected, the behaviour is similar actually, but
> rmmod works (but that use-case is not that interesting to me).
>
>
> Since my experience with USB drivers is limited, I'm glad to hear about
> any of your experience with dwc3- or more general gadget-problems with
> suspend and that or a similar configuration.
>
> Without G_MULTI and dwc3 host-only, suspend works btw. And all the above
> is basically identical on previous stable kernels too.

Have you tried any other gadget drivers or just g-multi? Care to try
with something simple like g-zero?

cheers

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2019-12-10 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 13:11 suspend problem with dwc3 gadget / g_multi when usb disconnected Martin Kepplinger
2019-12-10 11:39 ` Felipe Balbi [this message]
     [not found]   ` <df4060e1-5ef6-3d2b-5dd4-5a0cb577bb68@puri.sm>
2019-12-12 12:39     ` Felipe Balbi
2019-12-13 12:19       ` Martin Kepplinger
2019-12-16 10:10         ` Martin Kepplinger

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=87blsgl88s.fsf@gmail.com \
    --to=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@puri.sm \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.kepplinger@puri.sm \
    --cc=p.zabel@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).