xhci: improve PORTSC register debugging output
authorMathias Nyman <mathias.nyman@linux.intel.com>
Mon, 29 Apr 2024 14:02:35 +0000 (17:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 May 2024 06:47:14 +0000 (08:47 +0200)
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 <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240429140245.3955523-9-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.h

index 10805196e1971c18fba562a4c0e3f3a71c019b6a..8c96dd6ef3d4fd211231d500eb4df35d0f1c013f 100644 (file)
@@ -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",