linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ferry Toth <fntoth@gmail.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Felipe Balbi <balbi@kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"
Date: Mon, 10 Oct 2022 14:40:30 -0700	[thread overview]
Message-ID: <CAHQ1cqG73UAoU=ag9qSuKdp+MzT9gYJcwGv8k8BOa=e8gWwzSg@mail.gmail.com> (raw)
In-Reply-To: <Y0PFZGLaREQUazVP@smile.fi.intel.com>

On Mon, Oct 10, 2022 at 12:13 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Sun, Oct 09, 2022 at 10:02:26PM -0700, Andrey Smirnov wrote:
> > On Fri, Oct 7, 2022 at 6:07 AM Ferry Toth <fntoth@gmail.com> wrote:
>
> Thank you for the testing on your side!
>
> ...
>
> > OK, Ferry, I think I'm going to need clarification on specifics on
> > your test setup. Can you share your kernel config, maybe your
> > "/proc/config.gz", somewhere? When you say you are running vanilla
> > Linux, do you mean it or do you mean vanilla tree + some patch delta?
> >
> > The reason I'm asking is because I'm having a hard time reproducing
> > the problem on my end. In fact, when I build v6.0
> > (4fe89d07dcc2804c8b562f6c7896a45643d34b2f) and then do a
> >
> > git revert 8bd6b8c4b100 0f0101719138 (original revert proposed by Andy)
> >
> > I get an infinite loop of reprobing that looks something like (some
> > debug tracing, function name + line number, included):
>
> Yes, this is (one of) known drawback(s) of deferred probe hack. I think
> the kernel that Ferry runs has a patch that basically reverts one from
> 2014 [1] and allows to have extcon as a module. (1)
>
> [1]: 58b116bce136 ("drivercore: deferral race condition fix")
>
> > which renders the system completely unusable, but USB host is
> > definitely going to be broken too. Now, ironically, with my patch
> > in-place, an attempt to probe extcon that ends up deferring the probe
> > happens before the ULPI driver failure (which wasn't failing driver
> > probe prior to https://lore.kernel.org/all/20220213130524.18748-7-hdegoede@redhat.com/),
> > there no "driver binding" event that re-triggers deferred probe
> > causing the loop, so the system progresses to a point where extcon is
> > available and dwc3 driver eventually loads.
> >
> > After that, and I don't know if I'm doing the same test, USB host
> > seems to work as expected. lsusb works, my USB stick enumerates as
> > expected. Switching the USB mux to micro-USB and back shuts the host
> > functionality down and brings it up as expected. Now I didn't try to
> > load any gadgets to make sure USB gadget works 100%, but since you
> > were saying it was USB host that was broken, I wasn't concerned with
> > that. Am I doing the right test?
>
> Hmm... What you described above sounds more like a yet another attempt to
> workaround (1). _If_ this is the case, we probably can discuss how to fix
> it in generic way (somewhere in dd.c, rather than in the certain driver).
>

No, I'm not describing an attempt to fix anything. Just how vanilla
v6.0 (where my patch is not reverted) works and where my patch, fixing
a logical problem in which extcon was requested too late causing a
forced OTG -> "gadget only" switch, also changed the ordering enough
to accidentally avoid the loop.

> That said, the real test case should be performed on top of clean kernel
> before judging if it's good or bad.
>

Given your level of involvemnt with this particular platform and you
being the author of
https://github.com/edison-fw/meta-intel-edison/blob/master/meta-intel-edison-bsp/recipes-kernel/linux/files/0043b-TODO-driver-core-Break-infinite-loop-when-deferred-p.patch
I assumed/expected you to double check this before sending this revert
out. Please do so next time.

  reply	other threads:[~2022-10-10 21:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 15:53 [PATCH v2 0/2] usb: dwc3: revert OTG changes for Intel Merrifield Andy Shevchenko
2022-09-27 15:53 ` [PATCH v2 1/2] Revert "USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"" Andy Shevchenko
2022-09-27 15:53 ` [PATCH v2 2/2] Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" Andy Shevchenko
2022-09-29  3:01   ` Andrey Smirnov
2022-09-29  8:47     ` Sven Peter
2022-10-03 21:57   ` Thinh Nguyen
2022-10-04  8:28     ` Andy Shevchenko
2022-10-04 19:14       ` Ferry Toth
2022-10-05  2:12         ` Thinh Nguyen
2022-10-05  2:39           ` Andrey Smirnov
     [not found]             ` <25bc7dbe-f530-298f-f826-087606cf9491@gmail.com>
2022-10-05  8:44               ` Andy Shevchenko
2022-10-05  8:45             ` Ferry Toth
2022-10-06  2:00             ` Thinh Nguyen
     [not found]           ` <2886b82d-a1f6-d288-e8d1-edae54046b4f@gmail.com>
2022-10-06  2:12             ` Thinh Nguyen
2022-10-06 12:28               ` Ferry Toth
2022-10-07  2:11                 ` Thinh Nguyen
2022-10-07 13:07                   ` Ferry Toth
2022-10-10  5:02                     ` Andrey Smirnov
2022-10-10  7:10                       ` Andy Shevchenko
2022-10-10 21:40                         ` Andrey Smirnov [this message]
2022-10-11  9:21                           ` Andy Shevchenko
2022-10-11  9:36                             ` Ferry Toth
2022-10-11 20:17                             ` Andrey Smirnov
2022-10-12 10:32                               ` Andy Shevchenko
2022-10-12 22:13                                 ` Andrey Smirnov
2022-10-10 11:04                       ` Ferry Toth
2022-10-10 20:52                         ` Ferry Toth
2022-10-10 21:35                           ` Andrey Smirnov
2022-10-11 18:38                             ` Ferry Toth
2022-10-11 20:50                               ` Andrey Smirnov
2022-10-12  9:30                                 ` Ferry Toth
2022-10-12 20:34                                   ` Ferry Toth
2022-10-12 21:43                                   ` Andrey Smirnov
2022-10-13 19:35                                     ` Ferry Toth
2022-10-15 19:54                                       ` Andrey Smirnov
2022-10-16 20:59                                         ` Ferry Toth
2022-10-17 19:44                                           ` Steev Klimaszewski
2022-10-17 21:20                                           ` Andrey Smirnov
2022-10-18 20:47                                             ` Ferry Toth
2022-10-20 19:55                                               ` Ferry Toth
2022-10-17 21:29 ` [PATCH v2 0/2] usb: dwc3: revert OTG changes for Intel Merrifield Andrey Smirnov
2022-10-17 22:20   ` [PATCH v2 2/2] Revert "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" Steev Klimaszewski
2022-10-17 22:22   ` [PATCH v2 0/2] usb: dwc3: revert OTG changes for Intel Merrifield Thinh Nguyen
2022-10-17 23:12     ` 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='CAHQ1cqG73UAoU=ag9qSuKdp+MzT9gYJcwGv8k8BOa=e8gWwzSg@mail.gmail.com' \
    --to=andrew.smirnov@gmail.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=balbi@kernel.org \
    --cc=fntoth@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@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
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).