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 <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>
1 parent 0c95950 commit 15a2797

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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)