linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Minas Harutyunyan <hminas@synopsys.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Matt Corallo <oc2udbzfd@mattcorallo.com>,
	linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux.amoon@gmail.com
Subject: Re: ODROID-C1/-C2 USB Detection only triggered by some devices
Date: Thu, 1 Jul 2021 01:09:33 +0200	[thread overview]
Message-ID: <CAFBinCDc6RUypJpujmYdkjo6j-xsg0HkZEZGxTCsTW4tZ-bJPA@mail.gmail.com> (raw)
In-Reply-To: <CAFBinCDsGtQaPLhMAb+A6DBihWzQiU409i2oer_ud5yQBvfM5w@mail.gmail.com>

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

Hi Minas,

On Tue, Jun 29, 2021 at 6:30 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Alan,
>
> On Tue, Jun 29, 2021 at 6:18 PM Alan Stern <stern@rowland.harvard.edu> wrote:
> [...]
> > > >         usbcore.autosuspend=-1
> > > wow, this helps indeed
> > > my steps are:
> > > - power off my Odroid-C1+
> > > - unplug all USB devices
> > > - boot with usbcore.autosuspend=-1 in the kernel cmdline
> > > - plugin my Corsair Voyager USB 3.0 flash drive (which was only
> > > detected before if an additional USB 2.0 flash drive was plugged in
> > > during boot)
> > > -> without any lsusb magic the device was immediately recognized
> >
> > That does show pretty convincingly that runtime suspend is causing the
> > problem.  But I still have no idea why the problem affects some devices
> > and not others.  It's a mystery.
> Maybe because there's two related problems (I am guessing here):
> The first issue is that USB hotplug is not working at all on my
> Odroid-C1+ (which means: dwc2 + GL852G USB hub).
> The second issue is that the workaround we had before (running lsusb
> -vv to make "hot plugged" devices show up) is not working for some USB
> devices.
>
> It seems that using a different workaround (usbcore.autosuspend=-1)
> makes *all* USB devices show up - even without any "lsusb -vv" call.
> So I think we should focus on the first issue as it may also fix the
> other problem as well.
above paragraph sums up the issues which Matt and I are seeing (on
Odroid-C1+ and Odroid-C2) in case you didn't follow the full email
thread

> [...]
> > > after rebooting without usbcore.autosuspend=-1 (and no USB device
> > > plugged in during boot):
> > > # grep "" /sys/bus/usb/devices/*/power/autosuspend
> > > /sys/bus/usb/devices/1-1/power/autosuspend:0
> > > /sys/bus/usb/devices/usb1/power/autosuspend:0
> > >
> > > I think the next step is narrowing down which component is causing this issue.
> >
> > Maybe Minas can help.  He knows a lot more about dwc2 than I do (which
> > is practically nothing).
> I'll wait for Minas then
I have attached the dwc2 debugfs output to this email as well as I
think that it'll be useful
unfortunately I could not attach the "regdump" because that hangs my
Odroid-C1+ (not sure but this seems like an unrelated issue?)

in params.c dwc2_set_amlogic_params is used to override a few hardware
parameters.
power_down is one of them (although Alan's comment suggests that it
may not be related) is overwritten there to
DWC2_POWER_DOWN_PARAM_NONE. When removing that overriding then the
value (probably as set by the designer) is
DWC2_POWER_DOWN_PARAM_PARTIAL.


Best regards,
Martin

[-- Attachment #2: dwc2-debugfs.txt --]
[-- Type: text/plain, Size: 6622 bytes --]

/sys/kernel/debug/usb/c90c0000.usb/dr_mode:host
/sys/kernel/debug/usb/c90c0000.usb/fifo:Non-periodic FIFOs:
/sys/kernel/debug/usb/c90c0000.usb/fifo:RXFIFO: Size 512
/sys/kernel/debug/usb/c90c0000.usb/fifo:NPTXFIFO: Size 500, Start 0x00000200
/sys/kernel/debug/usb/c90c0000.usb/fifo:
/sys/kernel/debug/usb/c90c0000.usb/fifo:Periodic TXFIFOs:
/sys/kernel/debug/usb/c90c0000.usb/hw_params:op_mode                       : 5
/sys/kernel/debug/usb/c90c0000.usb/hw_params:arch                          : 2
/sys/kernel/debug/usb/c90c0000.usb/hw_params:dma_desc_enable               : 1
/sys/kernel/debug/usb/c90c0000.usb/hw_params:enable_dynamic_fifo           : 1
/sys/kernel/debug/usb/c90c0000.usb/hw_params:en_multiple_tx_fifo           : 0
/sys/kernel/debug/usb/c90c0000.usb/hw_params:rx_fifo_size                  : 2048
/sys/kernel/debug/usb/c90c0000.usb/hw_params:host_nperio_tx_fifo_size      : 2048
/sys/kernel/debug/usb/c90c0000.usb/hw_params:dev_nperio_tx_fifo_size       : 0
/sys/kernel/debug/usb/c90c0000.usb/hw_params:host_perio_tx_fifo_size       : 2048
/sys/kernel/debug/usb/c90c0000.usb/hw_params:nperio_tx_q_depth             : 4
/sys/kernel/debug/usb/c90c0000.usb/hw_params:host_perio_tx_q_depth         : 4
/sys/kernel/debug/usb/c90c0000.usb/hw_params:dev_token_q_depth             : 8
/sys/kernel/debug/usb/c90c0000.usb/hw_params:max_transfer_size             : 524287
/sys/kernel/debug/usb/c90c0000.usb/hw_params:max_packet_count              : 1023
/sys/kernel/debug/usb/c90c0000.usb/hw_params:host_channels                 : 16
/sys/kernel/debug/usb/c90c0000.usb/hw_params:hs_phy_type                   : 1
/sys/kernel/debug/usb/c90c0000.usb/hw_params:fs_phy_type                   : 0
/sys/kernel/debug/usb/c90c0000.usb/hw_params:i2c_enable                    : 0
/sys/kernel/debug/usb/c90c0000.usb/hw_params:num_dev_ep                    : 2
/sys/kernel/debug/usb/c90c0000.usb/hw_params:num_dev_perio_in_ep           : 0
/sys/kernel/debug/usb/c90c0000.usb/hw_params:total_fifo_size               : 1984
/sys/kernel/debug/usb/c90c0000.usb/hw_params:power_optimized               : 1
/sys/kernel/debug/usb/c90c0000.usb/hw_params:utmi_phy_data_width           : 1
/sys/kernel/debug/usb/c90c0000.usb/hw_params:snpsid                        : 0x4f54310a
/sys/kernel/debug/usb/c90c0000.usb/hw_params:dev_ep_dirs                   : 0x0
/sys/kernel/debug/usb/c90c0000.usb/params:otg_cap                       : 2
/sys/kernel/debug/usb/c90c0000.usb/params:dma_desc_enable               : 0
/sys/kernel/debug/usb/c90c0000.usb/params:dma_desc_fs_enable            : 0
/sys/kernel/debug/usb/c90c0000.usb/params:speed                         : 0
/sys/kernel/debug/usb/c90c0000.usb/params:enable_dynamic_fifo           : 1
/sys/kernel/debug/usb/c90c0000.usb/params:en_multiple_tx_fifo           : 0
/sys/kernel/debug/usb/c90c0000.usb/params:host_rx_fifo_size             : 512
/sys/kernel/debug/usb/c90c0000.usb/params:host_nperio_tx_fifo_size      : 500
/sys/kernel/debug/usb/c90c0000.usb/params:host_perio_tx_fifo_size       : 500
/sys/kernel/debug/usb/c90c0000.usb/params:max_transfer_size             : 524287
/sys/kernel/debug/usb/c90c0000.usb/params:max_packet_count              : 1023
/sys/kernel/debug/usb/c90c0000.usb/params:host_channels                 : 16
/sys/kernel/debug/usb/c90c0000.usb/params:phy_type                      : 1
/sys/kernel/debug/usb/c90c0000.usb/params:phy_utmi_width                : 16
/sys/kernel/debug/usb/c90c0000.usb/params:phy_ulpi_ddr                  : 0
/sys/kernel/debug/usb/c90c0000.usb/params:phy_ulpi_ext_vbus             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:i2c_enable                    : 0
/sys/kernel/debug/usb/c90c0000.usb/params:ipg_isoc_en                   : 0
/sys/kernel/debug/usb/c90c0000.usb/params:ulpi_fs_ls                    : 0
/sys/kernel/debug/usb/c90c0000.usb/params:host_support_fs_ls_low_power  : 0
/sys/kernel/debug/usb/c90c0000.usb/params:host_ls_low_power_phy_clk     : 0
/sys/kernel/debug/usb/c90c0000.usb/params:activate_stm_fs_transceiver   : 0
/sys/kernel/debug/usb/c90c0000.usb/params:activate_stm_id_vb_detection  : 0
/sys/kernel/debug/usb/c90c0000.usb/params:ts_dline                      : 0
/sys/kernel/debug/usb/c90c0000.usb/params:reload_ctl                    : 1
/sys/kernel/debug/usb/c90c0000.usb/params:ahbcfg                        : 0xa
/sys/kernel/debug/usb/c90c0000.usb/params:uframe_sched                  : 1
/sys/kernel/debug/usb/c90c0000.usb/params:external_id_pin_ctl           : 0
/sys/kernel/debug/usb/c90c0000.usb/params:power_down                    : 0
/sys/kernel/debug/usb/c90c0000.usb/params:lpm                           : 0
/sys/kernel/debug/usb/c90c0000.usb/params:lpm_clock_gating              : 0
/sys/kernel/debug/usb/c90c0000.usb/params:besl                          : 0
/sys/kernel/debug/usb/c90c0000.usb/params:hird_threshold_en             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:hird_threshold                : 0
/sys/kernel/debug/usb/c90c0000.usb/params:service_interval              : 0
/sys/kernel/debug/usb/c90c0000.usb/params:host_dma                      : 1
/sys/kernel/debug/usb/c90c0000.usb/params:g_dma                         : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_dma_desc                    : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_rx_fifo_size                : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_np_tx_fifo_size             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[0]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[1]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[2]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[3]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[4]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[5]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[6]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[7]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[8]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[9]             : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[10]            : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[11]            : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[12]            : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[13]            : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[14]            : 0
/sys/kernel/debug/usb/c90c0000.usb/params:g_tx_fifo_size[15]            : 0

  parent reply	other threads:[~2021-06-30 23:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  0:32 ODROID-C1/-C2 USB Detection only triggered by some devices Matt Corallo
2021-06-28  0:58 ` Alan Stern
2021-06-28  1:05   ` Matt Corallo
2021-06-28  1:16     ` Alan Stern
2021-06-28  1:24       ` Matt Corallo
2021-06-28 14:24         ` Alan Stern
2021-06-28 18:37           ` Martin Blumenstingl
2021-06-29 15:05             ` Alan Stern
2021-06-29 15:51               ` Martin Blumenstingl
2021-06-29 16:18                 ` Alan Stern
2021-06-29 16:30                   ` Martin Blumenstingl
2021-06-30  0:35                     ` Alan Stern
2021-07-01 10:03                       ` Anand Moon
2021-07-01 21:18                         ` Martin Blumenstingl
2021-07-02 19:11                           ` Anand Moon
2021-07-02 19:33                             ` Martin Blumenstingl
     [not found]                               ` <CANAwSgQH6HgFQ+xz15AoKhGUF9G18P-cHOVL2FvS_34FrW=bzQ@mail.gmail.com>
2021-07-13 15:41                                 ` Martin Blumenstingl
2021-06-30 23:09                     ` Martin Blumenstingl [this message]
2021-07-10 17:07                       ` Martin Blumenstingl
2021-07-11  8:15                         ` ODROID-C1/-C2 USB Detection only triggered by some devices dwc2 Minas Harutyunyan
     [not found]                           ` <CAFBinCCj5zUiv9LS2jKRxzX5pfcFTr4tVZwR7TA2CRQg68qwTw@mail.gmail.com>
2021-07-12  6:42                             ` Minas Harutyunyan
2021-07-12 11:35                               ` Martin Blumenstingl
2021-07-14 15:27                                 ` Minas Harutyunyan
2021-07-14 23:16                                   ` Martin Blumenstingl
2021-07-15  1:44                                     ` Alan Stern
2021-07-15  2:04                                       ` Alan Stern
2021-07-18 21:24                                       ` Martin Blumenstingl
2021-07-19 14:53                                         ` Alan Stern
2021-07-19 15:03                                           ` Alan Stern
2021-07-20 21:55                                           ` Martin Blumenstingl
2021-07-21 15:58                                             ` Alan Stern
2021-08-03 20:20                                               ` Martin Blumenstingl
2021-08-03 21:32                                                 ` Alan Stern
2021-12-12 16:08                                                   ` Martin Blumenstingl
2022-01-10 22:05                                                     ` Martin Blumenstingl

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=CAFBinCDc6RUypJpujmYdkjo6j-xsg0HkZEZGxTCsTW4tZ-bJPA@mail.gmail.com \
    --to=martin.blumenstingl@googlemail.com \
    --cc=hminas@synopsys.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=oc2udbzfd@mattcorallo.com \
    --cc=stern@rowland.harvard.edu \
    /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).