Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Niklas Neronin" <niklas.neronin@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v3 05/12] usb: xhci: rework USB3 PORTPMSC macros
Date: Thu, 03 Dec 2026 14:50:36 +0000	[thread overview]
Message-ID: <sashiko-outbox-248018@kernel.org> (raw)
In-Reply-To: <20261203144244.1680587-6-niklas.neronin@linux.intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] usb: xhci: PORTPMSC comments omit reserved values claimed in
  commit message
--

commit 566b043ef88e37f2c0ec0cdfe002e8e9bd68833e
Author: Niklas Neronin <niklas.neronin@linux.intel.com>

usb: xhci: rework USB3 PORTPMSC macros

This commit replaces PORT_U1_TIMEOUT() and PORT_U2_TIMEOUT() with
GENMASK() masks and FIELD_MODIFY(), and updates the USB3 PORTPMSC
register comments in xhci-port.h.

> - document the valid, reserved and infinite U1/U2 Timeout values

[ ... ]

> diff --git a/drivers/usb/host/xhci-port.h b/drivers/usb/host/xhci-port.h
> index 40e403a46b20e..fc87d4cacfbe5 100644
> --- a/drivers/usb/host/xhci-port.h
> +++ b/drivers/usb/host/xhci-port.h
> @@ -116,16 +116,19 @@
>  /* We mark duplicate entries with -1 */
>  #define DUPLICATE_ENTRY ((u8)(-1))
>  
> -/* Port Power Management Status and Control - port_power_base bitmasks */
> -/* Inactivity timer value for transitions into U1, in microseconds.
> - * Timeout can be up to 127us.  0xFF means an infinite timeout.
> +/* USB3 Port Power Management Status and Control (PORTPMSC) 5.4.9.1 */
> +/*
> + * bits 7:0 - U1 Timeout, inactivity timer value for transitions into U1.
> + * Timeout can be 0 to 127us, in 1us increments and 0xff is infinite timeout.
> + */
> +#define PORT_U1_TIMEOUT_MASK	GENMASK(7, 0)
> +/*
> + * bits 15:8 - U2 Timeout, inactivity timer value for transitions into U2.
> + * Timeout can be 0 to 65024us, in 256us increments and 0xff is infinite timeout.
>   */
> -#define PORT_U1_TIMEOUT(p)	((p) & 0xff)
> -#define PORT_U1_TIMEOUT_MASK	0xff
> -/* Inactivity timer value for transitions into U2 */
> -#define PORT_U2_TIMEOUT(p)	(((p) & 0xff) << 8)
> -#define PORT_U2_TIMEOUT_MASK	(0xff << 8)
> -/* Bits 24:31 for port testing */
> +#define PORT_U2_TIMEOUT_MASK	GENMASK(15, 8)

[Severity: Low]
The commit message says the comments document the reserved U1/U2 Timeout
values, but neither comment mentions reserved values.  In xHCI 5.4.9.1,
values 0x80 to 0xfe are reserved for U1 Timeout, while U2 Timeout has no
reserved encodings since 0x00 through 0xfe cover 0 to 65024us.

Should the U1 Timeout comment note that 0x80 to 0xfe are reserved, or
should the commit message be updated to match the comments?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203144244.1680587-1-niklas.neronin@linux.intel.com?part=5

  reply	other threads:[~2026-12-03 14:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 14:42 [PATCH v3 00/12] usb: xhci: rework xHCI Port macros Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 01/12] usb: xhci: use BIT() for single bit port register flags Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 02/12] usb: xhci: rework Port Speed macros Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 03/12] usb: xhci: rework Port Link State macros Niklas Neronin
2026-12-03 14:59   ` sashiko-bot
2026-12-03 14:42 ` [PATCH v3 04/12] usb: xhci: rework Port Indicator Control macro Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 05/12] usb: xhci: rework USB3 PORTPMSC macros Niklas Neronin
2026-12-03 14:50   ` sashiko-bot [this message]
2026-12-03 14:42 ` [PATCH v3 06/12] usb: xhci: rework USB2 " Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 07/12] usb: xhci: rework USB3 PORTLI macros Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 08/12] usb: xhci: rework USB2 " Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 09/12] usb: xhci: document USB3 PORTHLPMC register layout Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 10/12] usb: xhci: rework USB2 PORTHLPMC macros Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 11/12] usb: xhci: update port register bitfield comments for consistency Niklas Neronin
2026-12-03 14:42 ` [PATCH v3 12/12] usb: xhci: rename PORTSC field macros to xHCI spec abbreviations Niklas Neronin
2026-12-03 14:54   ` sashiko-bot
2026-12-03 14:59 ` [PATCH v3 00/12] usb: xhci: rework xHCI Port macros sashiko-bot

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=sashiko-outbox-248018@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=niklas.neronin@linux.intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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