diff options
author | Mathias Nyman <[email protected]> | 2024-04-29 17:02:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2024-05-01 08:47:14 +0200 |
commit | 15a27970e5f3d802fa7ed12410821f01c8a4d8f8 (patch) | |
tree | 92479a290ce5d266699a901d13655bca20eb673e | |
parent | 0c9595089432c152640aa75cf14e76d5510965f4 (diff) |
xhci: improve PORTSC register debugging output
Print the full hex value of PORTSC register in addition to the human
readable decoded string while debugging PORTSC value.
If PORTSC value is 0xffffffff then don't decode it.
This lets us inspect Rsvd bits of PORTSC.
Same is done for USBSTS register values.
Signed-off-by: Mathias Nyman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/host/xhci.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 10805196e197..8c96dd6ef3d4 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -2336,7 +2336,12 @@ static inline const char *xhci_decode_portsc(char *str, u32 portsc) { int ret; - ret = sprintf(str, "%s %s %s Link:%s PortSpeed:%d ", + ret = sprintf(str, "0x%08x ", portsc); + + if (portsc == ~(u32)0) + return str; + + ret += sprintf(str + ret, "%s %s %s Link:%s PortSpeed:%d ", portsc & PORT_POWER ? "Powered" : "Powered-off", portsc & PORT_CONNECT ? "Connected" : "Not-connected", portsc & PORT_PE ? "Enabled" : "Disabled", |