]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/host/xhci-mem.c
xhci: Log extra info on "ERROR Transfer event TRB DMA ptr not part of current TD"
[karo-tx-linux.git] / drivers / usb / host / xhci-mem.c
index 8056d90690ee1bff397b0fa689f3ab9175622a6b..5cb3d7a10017a3eea2ad55a2fe9f487e4472b891 100644 (file)
@@ -1812,6 +1812,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
 
        if (xhci->lpm_command)
                xhci_free_command(xhci, xhci->lpm_command);
+       xhci->lpm_command = NULL;
        if (xhci->cmd_ring)
                xhci_ring_free(xhci, xhci->cmd_ring);
        xhci->cmd_ring = NULL;
@@ -1819,7 +1820,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
        xhci_cleanup_command_queue(xhci);
 
        num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
-       for (i = 0; i < num_ports; i++) {
+       for (i = 0; i < num_ports && xhci->rh_bw; i++) {
                struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
                for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
                        struct list_head *ep = &bwt->interval_bw[j].endpoints;
@@ -1903,7 +1904,7 @@ static int xhci_test_trb_in_td(struct xhci_hcd *xhci,
        start_dma = xhci_trb_virt_to_dma(input_seg, start_trb);
        end_dma = xhci_trb_virt_to_dma(input_seg, end_trb);
 
-       seg = trb_in_td(input_seg, start_trb, end_trb, input_dma);
+       seg = trb_in_td(xhci, input_seg, start_trb, end_trb, input_dma, false);
        if (seg != result_seg) {
                xhci_warn(xhci, "WARN: %s TRB math test %d failed!\n",
                                test_name, test_number);
@@ -1917,6 +1918,8 @@ static int xhci_test_trb_in_td(struct xhci_hcd *xhci,
                                end_trb, end_dma);
                xhci_warn(xhci, "Expected seg %p, got seg %p\n",
                                result_seg, seg);
+               trb_in_td(xhci, input_seg, start_trb, end_trb, input_dma,
+                         true);
                return -1;
        }
        return 0;