Re: [PATCH] usb: dwc3: Fix spurious wakeup when port is on device mode

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

 



On 17/01/2024 21:39, Thinh Nguyen wrote:
> [...]
> That means the disconnection is initiated by the dwc3 driver. This
> should happen when you put the STEAM DECK in suspend while connected to
> the laptop. From your laptop, you should see the DECK is disconnected as
> if the cable is unplugged.
> 
> If that did not happen, can you capture the dwc3 tracepoints to see
> what's wrong?
> 
> You can follow this instruction to capture the tracepoints:
> https://www.kernel.org/doc/html/latest/driver-api/usb/dwc3.html#required-information
> 

Hi Thinh, thanks again for your patience and suggestions!

I've tried my best to determine the state of the USB port from my laptop
PoV when connecting the Deck there, but I was unsuccessful. The Deck
doesn't appear on laptop's lsusb output, and there's nothing on dmesg /
tracing (xhci), dynamic debug or some power interfaces I poked about
that. The way to go, IIUC, it's now trying to measure that directly in
the port, using a multimeter or some HW device for that. I don't have
that, but what I was able to do instead is collecting the traces you
asked, at least heh


So, I did 4 collections, all in the attached tarball.

(1) Right after booting the Steam Deck and enabling the traces [0], I've
changed the mode of dwc3 (in the debugfs) from host to device - results
on {trace,regdump}.1

(2) Plugged the USB cable connecting the Deck to my laptop - results at
{trace,regdump}.2 and as we can see, traces are empty.

(3) Attempt suspending the Deck (by running "echo mem >
/sys/power/state"), it failed as expected - then I've collected results
on {trace,regdump}.3

(4) [bonus] Collected the same results of 3 (after rebooting the Deck)
but running dwc3 with this patch/quirk - it's easy to notice in the
trace, as we can see the extras readl/writel prior to suspend. In this
case, suspend works...and results are on {trace,regdump}.4-PATCHED

Tests were done on kernel 6.7 mainline, no OOT drivers running. Hope it
helps to narrow down the issue, and again, thanks for your help here.

[0]
cd /sys/kernel/tracing/
echo 1 > events/dwc3/enable
echo :mod:dwc3 > set_ftrace_filter
echo :mod:dwc3_pci >> set_ftrace_filter
echo function > current_tracer


>  [...]
> That means to unplug the cable connected to the STEAM DECK. Put the
> STEAM DECK to suspend. Check to see if it stays suspend or it would wake
> up right away.

Oh, this case was tested before and it works fine =)


> Also, in your test, the connected host (the laptop) remained ON at all
> time while the STEAM DECK was tested for suspend right?
> 

Yes, laptop always powered ON!
Cheers,


Guilherme

Attachment: dwc3.dumps.tgz
Description: application/compressed-tar


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux