[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<JH0PR06MB7294B8050FBFF1AE9E954CA58391A@JH0PR06MB7294.apcprd06.prod.outlook.com>
Date: Wed, 14 May 2025 13:51:46 +0000
From: "Chen, Jay" <jay.chen@...mens.com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: "mathias.nyman@...el.com" <mathias.nyman@...el.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Shao, Tzi
Yang" <tziyang.shao@...mens.com>
Subject: RE: [PATCH] usb: xhci: Set avg_trb_len = 8 for EP0 during Address
Device
Hi Greg,
> "please feel free to respond to this email"
I apologize for the wrong patch format due to using Outlook instead of "git send-email" (Since I don't have SMTP permission from my workplace)
I use the personal Gmail SMTP service, and the "git send-email" works. I hope the new patch format is correct this time.
Thanks for the notification.
Link: https://lore.kernel.org/linux-usb/20250514134011.16285-1-shawn2000100@gmail.com/T/#u
-----Original Message-----
From: gregkh@...uxfoundation.org <gregkh@...uxfoundation.org>
Sent: Wednesday, May 14, 2025 3:31 PM
To: Chen, Jay (DI SW EDA DVT RD IN AVE US3) <jay.chen@...mens.com>
Cc: mathias.nyman@...el.com; linux-usb@...r.kernel.org; linux-kernel@...r.kernel.org; Shao, Tzi Yang (DI SW EDA DVT RD IN AVE US3) <tziyang.shao@...mens.com>
Subject: Re: [PATCH] usb: xhci: Set avg_trb_len = 8 for EP0 during Address Device
On Tue, May 13, 2025 at 09:07:00AM +0000, Chen, Jay wrote:
> From fef893bcf0add89795b85bcc1f6bdae537f1dabe Mon Sep 17 00:00:00 2001
> From: "jay.chen" <jay.chen@...mens.com>
> Date: Tue, 13 May 2025 15:03:44 +0800
> Subject: [PATCH] usb: xhci: Set avg_trb_len = 8 for EP0 during Address
> Device Command
>
> According to the xHCI 1.2 spec (Section 6.2.3, p.454), the Average TRB
> Length (avg_trb_len) for control endpoints should be set to 8.
>
> Currently, during the Address Device Command, EP0's avg_trb_len
> remains 0, which may cause some xHCI hardware to reject the Input
> Context, resulting in device enumeration failures. In extreme cases,
> using a zero avg_trb_len in calculations may lead to division-by-zero
> errors and unexpected system crashes.
>
> This patch sets avg_trb_len to 8 for EP0 in
> xhci_setup_addressable_virt_dev(), ensuring compliance with the spec
> and improving compatibility across various host controller implementations.
>
> Link:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz
> illa.kernel.org%2Fshow_bug.cgi%3Fid%3D220033&data=05%7C02%7Cjay.chen%4
> 0siemens.com%7C8c69c430bc974734f7cd08dd92b996e9%7C38ae3bcd95794fd4adda
> b42e1495d55a%7C1%7C0%7C638828048066001944%7CUnknown%7CTWFpbGZsb3d8eyJF
> bXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbC
> IsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=0ztK%2BsfvEt4fhgVTfKkUydU3Z6zj%2
> BWWKIFpeEoOU9ck%3D&reserved=0
> Signed-off-by: jay.chen <jay.chen@...mens.com>
> ---
> drivers/usb/host/xhci-mem.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index d698095fc88d..fed9e9d1990c 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -1166,6 +1166,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
> ep0_ctx->deq = cpu_to_le64(dev->eps[0].ring->first_seg->dma |
> dev->eps[0].ring->cycle_state);
>
> + ep0_ctx->tx_info |= cpu_to_le32(EP_AVG_TRB_LENGTH(8));
> +
> trace_xhci_setup_addressable_virt_device(dev);
>
> /* Steps 7 and 8 were done in xhci_alloc_virt_device() */
> --
> 2.43.5
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- Your patch is malformed (tabs converted to spaces, linewrapped, etc.)
and can not be applied. Please read the file,
Documentation/process/email-clients.rst in order to fix this.
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
Powered by blists - more mailing lists