From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796309975; b=3gP4KjNTuBeuq3tmHXYiK0ud/pUBGN4nkICt8b7XVnrEmY+Vv7v0WQ6MuozF59o4SZuY mRJtPUK+ptrFqr+kNVdQ5Z+Kz6AU4NFpBhg6aQAlX1+/tYJeEUq8uadhGO3sh0sCMC7Hd IBiamdq5TKObpQHMQUqH4d9MtLW0ui6z4veEG3vXn+pV5RG0dvVGgmv/7JPgMghhGmoMD PpqP56UainJaYANbRfQCBqA2SxpjccFvfXwTjZ+HZ6ZsZU79DLwXxolpC0Blt7KwwFpPd KBhGI3ktfWCmiCQ3QVHFOkz71/X3w2HFzeu810yh6JKbDmwOt0uPXJzUxXH+srY932Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796309975; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=rUQaJZ7JmhdQC9DNv2JXRI4i5vrvhZRPFN+mcWQLJPE=; b=X7aIDIsSaGgteitw4Tv+buC5Wb/1Bee8k+1W2f+yAK5bSdYpLMuSAwdnvvjbh8aMQfIh i25NC8F3Ws8kdN8PE/ncFgAYtvat1wponOF1v/c1P8O8O8X6M38OPYJIkChy9PomHH/K5 0I/cxH38q3M5pKa79juaN6nmhze+ApUDfk/JaDv7Oyw43iZ99edspIRM7mzpP+b7CcTzZ DIOsHJ6TXeQTDts+mQ0iHtaVCzbfx/VoW8gsxb7W8o1CB2ccpfu8pSY50yZNuUWnRafGb yKpQ70QSnwRpT9Ha5hvb6i3CWDyQrUQFlI23EzYdwPgo1HRvhslPBznlooYn4EMjPzQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mnKIdCd7; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F73160A6F75 for ; Thu, 3 Dec 2026 14:59:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mnKIdCd7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5586A1F00935; Thu, 3 Dec 2026 14:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796309975; bh=rUQaJZ7JmhdQC9DNv2JXRI4i5vrvhZRPFN+mcWQLJPE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=mnKIdCd7aK+08zBltLz93RvZSkg87IB3b34GVoQ7k+dZOQJl/OSK/2fRheCVfhIIj XOYVtgedtwoZ9+rqbludp5i72OArk02EMfdDkv2WLuVE6uQpe3bBRgMOwF8NLQ5Hqh 1xJrfXsKvgs6SwnvSGqYl6iccDj6RtCTXDr5bg4U7YQk5GuC59/4SxqfUut5iTvEbc RmDT0E+m28wJp0H8ErcdLsh79vM+kG9zK9JBMnxTYBylkcWtaMwQv7WBe2wl59T+6J hAMGMb4s101MF8aLbQ0xUmeHOyA7R7V3RWed3D7a8tSdC3+Fl/bnyS5qysPFp2cKvz MVTRiY5Wi/teQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 03/12] usb: xhci: rework Port Link State macros Reply-To: sashiko-reviews@lists.linux.dev To: "Niklas Neronin" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261203144244.1680587-4-niklas.neronin@linux.intel.com> References: <20261203144244.1680587-1-niklas.neronin@linux.intel.com> <20261203144244.1680587-4-niklas.neronin@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 14:59:34 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] usb: xhci: redundant FIELD_GET(PORT_PLS_MASK) calls in handle_port_status() -- commit ee9d70e142f86a51d9ccfe785b68150e454c910c Author: Niklas Neronin usb: xhci: rework Port Link State macros This commit replaces the pre-shifted XDEV_* Port Link State macros with unshifted PLS_* values defined against GENMASK(8, 5), and updates callers to use FIELD_GET() and FIELD_MODIFY(). > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c > index 676f71d8305b1..8117e7fe8da2f 100644 > --- a/drivers/usb/host/xhci-ring.c > +++ b/drivers/usb/host/xhci-ring.c > @@ -2112,7 +2112,7 @@ static void handle_port_status(struct xhci_hcd *xhc= i, union xhci_trb *event) > bus_state =3D &port->rhub->bus_state; > hcd_portnum =3D port->hcd_portnum; > portsc =3D xhci_portsc_readl(port); > - pls =3D portsc & PORT_PLS_MASK; > + pls =3D FIELD_GET(PORT_PLS_MASK, portsc); > =20 > xhci_dbg(xhci, "Port change event, %d-%d, id %d, portsc: 0x%x\n", > hcd->self.busnum, hcd_portnum + 1, port_id, portsc); > @@ -2129,11 +2129,12 @@ static void handle_port_status(struct xhci_hcd *x= hci, union xhci_trb *event) > * Link status is not relible while port is in reset. > */ > if (!(portsc & PORT_RESET)) { > - port->link_inactive =3D (pls =3D=3D XDEV_INACTIVE); > + port->link_inactive =3D (pls =3D=3D PLS_INACTIVE); > port->connected =3D !!(portsc & PORT_CONNECT); > } > =20 > - if ((portsc & PORT_PLC) && (portsc & PORT_PLS_MASK) =3D=3D XDEV_RESUME)= { > + pls =3D FIELD_GET(PORT_PLS_MASK, portsc); > + if ((portsc & PORT_PLC) && pls =3D=3D PLS_RESUME) { > xhci_dbg(xhci, "port resume event for port %d\n", port_id); > =20 > cmd_reg =3D readl(&xhci->op_regs->command); [ ... ] > @@ -2174,11 +2175,9 @@ static void handle_port_status(struct xhci_hcd *xh= ci, union xhci_trb *event) > } > } > =20 > - if ((portsc & PORT_PLC) && > - FIELD_GET(PORT_SPEED_MASK, portsc) >=3D PORT_SPEED_SS && > - ((portsc & PORT_PLS_MASK) =3D=3D XDEV_U0 || > - (portsc & PORT_PLS_MASK) =3D=3D XDEV_U1 || > - (portsc & PORT_PLS_MASK) =3D=3D XDEV_U2)) { > + pls =3D FIELD_GET(PORT_PLS_MASK, portsc); > + if ((portsc & PORT_PLC) && pls <=3D PLS_U2 && > + FIELD_GET(PORT_SPEED_MASK, portsc) >=3D PORT_SPEED_SS) { [Severity: Low] Are these two extra pls =3D FIELD_GET(PORT_PLS_MASK, portsc) assignments needed? handle_port_status() already extracts pls right after reading portsc, and neither portsc nor pls is modified afterwards, so repeating the extraction can mislead readers into thinking portsc was re-read from hardware. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203144244.1680= 587-1-niklas.neronin@linux.intel.com?part=3D3