Skip to contentSkip to conversation

USB:ehci:fix Kunpeng920 ehci hardware problem

PATCH Superseded Longfang Liu 1 participant 2 messages Apr 9, 2021

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

PATCH v4 1/1 USB:ehci:fix Kunpeng920 ehci hardware problem

Kunpeng920's EHCI controller does not have SBRN register. Reading the SBRN register when the controller driver is initialized will get 0.

When rebooting the EHCI driver, ehci_shutdown() will be called. if the sbrn flag is 0, ehci_shutdown() will return directly. The sbrn flag being 0 will cause the EHCI interrupt signal to not be turned off after reboot. this interrupt that is not closed will cause an exception to the device sharing the interrupt.

Therefore, the EHCI controller of Kunpeng920 needs to skip the read operation of the SBRN register.

---

Changes in v4:
- Modify the code implementation.

Changes in v3:
- Fix some code style issues.
- Update struct name.

Changes in v2:
- Fix some code style issues.
- Update function name.

 drivers/usb/host/ehci-pci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ehci-pci.c +3 -0
index 3c3820a..237a346 100644
@@ -291,6 +291,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 	if (pdev->vendor == PCI_VENDOR_ID_STMICRO
 	    && pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST)
 		;	/* ConneXT has no sbrn register */
+	else if (pdev->vendor == PCI_VENDOR_ID_HUAWEI
+			 && pdev->device == 0xa239)
+		;	/* HUAWEI Kunpeng920 USB EHCI has no sbrn register */
 	else
 		pci_read_config_byte(pdev, 0x60, &ehci->sbrn);
 
Signature · 1 line
2.8.1
#1 lore raw
Quoted 35 lines · Longfang Liu

Kunpeng920's EHCI controller does not have SBRN register. Reading the SBRN register when the controller driver is initialized will get 0.

When rebooting the EHCI driver, ehci_shutdown() will be called. if the sbrn flag is 0, ehci_shutdown() will return directly. The sbrn flag being 0 will cause the EHCI interrupt signal to not be turned off after reboot. this interrupt that is not closed will cause an exception to the device sharing the interrupt.

Therefore, the EHCI controller of Kunpeng920 needs to skip the read operation of the SBRN register.

---

Changes in v4:
- Modify the code implementation.

Changes in v3:
- Fix some code style issues.
- Update struct name.

Changes in v2:
- Fix some code style issues.
- Update function name.

 drivers/usb/host/ehci-pci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ehci-pci.c +0 -0
index 3c3820a..237a346 100644

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

Quoted 5 lines
drivers/usb/host/ehci-pci.c +2 -0
@@ -291,6 +291,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
 	if (pdev->vendor == PCI_VENDOR_ID_STMICRO
 	    && pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST)
 		;	/* ConneXT has no sbrn register */
+	else if (pdev->vendor == PCI_VENDOR_ID_HUAWEI
+			 && pdev->device == 0xa239)

Sorry.
There is a problem with the format, I need to resend Thanks.
Longfang.

Quoted 5 lines
drivers/usb/host/ehci-pci.c +1 -0
+		;	/* HUAWEI Kunpeng920 USB EHCI has no sbrn register */
 	else
 		pci_read_config_byte(pdev, 0x60, &ehci->sbrn);