Skip to content

Commit 15a2797

Browse files
matnymangregkh
authored andcommitted
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]>
1 parent 0c95950 commit 15a2797

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/usb/host/xhci.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2336,7 +2336,12 @@ static inline const char *xhci_decode_portsc(char *str, u32 portsc)
23362336
{
23372337
int ret;
23382338

2339-
ret = sprintf(str, "%s %s %s Link:%s PortSpeed:%d ",
2339+
ret = sprintf(str, "0x%08x ", portsc);
2340+
2341+
if (portsc == ~(u32)0)
2342+
return str;
2343+
2344+
ret += sprintf(str + ret, "%s %s %s Link:%s PortSpeed:%d ",
23402345
portsc & PORT_POWER ? "Powered" : "Powered-off",
23412346
portsc & PORT_CONNECT ? "Connected" : "Not-connected",
23422347
portsc & PORT_PE ? "Enabled" : "Disabled",

0 commit comments

Comments
 (0)