]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xhci: debugfs: Add virt endpoint state to xhci debugfs
authorWangYuli <wangyuli@uniontech.com>
Wed, 6 Nov 2024 10:14:35 +0000 (12:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2024 12:26:14 +0000 (13:26 +0100)
The ring data structure of each xHCI endpoint might stop sending
data due to the virt endpoint state.

Show the virt endpoint state within the endpoint context via debugfs
to facilitate debugging.

Co-developed-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20241106101459.775897-10-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-debugfs.c

index f8ba15e7c225c2a079ae31c74c93a3ddc82a08ee..35247cd50c74c68433bc6899ed4f964b5069b329 100644 (file)
@@ -291,12 +291,13 @@ static int xhci_endpoint_context_show(struct seq_file *s, void *unused)
        for (ep_index = 0; ep_index < 31; ep_index++) {
                ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
                dma = dev->out_ctx->dma + (ep_index + 1) * CTX_SIZE(xhci->hcc_params);
-               seq_printf(s, "%pad: %s\n", &dma,
+               seq_printf(s, "%pad: %s, virt_state:%#x\n", &dma,
                           xhci_decode_ep_context(str,
                                                  le32_to_cpu(ep_ctx->ep_info),
                                                  le32_to_cpu(ep_ctx->ep_info2),
                                                  le64_to_cpu(ep_ctx->deq),
-                                                 le32_to_cpu(ep_ctx->tx_info)));
+                                                 le32_to_cpu(ep_ctx->tx_info)),
+                                                 dev->eps[ep_index].ep_state);
        }
 
        return 0;