Skip to content

usb: xhci: rework xHCI Port macros

Niklas Neronin linux-usb 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 0 repliesNew
  2. v122 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20usb: xhci: replace bit shifts with the BIT() macro in xhci-port.hdrivers/usb/host/xhci-port.h+23 -210 replies
2/20usb: xhci: rework Port Speed macrosdrivers/usb/host/xhci-debugfs.c drivers/usb/host/xhci-hub.c drivers/usb/host/xhci-port.h +3 more+47 -410 replies
3/20usb: xhci: rework Port Link State macrosdrivers/usb/host/xhci-debugfs.c drivers/usb/host/xhci-hub.c drivers/usb/host/xhci-pci.c +5 more+63 -610 replies
4/20usb: xhci: replace old Port macro prefixdrivers/usb/host/xhci-debugfs.c drivers/usb/host/xhci-hub.c drivers/usb/host/xhci-pci.c +5 more+110 -1100 replies
5/20usb: xhci: rework Port Indicator Control macrodrivers/usb/host/xhci-port.h+5 -50 replies
6/20usb: xhci: rework USB3 PORTPMSC macrosdrivers/usb/host/xhci-hub.c drivers/usb/host/xhci-port.h+16 -130 replies
7/20usb: xhci: rework USB2 PORTPMSC macrosdrivers/usb/host/xhci-hub.c drivers/usb/host/xhci-port.h drivers/usb/host/xhci.c+24 -150 replies
8/20usb: xhci: rework USB3 PORTLI macrosdrivers/usb/host/xhci-debugfs.c drivers/usb/host/xhci-hub.c drivers/usb/host/xhci-port.h+14 -80 replies
9/20usb: xhci: rework USB2 PORTLI macrosdrivers/usb/host/xhci-debugfs.c drivers/usb/host/xhci-port.h+9 -50 replies
10/20usb: xhci: document USB3 PORTHLPMC register layoutdrivers/usb/host/xhci-port.h+4 -00 replies
11/20usb: xhci: rework USB2 PORTHLPMC macrosdrivers/usb/host/xhci-port.h drivers/usb/host/xhci.c+13 -70 replies
12/20usb: xhci: update port register bitfield comments for consistencydrivers/usb/host/xhci-port.h drivers/usb/host/xhci.c+36 -290 replies
13/20usb: xhci: rename port register macros to xHCI spec abbreviationsdrivers/usb/dwc3/host.c drivers/usb/early/xhci-dbc.c drivers/usb/host/xhci-debugfs.c +7 more+96 -960 replies
14/20usb: xhci: replace magic numbers with Port macrosdrivers/usb/host/xhci-hub.c+8 -60 replies
15/20usb: xhci: update PORTSC aggregate macrosdrivers/usb/host/xhci-hub.c+6 -60 replies
16/20usb: xhci: consolidate PORTSC RW1CS bit macrosdrivers/usb/host/xhci-hub.c drivers/usb/host/xhci-port.h drivers/usb/host/xhci.c+13 -230 replies
17/20usb: xhci: relocate all port register macros to xhci-port.hdrivers/usb/host/xhci-hub.c drivers/usb/host/xhci-port.h drivers/usb/host/xhci.c+11 -360 replies
18/20usb: xhci: preserve RW bits in xhci_port_state_to_neutral()drivers/usb/host/xhci-hub.c+11 -140 replies
19/20usb: xhci: improve xhci_port_missing_cas_quirk()drivers/usb/host/xhci-hub.c+3 -20 replies
20/20usb: xhci: use neutral helper when resuming portsdrivers/usb/host/xhci-hub.c+7 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/20] usb: xhci: rework xHCI Port macros

Rework xhci-port.h to standardize how USB Port register macros are defined and used.

Field macros are restricted to describing bit masks only, while the common FIELD_* helpers are used to extract, set, and update field values. This removes custom helpers and consolidates bitfield handling into a single, well-established mechanism.

Other changes include:
- Renaming macros to follow the xHCI specification.
- Relocating USB Port macros to xhci-port.h
- Updating bit field comments and format.
- Adding missing bits/macros.

Why are there 20 patches when many make similar changes?
The series is intentionally split to make review easier by keeping each patch focused and manageable. If preferred, the patches can be combined after review.

Niklas Neronin (20):
usb: xhci: replace bit shifts with the BIT() macro in xhci-port.h
usb: xhci: rework Port Speed macros
usb: xhci: rework Port Link State macros
usb: xhci: replace old Port macro prefix
usb: xhci: rework Port Indicator Control macro
usb: xhci: rework USB3 PORTPMSC macros
usb: xhci: rework USB2 PORTPMSC macros
usb: xhci: rework USB3 PORTLI macros
usb: xhci: rework USB2 PORTLI macros
usb: xhci: document USB3 PORTHLPMC register layout
usb: xhci: rework USB2 PORTHLPMC macros
usb: xhci: update port register bitfield comments for consistency
usb: xhci: rename port register macros to xHCI spec abbreviations
usb: xhci: replace magic numbers with Port macros
usb: xhci: update PORTSC aggregate macros
usb: xhci: consolidate PORTSC RW1CS bit macros
usb: xhci: relocate all port register macros to xhci-port.h
usb: xhci: preserve RW bits in xhci_port_state_to_neutral()
usb: xhci: improve xhci_port_missing_cas_quirk()
usb: xhci: use neutral helper when resuming ports

 drivers/usb/dwc3/host.c         |   2 +-
 drivers/usb/early/xhci-dbc.c    |   4 +-
 drivers/usb/host/xhci-debugfs.c |  23 +--
 drivers/usb/host/xhci-hub.c     | 301 ++++++++++++++------------------
 drivers/usb/host/xhci-pci.c     |   4 +-
 drivers/usb/host/xhci-port.h    | 299 +++++++++++++++++--------------
 drivers/usb/host/xhci-ring.c    |  25 ++-
 drivers/usb/host/xhci-tegra.c   |  23 +--
 drivers/usb/host/xhci.c         |  30 ++--
 drivers/usb/host/xhci.h         |  65 ++++---
 10 files changed, 396 insertions(+), 380 deletions(-)
Signature · 1 line
2.50.1