usb: xhci: enhancements to address printing
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 29 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | usb: xhci-dbgcap: correct DMA address handlingdrivers/ | +6 | 3 replies | |
| 2/7 | usb: xhci: use '%pad' specifier for DMA address printingdrivers/ drivers/ drivers/ +1 more | +45 | 18 replies | |
| 3/7 | usb: xhci: improve Stream Context register debuggingdrivers/ drivers/ drivers/ | +13 | 1 reply | |
| 4/7 | usb: xhci: improve Endpoint Context register debuggingdrivers/ | +2 | 3 replies | |
| 5/7 | usb: xhci: improve Command Ring Control register debuggingdrivers/ | +2 | 2 replies | |
| 6/7 | usb: xhci: improve Event Ring Dequeue Pointer Register debuggingdrivers/ | +4 | 0 replies | |
| 7/7 | usb: xhci: standardize address formatdrivers/ drivers/ drivers/ +4 more | +31 | 2 replies |
Reviews trailers per patch
1 of 7 patches has a Reviewed-by or Acked-by.
| Patch | Andy Shevchenko |
|---|---|
| 1/7 | |
| 2/7 | R-b |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/7] usb: xhci: enhancements to address printing
DMA Address Printing:
All DMA address printing is now standardized using the "%pad" specifier. This guarantees correct address formatting regardless of the kernel's architecture, whether 32-bit or 64-bit.
Address Formatting:
Printed hexadecimal values can be ambiguous, making it tricky to distinguish between values and addresses. To enhance clarity, all trusted DMA addresses are now prefixed with the '@' symbol, ensuring immediate recognition as addresses.
However, the printk() specifier '%p' has had its '@' prefix removed. This is because it hashes the address before printing, effectively turning it into an address ID. The hashing process does not preserve any relation between addresses; for instance, if two addresses are X bytes apart, their hashed counterparts will not reflect this distinction.
Read 64-bit register printing:
Debug messages that print an entire register value containing a DMA address have been improved. The register fields are now split and printed separately, making it easier for users to interpret the information.
These changes collectively improve the readability and consistency of address printing in the xHCI driver, making it easier for developers and maintainers to interpret log outputs accurately.
=== Alternative approach ===
An argument can be made for switching from representing a TRB by its DMA address to using an index, as most printed DMA addresses are TRB addresses. While this approach offers potential benefits, it also presents challenges. Calculating the TRB index is straightforward when the segment and TRB are known. However, when printing TRB addresses read from xHCI registers, determining the TRB index becomes complex, increasing the risk of producing incorrect debug messages. Due to these complexities, I have decided not to switch to TRB indexes (yet).
Niklas Neronin (7):
usb: xhci-dbgcap: correct DMA address handling
usb: xhci: use '%pad' specifier for DMA address printing
usb: xhci: improve Stream Context register debugging
usb: xhci: improve Endpoint Context register debugging
usb: xhci: improve Command Ring Control register debugging
usb: xhci: improve Event Ring Dequeue Pointer Register debugging
usb: xhci: standardize address format
drivers/usb/host/xhci-dbgcap.c | 11 +++++---- drivers/usb/host/xhci-debugfs.c | 22 ++++++++++------- drivers/usb/host/xhci-mem.c | 13 +++++----- drivers/usb/host/xhci-ring.c | 42 ++++++++++++++++----------------- drivers/usb/host/xhci-trace.h | 37 +++++++++++++++-------------- drivers/usb/host/xhci.c | 37 +++++++++++++++-------------- drivers/usb/host/xhci.h | 4 ++-- 7 files changed, 86 insertions(+), 80 deletions(-)
Signature · 1 line
2.50.1