USB: ehci: reopen solution for Synopsys HC bug
authorLongfang Liu <liulongfang@huawei.com>
Mon, 8 Jun 2020 03:46:59 +0000 (11:46 +0800)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 00:07:59 +0000 (20:07 -0400)
commit1805eda1b533b07350a18a1a47c9624e458b4ad1
tree9a07e2e51a669a98b2112bde6332bf07cc31c8ed
parent5e3d9f68f76a316a90387bc37d767d67a7a17658
USB: ehci: reopen solution for Synopsys HC bug

commit 1ddcb71a3edf0e1682b6e056158e4c4b00325f66 upstream.

A Synopsys USB2.0 core used in Huawei Kunpeng920 SoC has a bug which
might cause the host controller not issuing ping.

Bug description:
After indicating an Interrupt on Async Advance, the software uses the
doorbell mechanism to delete the Next Link queue head of the last
executed queue head. At this time, the host controller still references
the removed queue head(the queue head is NULL). NULL reference causes
the host controller to lose the USB device.

Solution:
After deleting the Next Link queue head, when has_synopsys_hc_bug set
to 1,the software can write one of the valid queue head addresses to
the ASYNCLISTADDR register to allow the host controller to get
the valid queue head. in order to solve that problem, this patch set
the flag for Huawei Kunpeng920

There are detailed instructions and solutions in this patch:
commit 2f7ac6c19997 ("USB: ehci: add workaround for Synopsys HC bug")

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/1591588019-44284-1-git-send-email-liulongfang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-pci.c