--- zzzz-none-000/linux-4.4.271/drivers/usb/host/xhci-mem.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/drivers/usb/host/xhci-mem.c 2023-04-19 10:22:30.000000000 +0000 @@ -442,6 +442,12 @@ seg = seg->next; } while (seg != ring->first_seg); ring->type = type; + + /* 20171011 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... @@ -1094,6 +1100,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/WKR 20170329 : 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 @@ -2206,11 +2218,15 @@ xhci_dbg_trace(xhci, trace_xhci_dbg_init, "xHCI 1.0: support USB2 software lpm"); xhci->sw_lpm_support = 1; + +#if !defined(CONFIG_AVM_KERNEL) +/*== 20180705 AVM/WKR WA: do not allow USB2 HW LPM for AVM ==*/ if (temp & XHCI_HLC) { xhci_dbg_trace(xhci, trace_xhci_dbg_init, "xHCI 1.0: support USB2 hardware lpm"); xhci->hw_lpm_support = 1; } +#endif } port_offset--;