From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: oushixiong1025@163.com, Mathias Nyman <mathias.nyman@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Shixiong Ou <oushixiong@kylinos.cn>
Subject: Re: [PATCH] usb: xhci: fix maximum event ring segments calculation
Date: Mon, 31 Aug 2026 12:10:40 +0300 [thread overview]
Message-ID: <a03c0f9d-02da-4dae-a17c-83412f24566d@linux.intel.com> (raw)
In-Reply-To: <20260828105926.930033-1-oushixiong1025@163.com>
Hi
On 8/28/26 13:59, oushixiong1025@163.com wrote:
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> Commit 6d45e9556d4a ("usb: xhci: standardize multi bit-field macros")
> converted BIT(HCS_ERST_MAX(hcs_params2)) into
> FIELD_GET(HCS_ERST_MAX, hcs_params2) << 2. The ERST Max field is a
> power-of-two exponent, so the maximum number of segments is 2^n, not
> n * 4.
>
> With an ERST Max of 0 (as reported by e.g. QEMU xHCI) max_segs becomes
> 0, the event ring is allocated with 0 segments, and the resulting
> zero-sized ERST allocation trips the page allocator:
Thanks for the report and fix.
This issue was reported earlier and is address in:
https://lore.kernel.org/linux-usb/7e6648ad-7459-4248-8c6c-227cfc2586d8@linux.intel.com/
That patch is on its way upstream.
Good to get verification the fix (very similar) solves the issue for you as well.
Thanks
Mathias
prev parent reply other threads:[~2026-08-31 9:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 10:59 [PATCH] usb: xhci: fix maximum event ring segments calculation oushixiong1025
2026-08-30 3:12 ` Pierre-David Belanger
2026-08-31 6:55 ` Thorsten Leemhuis
2026-08-31 9:21 ` Mathias Nyman
2026-08-31 11:28 ` Thorsten Leemhuis
2026-08-31 11:36 ` Thorsten Leemhuis
2026-08-31 14:28 ` Mathias Nyman
2026-09-01 8:16 ` Thorsten Leemhuis
2026-08-31 9:10 ` Mathias Nyman [this message]
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=a03c0f9d-02da-4dae-a17c-83412f24566d@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=oushixiong1025@163.com \
--cc=oushixiong@kylinos.cn \
/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