linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] USB:ehci:fix Kunpeng920 ehci hardware problem
@ 2021-04-09  8:48 Longfang Liu
  2021-04-09 14:59 ` Alan Stern
  0 siblings, 1 reply; 4+ messages in thread
From: Longfang Liu @ 2021-04-09  8:48 UTC (permalink / raw)
  To: gregkh, mathias.nyman, stern, liudongdong3
  Cc: linux-usb, linux-kernel, liulongfang, kong.kongxinwei, yisen.zhuang

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.

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
---

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(+)

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 3c3820a..237a346 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -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);
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH v4] USB:ehci:fix Kunpeng920 ehci hardware problem
@ 2021-04-09  8:31 Longfang Liu
  2021-04-09  8:37 ` liulongfang
  0 siblings, 1 reply; 4+ messages in thread
From: Longfang Liu @ 2021-04-09  8:31 UTC (permalink / raw)
  To: gregkh, mathias.nyman, stern, liudongdong3
  Cc: linux-usb, linux-kernel, liulongfang, kong.kongxinwei, yisen.zhuang

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.

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
---

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(+)

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 3c3820a..237a346 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -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);
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-09 14:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  8:48 [PATCH v4] USB:ehci:fix Kunpeng920 ehci hardware problem Longfang Liu
2021-04-09 14:59 ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2021-04-09  8:31 Longfang Liu
2021-04-09  8:37 ` liulongfang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).