All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Hardik Gajjar <hgajjar@de.adit-jv.com>,
	mathias.nyman@intel.com, yangyingliang@huawei.com,
	jinpu.wang@ionos.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, erosca@de.adit-jv.com
Subject: Re: [PATCH v4] usb: core: hub: Add quirks for reducing device address timeout
Date: Sat, 21 Oct 2023 12:15:35 +0200	[thread overview]
Message-ID: <2023102105-attribute-pajamas-a0dc@gregkh> (raw)
In-Reply-To: <6c25beed-06fe-4be0-b51a-18e159d25072@rowland.harvard.edu>

On Tue, Oct 17, 2023 at 02:59:54PM -0400, Alan Stern wrote:
> On Tue, Oct 17, 2023 at 06:53:44PM +0200, Greg KH wrote:
> > On Tue, Oct 17, 2023 at 06:10:21PM +0200, Hardik Gajjar wrote:
> > > More logs and detailed in patch V1:
> > > https://lore.kernel.org/linux-usb/20230818092353.124658-1-hgajjar@de.adit-jv.com/T/#m452ec9dad94e8181fdb050cd29483dd89437f7c1
> > > > 
> > > > > Achieving this is impossible in scenarios where the set_address is
> > > > > not successful and waits for a timeout.
> > > > 
> > > > Agreed, broken hardware is a pain, but if your device is allowed to take
> > > > longer, it can, and will, so you have to support that.
> > > > 
> > > The problem is not caused by the device taking an extended amount of time to
> > > process the 'set_address' request. Instead, the issue lies in the absence of
> > > any activity on the upstream bus until a timeout occurs.
> > 
> > So, a broken device.  Why are you then adding the hub to the quirk list
> > and not the broken device?  We are used to adding broken devices to
> > qurik lists all the time, this shouldn't be new.
> 
> Adding a quirk for the device isn't feasible, because the problem occurs 
> before the device has been initialized and enumerated.  The kernel 
> doesn't know anything about the device at this point; only that it has 
> just connected.

Ah, ick, you are right, but we do know the "broken hub" id, so that
makes a bit more sense.  Should this be a hub-only type quirk?

> > > This situation arises when the host has already transmitted the 'set_address' command to the hub,
> > > assuming that the device operates at full speed. However, the device connected
> > > to the hub undergoes a state change from full speed to high-speed during this process.
> > 
> > During which process?  While the set-address happens?  That feels like a
> > hub bug then.
> > 
> > > > > The shortened address device timeout quirks provide the flexibility
> > > > > to align with a 3-second time limit in the event of errors.
> > > > > By swiftly triggering a failure response and swiftly initiating
> > > > > retry procedures, these quirks ensure efficient and rapid recovery,
> > > > > particularly in automotive contexts where rapid smartphone enumeration
> > > > > and screen projection are vital.
> > > > 
> > > > Screen projection is a requirement that you should not be relying on USB
> > > > for as USB has a different set of required timeouts, right?  This sounds
> > > > like a bad hardware design, if not an impossible one.
> > > > 
> > > 
> > > Screen projection for us means displaying the connected phone on the screen and
> > > launching Carplay and Android Auto for the user. This works perfectly in nearly all
> > > cases, except in scenarios like this one where a combination of a special hub and
> > > a specific phone model is causing the issue
> > 
> > So which is broken, the hub or phone?
> 
> It sounds like both of them are broken to some extent, although we can't 
> tell for sure without seeing what's actually happening on the USB bus 
> (i.e., bus analyzer output):
> 
> 	The phone seems to take too long to activate its high-speed
> 	terminations and deactivate the full-speed terminations.
> 
> 	The hub doesn't seem to realize that the phone has disconnected 
> 	its full-speed connection and switched to high-speed.
> 
> But without real data, these are just best guesses.

Agreed, Hardik, can you look at some bus traces to figure out where the
root problem here is?

thanks,

greg k-h

  reply	other threads:[~2023-10-21 10:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <--in-reply-to=20231006153808.9758-1-hgajjar@de.adit-jv.com>
2023-10-09 16:14 ` [PATCH v2] usb: core: hub: Add quirks for reducing device address timeout Hardik Gajjar
2023-10-09 17:43   ` Greg KH
2023-10-10 10:31     ` Hardik Gajjar
2023-10-10 11:25       ` Greg KH
2023-10-09 19:16   ` Alan Stern
2023-10-10 10:50     ` Hardik Gajjar
2023-10-10 13:40   ` Mathias Nyman
2023-10-11  8:50     ` [PATCH v3] " Hardik Gajjar
2023-10-11  9:02       ` Greg KH
2023-10-11 12:05         ` Hardik Gajjar
2023-10-11 15:23           ` Greg KH
2023-10-11 16:45             ` [PATCH v4] " Hardik Gajjar
2023-10-16 17:58               ` Greg KH
2023-10-17 16:10                 ` Hardik Gajjar
2023-10-17 16:53                   ` Greg KH
2023-10-17 18:59                     ` Alan Stern
2023-10-21 10:15                       ` Greg KH [this message]
2023-10-23 16:13                         ` Hardik Gajjar
2023-10-24 15:44                           ` Alan Stern
2023-10-25 14:11                             ` [PATCH v5] usb: Reduce 'set_address' command timeout with a new quirk Hardik Gajjar
2023-10-25 14:13                             ` Hardik Gajjar
2023-10-25 14:44                               ` Alan Stern
2023-10-25 16:00                               ` Sergey Shtylyov
2023-10-25 16:16                                 ` Sergey Shtylyov
2023-10-25 16:16                                 ` Sergey Shtylyov
2023-10-25 16:40                                   ` Hardik Gajjar
2023-10-26 10:15                                     ` [PATCH v6] usb: Reduce the 'SET_ADDRESS' request " Hardik Gajjar
2023-10-26 13:08                                       ` Mathias Nyman
2023-10-26 16:00                                       ` Sergey Shtylyov
2023-10-26 18:34                                       ` Alan Stern
2023-10-27  9:57                                         ` Hardik Gajjar
2023-10-27 14:45                                           ` Alan Stern
2023-10-11 10:50       ` [PATCH v3] usb: core: hub: Add quirks for reducing device address timeout kernel test robot
2023-10-11 14:15       ` Alan Stern

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=2023102105-attribute-pajamas-a0dc@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=erosca@de.adit-jv.com \
    --cc=hgajjar@de.adit-jv.com \
    --cc=jinpu.wang@ionos.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=yangyingliang@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.