Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Ferry Toth <fntoth@gmail.com>
To: Jack Pham <jackp@codeaurora.org>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Felipe Balbi <balbi@kernel.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: Re: BUG with linux 5.9.0 with dwc3 in gadget mode
Date: Tue, 27 Oct 2020 23:07:01 +0100
Message-ID: <8d14735a-d8ff-da78-b93f-c80b1c3307c3@gmail.com> (raw)
In-Reply-To: <20201027210648.GB26640@jackp-linux.qualcomm.com>

Hi,

Op 27-10-2020 om 22:06 schreef Jack Pham:
> Hi Ferry,
>
> On Tue, Oct 27, 2020 at 09:13:31PM +0100, Ferry Toth wrote:
>> Hi guys,
>>
>> Sorry for messing up the CC list. This was partly thanks to gmane, partly my
>> own stupidity. I hope it is complete now.
>>
>> I am summarizing the status of this one at the bottom.
>>
>> Op 22-10-2020 om 15:43 schreef Andy Shevchenko:
>>> On Thu, Oct 22, 2020 at 4:21 PM Thinh Nguyen <Thinh.Nguyen@synopsys.com> wrote:
>>>> Ferry Toth wrote:
>>>>> Op 21-10-2020 om 21:50 schreef Thinh Nguyen:
>>>>>> Ferry Toth wrote:
>>> ...
>>>
>>>>>> Oops, looks like I can't make it synchronous this way. Can you try
>>>>>> Jack's change to the u_audio.c instead?
>>>>> Oops indeed goes away with Jack's change, but usb connection goes
>>>>> up/down continuously, meaning: my host sees usb network and audio
>>>>> device appearing / disappearing.
>>>> Ok, thanks for verifying that it went away.
>>>>
>>>>> mass_storage device does not appear all.
>>>> There are some fixes to dwc3 in kernel mainline. Is it possible to test
>>>> this against linux-next?
>>> I think the best is to wait for v5.10-rc1 and retest.
>>>
>> I looks like there have been at least 3 problems:
>>
>> 1) dwc3 was not working in host mode, but not causing an oops. This may have
>> been caused by platform changes. Andy has provided a fix for this, dwc3 now
>> working in host mode on 5.9
>>
>> 2) dwc3 was causing the oops in gadget mode as referenced in this thread.
>> The experimental patch from Jack Phan indeed fixes this.
>>
>> Code here: https://github.com/edison-fw/linux/commits/eds-acpi-5.9.0
> Great, thanks! I'll submit the patch to the list. Is it alright if I
> add a Reported-and-tested-by tag from you?

Sure.

I also tested against 5.10-rc1 now, see below.

>> 3) With the above 2 fixes gadgets work but seem to be powered down (after 15
>> sec. or so) and up (after 1 sec.) continuously. No oops, no errors in
>> journal. The gadgets I enabled are a network, sound and mass storage. The
>> latter stops working due to going up/down quickly. But my host shows
>> network/sound appearing/disappearing. Journal of edison shows:
>>
>> systemd-networkd[525]: usb0: Gained carrier
>> systemd-networkd[525]: usb0: Gained IPv6LL
>> systemd-networkd[525]: usb0: Lost carrier
>> systemd-networkd[525]: usb0: Gained carrier
>> systemd-networkd[525]: usb0: Gained IPv6LL
>> systemd-networkd[525]: usb0: Lost carrier

With 5.10-rc1 booting in host mode, then switching to gadget lost 
carrier (after 30 dec.) happens only once, then comes back and stays:

root@edison:~# journalctl -b -1 | grep usb0
Oct 27 22:36:52 edison kernel: usb0: HOST MAC aa:bb:cc:dd:ee:f2
Oct 27 22:36:52 edison kernel: usb0: MAC aa:bb:cc:dd:ee:f1
Oct 27 22:36:52 edison kernel: IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link 
becomes ready
Oct 27 22:36:52 edison systemd-networkd[527]: usb0: Gained carrier
Oct 27 22:36:54 edison systemd-networkd[527]: usb0: Gained IPv6LL
Oct 27 22:37:25 edison systemd-networkd[527]: usb0: Lost carrier
Oct 27 22:37:26 edison kernel: IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link 
becomes ready
Oct 27 22:37:26 edison systemd-networkd[527]: usb0: Gained carrier
Oct 27 22:37:27 edison systemd-networkd[527]: usb0: Gained IPv6LL

Booting in gadget mode sequence of event is defferent:
root@edison:~# journalctl -b | grep usb0
Oct 27 22:58:54 edison kernel: usb0: HOST MAC aa:bb:cc:dd:ee:f2
Oct 27 22:58:54 edison kernel: usb0: MAC aa:bb:cc:dd:ee:f1
Oct 27 22:58:57 edison systemd-networkd[543]: usb0: Gained IPv6LL
Oct 27 22:58:57 edison systemd-networkd[543]: usb0: Lost carrier
Oct 27 22:58:57 edison systemd-networkd[543]: usb0: Gained carrier


>> Any ideas how to proceed are highly welcomed!
> I suppose you can start with enabling dwc3 trace events and try to see
> what's going on from the gadget side. Please refer to
> Documentation/driver-api/usb/dwc3.rst **Reporting Bugs**
I'll try to get something meaningful here
> Also what happens if you enable the network, sound and mass storage
> functions individually rather than all at once (assuming you are using
> ConfigFS)?
I haven't tried this yet. I did try disabling sound entirely but that 
made no difference.
> Jack

  reply index

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 20:21 Ferry Toth
2020-10-19  5:45 ` Felipe Balbi
2020-10-19  7:14   ` Ferry Toth
2020-10-19 18:49     ` Ferry Toth
2020-10-20 12:35       ` Felipe Balbi
2020-10-20 21:01         ` Ferry Toth
2020-10-19  7:18   ` Ferry Toth
2020-10-20 12:32     ` Felipe Balbi
2020-10-20 19:46       ` Ferry Toth
2020-10-20 20:37       ` Ferry Toth
2020-10-20 22:10         ` Thinh Nguyen
2020-10-20 22:58           ` Thinh Nguyen
2020-10-21  1:47             ` Jack Pham
2020-10-21  1:56               ` Thinh Nguyen
2020-10-21 20:01                 ` Ferry Toth
2020-10-22  9:23               ` Andy Shevchenko
2020-10-21 19:45             ` Ferry Toth
2020-10-21 19:50               ` Thinh Nguyen
2020-10-21 20:42                 ` Ferry Toth
2020-10-21 23:32                   ` Thinh Nguyen
2020-10-22 13:43                     ` Andy Shevchenko
2020-10-27 20:13                       ` Ferry Toth
2020-10-27 21:06                         ` Jack Pham
2020-10-27 22:07                           ` Ferry Toth [this message]
2020-10-27 21:16                         ` Andy Shevchenko
2020-10-27 21:54                           ` Ferry Toth
2020-10-28  9:18                             ` Felipe Balbi
2020-11-05 21:29                               ` Ferry Toth
2020-11-06  6:38                                 ` Felipe Balbi
2020-11-06  8:14                                   ` Ferry Toth
     [not found]                                   ` <326aa23e-fabd-f3d6-4778-d036858413a2@gmail.com>
2020-11-06 14:15                                     ` Felipe Balbi
     [not found]                                       ` <e21a5a77-9017-4cbe-a228-85357d660da5@gmail.com>
2020-11-07  8:01                                         ` Felipe Balbi
2020-11-07 13:37                                           ` Ferry Toth
2020-11-09  7:00                                             ` Felipe Balbi
2020-10-27 21:19                         ` Andy Shevchenko
2020-10-19 19:46   ` Andy Shevchenko
2020-10-19 20:46     ` Ferry Toth
2020-10-20 13:27     ` Andy Shevchenko

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=8d14735a-d8ff-da78-b93f-c80b1c3307c3@gmail.com \
    --to=fntoth@gmail.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=balbi@kernel.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jackp@codeaurora.org \
    --cc=linux-usb@vger.kernel.org \
    /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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git