xhci: pass port structure to tracing instead of port number
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 19 Oct 2023 10:29:06 +0000 (13:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Oct 2023 10:38:53 +0000 (12:38 +0200)
We want to trace other port structure members than just port number
so pass entire port structure as parameter instead of just port number.

Dig the port number from the port structure.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231019102924.2797346-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci-trace.h

index 0df5d807a77e8f2ae2f15a3eed55415493c4ac3f..0980ade2a234a38ee6b8d25e674e1da12b624224 100644 (file)
@@ -1262,7 +1262,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                        retval = -ENODEV;
                        break;
                }
-               trace_xhci_get_port_status(wIndex, temp);
+               trace_xhci_get_port_status(port, temp);
                status = xhci_get_port_status(hcd, bus_state, wIndex, temp,
                                              &flags);
                if (status == 0xffffffff)
@@ -1687,7 +1687,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
                        retval = -ENODEV;
                        break;
                }
-               trace_xhci_hub_status_data(i, temp);
+               trace_xhci_hub_status_data(ports[i], temp);
 
                if ((temp & mask) != 0 ||
                        (bus_state->port_c_suspend & 1 << i) ||
index 3e5dc0723a8fc2aa73348fd6c59c4dc442ea6989..48daeb4b4a46e249e574a9d473b8ac6d46e843a9 100644 (file)
@@ -1906,7 +1906,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
        xhci_dbg(xhci, "Port change event, %d-%d, id %d, portsc: 0x%x\n",
                 hcd->self.busnum, hcd_portnum + 1, port_id, portsc);
 
-       trace_xhci_handle_port_status(hcd_portnum, portsc);
+       trace_xhci_handle_port_status(port, portsc);
 
        if (hcd->state == HC_STATE_SUSPENDED) {
                xhci_dbg(xhci, "resume root hub\n");
index d6b32f2ad90ecbc408b5a6723fdcf7c0a9c74814..2208eda1ff279ab7ef0eb2b04741837d70702df2 100644 (file)
@@ -509,14 +509,14 @@ DEFINE_EVENT(xhci_log_ring, xhci_inc_deq,
 );
 
 DECLARE_EVENT_CLASS(xhci_log_portsc,
-                   TP_PROTO(u32 portnum, u32 portsc),
-                   TP_ARGS(portnum, portsc),
+                   TP_PROTO(struct xhci_port *port, u32 portsc),
+                   TP_ARGS(port, portsc),
                    TP_STRUCT__entry(
                                     __field(u32, portnum)
                                     __field(u32, portsc)
                                     ),
                    TP_fast_assign(
-                                  __entry->portnum = portnum;
+                                  __entry->portnum = port->hcd_portnum;
                                   __entry->portsc = portsc;
                                   ),
                    TP_printk("port-%d: %s",
@@ -526,18 +526,18 @@ DECLARE_EVENT_CLASS(xhci_log_portsc,
 );
 
 DEFINE_EVENT(xhci_log_portsc, xhci_handle_port_status,
-            TP_PROTO(u32 portnum, u32 portsc),
-            TP_ARGS(portnum, portsc)
+            TP_PROTO(struct xhci_port *port, u32 portsc),
+            TP_ARGS(port, portsc)
 );
 
 DEFINE_EVENT(xhci_log_portsc, xhci_get_port_status,
-            TP_PROTO(u32 portnum, u32 portsc),
-            TP_ARGS(portnum, portsc)
+            TP_PROTO(struct xhci_port *port, u32 portsc),
+            TP_ARGS(port, portsc)
 );
 
 DEFINE_EVENT(xhci_log_portsc, xhci_hub_status_data,
-            TP_PROTO(u32 portnum, u32 portsc),
-            TP_ARGS(portnum, portsc)
+            TP_PROTO(struct xhci_port *port, u32 portsc),
+            TP_ARGS(port, portsc)
 );
 
 DECLARE_EVENT_CLASS(xhci_log_doorbell,