linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [chipidea] continuous USB resets on NXP i.MX 6ULL device
@ 2019-09-24 10:08 Igor Opaniuk
  2019-09-25  0:44 ` Peter Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Igor Opaniuk @ 2019-09-24 10:08 UTC (permalink / raw)
  To: Fabio Estevam, Peter Chen, stefan.wahren
  Cc: Marcel Ziswiler, Stefan Agner, linux-usb

Hi Fabio, Peter, Stefan,

I've incidentally discovered your last year discussion in ML [1] (I
hope it rings
the bell) regarding the issue I'm still observing on the same device with
the mainline kernel.

The difference between i.MX 6ULL EVK and this particular device,
is that usbotg2 is used only in host mode with the usb hub integrated on
the carrier board [2] [3].

root@colibri-imx6:~# lsusb -s 1:1 --tree
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M

However I can't reproduce the same behavior with i.MX 6ULL EVK
with connected usb hub to usbotg2. Also this behavior can't be reproduced
with NXP downstream kernel (Linux version 4.9.144) on my device.

After digging in a bit I found out that this happens only when
autosuspend is enabled for the usb controller:
echo auto > /sys/bus/usb/devices/1-1/power/control

It tries to go to suspend mode, but everytime fails and resumes:
root@colibri-imx6:~# cat /sys/bus/usb/devices/1-1/power/runtime_status
suspended
root@colibri-imx6:~# cat /sys/bus/usb/devices/1-1/power/runtime_status
resuming
root@colibri-imx6:~# cat /sys/bus/usb/devices/1-1/power/runtime_status
suspended
root@colibri-imx6:~# cat /sys/bus/usb/devices/1-1/power/runtime_status
suspended
root@colibri-imx6:~# cat /sys/bus/usb/devices/1-1/power/runtime_status
suspended
root@colibri-imx6:~# cat /sys/bus/usb/devices/1-1/power/runtime_status
resuming

I'm observing ~2 seconds wakeup interrupts handled in ci_irq() in core.c and
subsequent invocation of imx_controller_resume().

Meantime usboh3 remains enabled all the time
(though imx_disable_unprepare_clks() should disable it):
root@colibri-imx6:~# cat /sys/kernel/debug/clk/clk_summary | grep usb
    usbphy2_gate                      1        1        0           0
        0     0  50000
    usbphy1_gate                      1        1        0           0
        0     0  50000
          pll7_usb_host               1        1        0   480000000
        0     0  50000
             usbphy2                  1        1        0   480000000
        0     0  50000
          pll3_usb_otg                2        3        0   480000000
        0     0  50000
             usbphy1                  0        0        0   480000000
        0     0  50000
                         usboh3       1        1        0    66000000
        0     0  50000

While I'm trying to localize the root cause, maybe you can give some hints
where to look into?

Thanks for helping me!

[1] https://marc.info/?l=linux-usb&m=151844741732751
[2] https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/imx6ull-colibri.dtsi#L191
[3] https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi#L143

-- 
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk@gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-08  3:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 10:08 [chipidea] continuous USB resets on NXP i.MX 6ULL device Igor Opaniuk
2019-09-25  0:44 ` Peter Chen
2019-09-30 11:35   ` Igor Opaniuk
2019-10-02 16:15     ` Igor Opaniuk
2019-10-08  3:17       ` Peter Chen

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).