Skip to content

usb: xhci: add Port Register struct and tracing

Niklas Neronin linux-usb 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest5 patches 1 replyIn review

Changes in v3 from the cover letter

* Rebased on top of 6.18-rc1.
* Further simplified and generalized xhci_decode_portsc().
* Changed PORTSC read/write functions names.
* Added EXPORT_SYMBOL_GPL() to PORTSC read/write.
* Folded rename patch into Port Register struct implementation patch.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5usb: xhci: rework xhci_decode_portsc()drivers/usb/host/xhci.h+36 -230 replies
2/5usb: xhci: add tracing for PORTSC register writesdrivers/usb/host/xhci-debugfs.c drivers/usb/host/xhci-hub.c drivers/usb/host/xhci-pci.c +3 more+32 -200 replies
3/5usb: xhci: add helper to read PORTSC registerdrivers/usb/host/xhci-debugfs.c drivers/usb/host/xhci-hub.c drivers/usb/host/xhci-pci.c +4 more+55 -481 reply
4/5usb: xhci: add USB Port Register Set structdrivers/usb/host/xhci-mem.c drivers/usb/host/xhci.h+17 -220 replies
5/5usb: xhci: implement USB Port Register Set structdrivers/usb/host/xhci-hub.c drivers/usb/host/xhci-mem.c drivers/usb/host/xhci.c +1 more+24 -300 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchPeter Chen
1/5
2/5
3/5R-b
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] usb: xhci: add Port Register struct and tracing

The aim of this patch set is to introduce tracing for PORTSC writes and implement a Port Register Set struct. This is the first part in a larger series of changes.

Introduces a new struct for the Host Controller USB Port Register Set. The current implementation accesses these registers through a single '__le32' pointer, which, in conjunction with a macro, navigates to the specific register using (base address + offset).

Currently, how its accessed | Register Name
--------------------------------------------------------------------------
port->addr | Port Status and Control
port->addr + PORTPMSC | Port Power Management Status and Control
port->addr + PORTLI | Port Link Info
port->addr + PORTHLPMC | Port Hardware LPM Control

After, how its accessed | Register Name
--------------------------------------------------------------------------
port->port_reg->portsc | Port Status and Control
port->port_reg->portpmsc | Port Power Management Status and Control
port->port_reg->portli | Port Link Info
port->port_reg->porthlmpc | Port Hardware LPM Control

These changes make it easier for future modification and their review.

v3 changes:
* Rebased on top of 6.18-rc1.
* Further simplified and generalized xhci_decode_portsc().
* Changed PORTSC read/write functions names.
* Added EXPORT_SYMBOL_GPL() to PORTSC read/write.
* Folded rename patch into Port Register struct implementation patch.
v2 changes:
* Fix acronym spelling to PORTSC from PORTCS, in all commit messages.
* Add patch introducing xhci_get_portsc().

Niklas Neronin (5):
usb: xhci: rework xhci_decode_portsc()
usb: xhci: add tracing for PORTSC register writes
usb: xhci: add helper to read PORTSC register
usb: xhci: add USB Port Register Set struct
usb: xhci: implement USB Port Register Set struct

 drivers/usb/host/xhci-debugfs.c |   6 +-
 drivers/usb/host/xhci-hub.c     | 115 ++++++++++++++++----------------
 drivers/usb/host/xhci-mem.c     |   3 +-
 drivers/usb/host/xhci-pci.c     |   4 +-
 drivers/usb/host/xhci-ring.c    |   2 +-
 drivers/usb/host/xhci-tegra.c   |  12 ++--
 drivers/usb/host/xhci-trace.h   |   5 ++
 drivers/usb/host/xhci.c         |  48 ++++++++-----
 drivers/usb/host/xhci.h         | 102 +++++++++++++++-------------
 9 files changed, 159 insertions(+), 138 deletions(-)
Signature · 1 line
2.50.1