All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] USB: ehci: reopen solution for Synopsys HC bug
@ 2020-06-08  3:46 Longfang Liu
  2020-06-17  1:54 ` liulongfang
  0 siblings, 1 reply; 3+ messages in thread
From: Longfang Liu @ 2020-06-08  3:46 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, kong.kongxinwei, huangdaode, yisen.zhuang

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

Changes in v3:
- updated comment message

Changes in v2:
- Added comment message

 drivers/usb/host/ehci-pci.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 1a48ab1..7ff2cbd 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -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 */
-- 
2.8.1


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

* Re: [PATCH v3] USB: ehci: reopen solution for Synopsys HC bug
  2020-06-08  3:46 [PATCH v3] USB: ehci: reopen solution for Synopsys HC bug Longfang Liu
@ 2020-06-17  1:54 ` liulongfang
  2020-06-17 14:37   ` Alan Stern
  0 siblings, 1 reply; 3+ messages in thread
From: liulongfang @ 2020-06-17  1:54 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, kong.kongxinwei, huangdaode, yisen.zhuang

On 2020/6/8 11:46, Longfang Liu Wrote:
> 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>
> ---
>
> Changes in v3:
> - updated comment message
>
> Changes in v2:
> - Added comment message
>
>  drivers/usb/host/ehci-pci.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> index 1a48ab1..7ff2cbd 100644
> --- a/drivers/usb/host/ehci-pci.c
> +++ b/drivers/usb/host/ehci-pci.c
> @@ -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 */

Hi ALL,

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

Thanks,

Longfang



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

* Re: [PATCH v3] USB: ehci: reopen solution for Synopsys HC bug
  2020-06-17  1:54 ` liulongfang
@ 2020-06-17 14:37   ` Alan Stern
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Stern @ 2020-06-17 14:37 UTC (permalink / raw)
  To: liulongfang; +Cc: gregkh, linux-usb, kong.kongxinwei, huangdaode, yisen.zhuang

On Wed, Jun 17, 2020 at 09:54:40AM +0800, liulongfang wrote:
> On 2020/6/8 11:46, Longfang Liu Wrote:
> > 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>
> > ---
> >
> > Changes in v3:
> > - updated comment message
> >
> > Changes in v2:
> > - Added comment message
> >
> >  drivers/usb/host/ehci-pci.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> > index 1a48ab1..7ff2cbd 100644
> > --- a/drivers/usb/host/ehci-pci.c
> > +++ b/drivers/usb/host/ehci-pci.c
> > @@ -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 */
> 
> Hi ALL,
> 
>  I'd appreciate any comments on this patch
> from USB related people.

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

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

end of thread, other threads:[~2020-06-17 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08  3:46 [PATCH v3] USB: ehci: reopen solution for Synopsys HC bug Longfang Liu
2020-06-17  1:54 ` liulongfang
2020-06-17 14:37   ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.