--- zzzz-none-000/linux-4.1.38/drivers/usb/host/xhci-mem.c 2017-01-18 18:48:06.000000000 +0000 +++ bcm63-7582-715/linux-4.1.38/drivers/usb/host/xhci-mem.c 2020-11-25 10:06:48.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... @@ -1043,6 +1049,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 @@ -1677,7 +1689,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; }