diff mbox series

[v4] USB:ehci:fix Kunpeng920 ehci hardware problem

Message ID 1617958081-17999-1-git-send-email-liulongfang@huawei.com (mailing list archive)
State Accepted
Commit 26b75952ca0b8b4b3050adb9582c8e2f44d49687
Headers show
Series [v4] USB:ehci:fix Kunpeng920 ehci hardware problem | expand

Commit Message

liulongfang April 9, 2021, 8:48 a.m. UTC
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(+)

Comments

Alan Stern April 9, 2021, 2:59 p.m. UTC | #1
On Fri, Apr 09, 2021 at 04:48:01PM +0800, Longfang Liu wrote:
> 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>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

> 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
>
diff mbox series

Patch

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