--- zzzz-none-000/linux-4.1.52/drivers/usb/host/xhci-mem.c 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/drivers/usb/host/xhci-mem.c 2022-03-02 11:37:13.000000000 +0000 @@ -442,6 +442,12 @@ seg = seg->next; } while (seg != ring->first_seg); ring->type = type; + + /* 20171214 AVM/VGJ Fix: set link toggle bit for last segment + * Taken from xhci_ring_alloc */ + ring->last_seg->trbs[TRBS_PER_SEGMENT - 1].link.control |= + cpu_to_le32(LINK_TOGGLE); + xhci_initialize_ring_info(ring, cycle_state); /* td list should be empty since all URBs have been cancelled, * but just in case... @@ -1091,6 +1097,12 @@ virt_dev = xhci->devs[udev->slot_id]; ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0); ep_ring = virt_dev->eps[0].ring; + + /* == AVM/VGJ 20170330 : USB Reset Workaround == + * Avoid AddressDevice error on quirky hosts by flushing of EP0 ring + */ + xhci_reinit_cached_ring(xhci, ep_ring, 1, TYPE_CTRL); + /* * FIXME we don't keep track of the dequeue pointer very well after a * Set TR dequeue pointer, so we're setting the dequeue pointer of the @@ -1725,7 +1737,11 @@ if (!buf) goto fail_sp5; +#if defined(CONFIG_BCM_KF_MIPS_BCM963XX) || defined(CONFIG_BCM_KF_ARM_BCM963XX) + xhci->scratchpad->sp_array[i] = cpu_to_le64(dma); +#else xhci->scratchpad->sp_array[i] = dma; +#endif xhci->scratchpad->sp_buffers[i] = buf; xhci->scratchpad->sp_dma_buffers[i] = dma; }