From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.13 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796309012; b=hHudrV5ZnGMwq/hde1uUmsllg/kAGobD934qUqV2MrkaYAeCzij0bbZ64gug5uLqXnCA cdbUiTIhYUEuVUYsKN+CO0iU3GIMXcakhlC9D+O+0BFC8AqkkU5yw35B9u+CWknzWC7mW lFWS5XkLEmEPhm/iaycn20Xvy/iHUCkHV+Or6lyZw1aZ7ig4xFsNc206MVyOk7GFLoxNl NyPPnt0qIN/lzQMa44TSoaIw73t8RIuDiqoScj5fnbzAl9nvIgLBXB3wSCgA6mAGi60w4 SJ56RyG+m3ojvwuUM/ynBus92U8+s64e+raB2yj1rEPwdjUdN8B+uZ20dysdvmqHLuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796309012; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=SFzhbEROnqadlZt5sC1Y7pni2SJJ0R9KlbhKiwwceW0=; b=lWc04MBJWkHDAmv62Im8br/yncC/ebfcKT43L1kGCUJAsLpBQY29onrP1Ev1agOldh9K DhPWbiTN7joFcEi9Zwa9h4cOILnYce/wuAK0dNJDm9jEq5+m80oWhkB+3H38FGMU9FPNZ rrqhPhZmS6EPi7t6CicDXdb6k8QJ4FF0FTjoNsUwd4hZbV7ajRUTSzESVmJChTYkLjTyk AdiPDjx1PuZglTQhH9wcGaUI67JRSzrjss0TG0+JR1/ST55PAlqabhkWsKe53R6mUwHoe 9HARycXAfVagcuPnvIYK4xAiGiEOzwgb1UgkE10Zc2VHGuTNEpMfgsCV3sYLCPbzmng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=d9na1Yh+; arc=none smtp.remote-ip=198.175.65.13 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BD8E606A33E for ; Thu, 3 Dec 2026 14:43:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3BD8E606A33E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=d9na1Yh+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796309012; x=1827845012; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SFzhbEROnqadlZt5sC1Y7pni2SJJ0R9KlbhKiwwceW0=; b=d9na1Yh+k2TZM3ljm748F+IS1eIlH2ZJVfrdvXlo3txm7jb444rGzJoG 1EWDvpZ9PtCY8O0kRA4abFx+/dNNsoMrvI+PoqkbQjlJNt0wcfY4lHU3V iHCPnFclKca8hoLpj70vz9mCnv2dqqBmcuHqS14YK4JHPVNPXoTtQVAmn jFkE4Kk1cMW6cvVOBza/IVlh4+5qCx95q+qM25hAjEz1KC6oLA1o+6DoG NY1CO/G8S0DAb9GK2MU4Nv7IQLQueywz3rOyA9YUJTew6kscNinGgF/bc 26WRnz7kR9yOHMBzzIhrGV9xdC0f9+8fAwIDfQ3meZx4WwzjLXVwhWoXT A==; X-CSE-ConnectionGUID: h4+ykc75T2239SokorvKOg== X-CSE-MsgGUID: nCum4f20TbCgdgXHO+GgOw== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5182635" X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="5182635" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 06:43:32 -0800 X-CSE-ConnectionGUID: UVARIUbUTimo+aYktrybRw== X-CSE-MsgGUID: 4HON6UiZTUOWm2llfVt1JA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="14024147" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa001.jf.intel.com with ESMTP; 03 Dec 2026 06:43:32 -0800 Received: by black.igk.intel.com (Postfix, from userid 1058) id 90B1399; Thu, 03 Dec 2026 15:43:30 +0100 (CET) From: Niklas Neronin To: mathias.nyman@linux.intel.com Cc: linux-usb@vger.kernel.org, Niklas Neronin Subject: [PATCH v3 11/12] usb: xhci: update port register bitfield comments for consistency Date: Thu, 3 Dec 2026 15:42:43 +0100 Message-ID: <20261203144244.1680587-12-niklas.neronin@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261203144244.1680587-1-niklas.neronin@linux.intel.com> References: <20261203144244.1680587-1-niklas.neronin@linux.intel.com> X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update comments in xhci-port.h to improve readability and ensure a consistent format across all Port Register bit fields. Each field comment now includes the bit range and the field name and its valid value range or meaning where applicable: /* - , */ The updates are based on the xHCI specification, revision 1.2. While at it: - move PORT_CHANGE_MASK below the PORTSC bit definitions - fix the XHCI_DEFAULT_BESL location reference in xhci.c, the macro is defined in xhci-port.h No functional change. Signed-off-by: Niklas Neronin --- drivers/usb/host/xhci-port.h | 65 ++++++++++++++++++++---------------- drivers/usb/host/xhci.c | 2 +- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/drivers/usb/host/xhci-port.h b/drivers/usb/host/xhci-port.h index c0a23caad40e..3cb28394be3f 100644 --- a/drivers/usb/host/xhci-port.h +++ b/drivers/usb/host/xhci-port.h @@ -1,17 +1,21 @@ /* SPDX-License-Identifier: GPL-2.0 */ +/* + * xHCI Host Controller USB Port Register Set + * xHCI Specification Section 5.4, Revision 1.2. + */ #include #include -/* PORTSC - Port Status and Control Register - port_status_base bitmasks */ -/* true: device connected */ +/* Port Status and Control (PORTSC) 5.4.8 */ +/* bit 0 - Current Connect Status */ #define PORT_CONNECT BIT(0) -/* true: port enabled */ +/* bit 1 - Port Enabled/Disabled */ #define PORT_PE BIT(1) -/* bit 2 reserved and zeroed */ -/* true: port has an over-current condition */ +/* bit 2 - RsvdZ */ +/* bit 3 - Over-current Active */ #define PORT_OC BIT(3) -/* true: port reset signaling asserted */ +/* bit 4 - Port Reset */ #define PORT_RESET BIT(4) /* * bits 8:5 - Port Link State, by default '5'. @@ -33,7 +37,7 @@ #define PLS_TEST_MODE 11 /* Values 12-14 are Reserved */ #define PLS_RESUME 15 -/* true: port has power (see HCC_PPC) */ +/* bit 9 - Port Power, see HCC_PPC */ #define PORT_POWER BIT(9) /* * bits 13:10 - Port Speed @@ -60,23 +64,26 @@ #define PIC_OFF 0 #define PIC_AMBER 1 #define PIC_GREEN 2 -/* Port Link State Write Strobe - set this when changing link state */ +/* bit 16 - Port Link State Write Strobe, set this when changing link state */ #define PORT_LINK_STROBE BIT(16) -/* true: connect status change */ +/* bit 17 - Connect Status Change */ #define PORT_CSC BIT(17) -/* true: port enable change */ +/* bit 18 - Port Enabled/Disabled Change */ #define PORT_PEC BIT(18) -/* true: warm reset for a USB 3.0 device is done. A "hot" reset puts the port +/* + * bit 19 - Warm Port Reset Change + * Warm reset for a USB 3.0 device is done. A "hot" reset puts the port * into an enabled state, and the device into the default state. A "warm" reset * also resets the link, forcing the device through the link training sequence. * SW can also look at the Port Reset register to see when warm reset is done. */ #define PORT_WRC BIT(19) -/* true: over-current change */ +/* bit 20 - Over-current Change */ #define PORT_OCC BIT(20) -/* true: reset change - 1 to 0 transition of PORT_RESET */ +/* bit 21 - Port Reset Change */ #define PORT_RC BIT(21) -/* port link status change - set on some port link state transitions: +/* + * bit 22 - Port Link State Change, set on some port link state transitions: * Transition Reason * ------------------------------------------------------------------------------ * - U3 to Resume Wakeup signaling from a device @@ -90,28 +97,27 @@ * - Any state to inactive Error on USB 3.0 port */ #define PORT_PLC BIT(22) -/* port configure error change - port failed to configure its link partner */ +/* bit 23 - Port Config Error Change, port failed to configure its link partner */ #define PORT_CEC BIT(23) -#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ - PORT_RC | PORT_PLC | PORT_CEC) - - -/* Cold Attach Status - xHC can set this bit to report device attached during - * Sx state. Warm port reset should be perfomed to clear this bit and move port - * to connected state. +/* + * bit 24 - Cold Attach Status + * xHC can set this bit to report device attached during Sx state. + * Warm port reset should be perfomed to clear this bit and move port to connected state. */ #define PORT_CAS BIT(24) -/* wake on connect (enable) */ +/* bit 25 - Wake on Connect Enable */ #define PORT_WKCONN_E BIT(25) -/* wake on disconnect (enable) */ +/* bit 26 - Wake on Disconnect Enable */ #define PORT_WKDISC_E BIT(26) -/* wake on over-current (enable) */ +/* bit 27 - Wake on Over-current Enable */ #define PORT_WKOC_E BIT(27) -/* bits 28:29 reserved */ -/* true: device is non-removable - for USB 3.0 roothub emulation */ +/* bits 29:28 - RsvdZ */ +/* bit 30 - Device Removable, for USB 3.0 roothub emulation */ #define PORT_DEV_REMOVE BIT(30) -/* Initiate a warm port reset - complete when PORT_WRC is '1' */ +/* bit 31 - Warm Port Reset, complete when PORT_WRC is '1' */ #define PORT_WR BIT(31) +#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ + PORT_RC | PORT_PLC | PORT_CEC) /* We mark duplicate entries with -1 */ #define DUPLICATE_ENTRY ((u8)(-1)) @@ -188,7 +194,8 @@ #define PORT_BESLD_MASK GENMASK(13, 10) /* bits 31:14 - RsvdP */ -/* Set default HIRD/BESL value to 4 (350/400us) for USB2 L1 LPM resume latency. +/* + * Set default HIRD/BESL value to 4 (350/400us) for USB2 L1 LPM resume latency. * Safe to use with mixed HIRD and BESL systems (host and device) and is used * by other operating systems. * diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index c9a68c42d769..5837ec9fb495 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4710,7 +4710,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, if (udev->usb2_hw_lpm_besl_capable) { /* if device doesn't have a preferred BESL value use a * default one which works with mixed HIRD and BESL - * systems. See XHCI_DEFAULT_BESL definition in xhci.h + * systems. See XHCI_DEFAULT_BESL definition in xhci-port.h */ field = le32_to_cpu(udev->bos->ext_cap->bmAttributes); if ((field & USB_BESL_SUPPORT) && -- 2.50.1