public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Hardik Gajjar <hgajjar@de.adit-jv.com>,
	gregkh@linuxfoundation.org, stern@rowland.harvard.edu,
	mathias.nyman@intel.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	erosca@de.adit-jv.com
Subject: Re: [PATCH v6] usb: Reduce the 'SET_ADDRESS' request timeout with a new quirk
Date: Thu, 26 Oct 2023 16:08:09 +0300	[thread overview]
Message-ID: <e82b71ad-edbf-103f-54fe-80ddc1b2e47e@linux.intel.com> (raw)
In-Reply-To: <20231026101551.36551-1-hgajjar@de.adit-jv.com>

On 26.10.2023 13.15, Hardik Gajjar wrote:
> This patch introduces a new USB quirk,
> USB_QUIRK_SHORT_SET_ADDRESS_REQ_TIMEOUT, which modifies the timeout value
> for the 'SET_ADDRESS' request. The standard timeout for USB request/command
> is 5000 ms, as recommended in the USB 3.2 specification (section 9.2.6.1).
> 
> However, certain scenarios, such as connecting devices through an APTIV
> hub, can lead to timeout errors when the device enumerates as full speed
> initially and later switches to high speed during chirp negotiation.
> 
> In such cases, USB analyzer logs reveal that the bus suspends for
> 5 seconds due to incorrect chirp parsing and resumes only after two
> consecutive timeout errors trigger a hub driver reset.
> 
> Packet(54) Dir(?) Full Speed J(997.100 us) Idle(  2.850 us)
> _______| Time Stamp(28 . 105 910 682)
> _______|_____________________________________________________________Ch0
> Packet(55) Dir(?) Full Speed J(997.118 us) Idle(  2.850 us)
> _______| Time Stamp(28 . 106 910 632)
> _______|_____________________________________________________________Ch0
> Packet(56) Dir(?) Full Speed J(399.650 us) Idle(222.582 us)
> _______| Time Stamp(28 . 107 910 600)
> _______|_____________________________________________________________Ch0
> Packet(57) Dir Chirp J( 23.955 ms) Idle(115.169 ms)
> _______| Time Stamp(28 . 108 532 832)
> _______|_____________________________________________________________Ch0
> Packet(58) Dir(?) Full Speed J (Suspend)( 5.347 sec) Idle(  5.366 us)
> _______| Time Stamp(28 . 247 657 600)
> _______|_____________________________________________________________Ch0
> 
> This 5-second delay in device enumeration is undesirable, particularly
> in automotive applications where quick enumeration is crucial
> (ideally within 3 seconds).
> 
> The newly introduced quirks provide the flexibility to align with a
> 3-second time limit, as required in specific contexts like automotive
> applications.
> 
> By reducing the 'SET_ADDRESS' request timeout to 500 ms, the
> system can respond more swiftly to errors, initiate rapid recovery, and
> ensure efficient device enumeration. This change is vital for scenarios
> where rapid smartphone enumeration and screen projection are essential.
> 
> To use the quirk, please write "vendor_id:product_id:p" to
> /sys/bus/usb/drivers/hub/module/parameter/quirks
> 
> For example,
> echo "0x2c48:0x0132:p" > /sys/bus/usb/drivers/hub/module/parameters/quirks"
> 
> Signed-off-by: Hardik Gajjar <hgajjar@de.adit-jv.com>
> ---

For the xhci parts:

Reviewed-by: Mathias Nyman <mathias.nyman@linux.intel.com>

  reply	other threads:[~2023-10-26 13:09 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
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 [this message]
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=e82b71ad-edbf-103f-54fe-80ddc1b2e47e@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=erosca@de.adit-jv.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hgajjar@de.adit-jv.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.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