On 10.7.2020 18.09, Li Jun wrote: > dci is 0 based and xhci_get_ep_ctx() will do ep index increment to get > the ep context. > > Fixes: 02b6fdc2a153 ("usb: xhci: Add debugfs interface for xHCI driver") > Signed-off-by: Li Jun <jun.li@xxxxxxx> > --- > drivers/usb/host/xhci-debugfs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugfs.c > index 76c3f29..65d8de4 100644 > --- a/drivers/usb/host/xhci-debugfs.c > +++ b/drivers/usb/host/xhci-debugfs.c > @@ -282,9 +282,9 @@ static int xhci_endpoint_context_show(struct seq_file *s, void *unused) > > xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus)); > > - for (dci = 1; dci < 32; dci++) { > + for (dci = 0; dci < 31; dci++) { > ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, dci); > - dma = dev->out_ctx->dma + dci * CTX_SIZE(xhci->hcc_params); > + dma = dev->out_ctx->dma + (dci + 1) * CTX_SIZE(xhci->hcc_params); > seq_printf(s, "%pad: %s\n", &dma, > xhci_decode_ep_context(le32_to_cpu(ep_ctx->ep_info), > le32_to_cpu(ep_ctx->ep_info2), > Thanks, adding to queue. I'll probably change "dci" to "ep_index" while applying this as it doesn't represent the Device Context Index (DCI) in the xhci specs -Mathias