Skip to contentSkip to conversation

USB: ehci: reopen solution for Synopsys HC bug

PATCH In review Longfang Liu 2 participants 3 messages Jun 8, 2020 – Jun 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 USB: ehci: reopen solution for Synopsys HC bug

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")

---

Changes in v3:
- updated comment message

Changes in v2:
- Added comment message

 drivers/usb/host/ehci-pci.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/usb/host/ehci-pci.c +7 -0
index 1a48ab1..7ff2cbd 100644
@@ -216,6 +216,13 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 		ehci_info(ehci, "applying MosChip frame-index workaround\n");
 		ehci->frame_index_bug = 1;
 		break;
+	case PCI_VENDOR_ID_HUAWEI:
+		/* Synopsys HC bug */
+		if (pdev->device == 0xa239) {
+			ehci_info(ehci, "applying Synopsys HC workaround\n");
+			ehci->has_synopsys_hc_bug = 1;
+		}
+		break;
 	}
 
 	/* optional debug port, normally in the first BAR */
Signature · 1 line
2.8.1
#1 lore raw

On 2020/6/8 11:46, Longfang Liu Wrote:

Quoted 40 lines

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")

---

Changes in v3:
- updated comment message

Changes in v2:
- Added comment message

 drivers/usb/host/ehci-pci.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/usb/host/ehci-pci.c +0 -0
index 1a48ab1..7ff2cbd 100644
@@ -216,6 +216,13 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 		ehci_info(ehci, "applying MosChip frame-index workaround\n");
 		ehci->frame_index_bug = 1;
 		break;

drivers/usb/host/ehci-pci.c static int ehci_pci_setup(struct usb_hcd *hcd) · line 228

Quoted 10 lines
drivers/usb/host/ehci-pci.c +7 -0
+	case PCI_VENDOR_ID_HUAWEI:
+		/* Synopsys HC bug */
+		if (pdev->device == 0xa239) {
+			ehci_info(ehci, "applying Synopsys HC workaround\n");
+			ehci->has_synopsys_hc_bug = 1;
+		}
+		break;
 	}
 
 	/* optional debug port, normally in the first BAR */

Hi ALL,

 I'd appreciate any comments on this patch
from USB related people.

Thanks,

Longfang

maintainer Acked-by
#2 lore raw
Quoted 50 lines · liulongfang

On 2020/6/8 11:46, Longfang Liu Wrote:

Quoted 49 lines

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")

---

Changes in v3:
- updated comment message

Changes in v2:
- Added comment message

 drivers/usb/host/ehci-pci.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/usb/host/ehci-pci.c +7 -0
index 1a48ab1..7ff2cbd 100644
@@ -216,6 +216,13 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 		ehci_info(ehci, "applying MosChip frame-index workaround\n");
 		ehci->frame_index_bug = 1;
 		break;
+	case PCI_VENDOR_ID_HUAWEI:
+		/* Synopsys HC bug */
+		if (pdev->device == 0xa239) {
+			ehci_info(ehci, "applying Synopsys HC workaround\n");
+			ehci->has_synopsys_hc_bug = 1;
+		}
+		break;
 	}
 
Quoted 6 lines

drivers/usb/host/ehci-pci.c static int ehci_pci_setup(struct usb_hcd *hcd) · line 228

Quoted 1 line
drivers/usb/host/ehci-pci.c +0 -0
 	/* optional debug port, normally in the first BAR */

Hi ALL,

 I'd appreciate any comments on this patch
from USB related people.