diff mbox

[v2,2/2] usb: host: xhci-plat: fix cannot work if R-Car Gen2/3 run on above 4GB phys

Message ID 1457577257-4936-3-git-send-email-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Yoshihiro Shimoda March 10, 2016, 2:34 a.m. UTC
This patch fixes an issue that cannot work if R-Car Gen2/3 run on
above 4GB physical memory environment to use a quirk XHCI_CLEAR_AC64.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/usb/host/xhci-plat.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Felipe Balbi March 11, 2016, 7:01 a.m. UTC | #1
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> writes:

> [ text/plain ]
> This patch fixes an issue that cannot work if R-Car Gen2/3 run on
> above 4GB physical memory environment to use a quirk XHCI_CLEAR_AC64.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  drivers/usb/host/xhci-plat.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 5c15e9b..4dbd56f 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -39,12 +39,19 @@ static const struct xhci_driver_overrides xhci_plat_overrides __initconst = {
>  
>  static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
>  {
> +	struct usb_hcd *hcd = xhci_to_hcd(xhci);
> +
>  	/*
>  	 * As of now platform drivers don't provide MSI support so we ensure
>  	 * here that the generic code does not try to make a pci_dev from our
>  	 * dev struct in order to setup MSI
>  	 */
>  	xhci->quirks |= XHCI_PLAT;
> +
> +	/* Please refer to the xhci.c about the detail of this quirk */

this is an odd comment. It should be okay to state here that RCAR
GEN2/GEN3 lack proper 64BIT support even though register says otherwise.
Yoshihiro Shimoda March 14, 2016, 10:23 a.m. UTC | #2
Hi,

> Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> writes:
> 
> > [ text/plain ]
> > This patch fixes an issue that cannot work if R-Car Gen2/3 run on
> > above 4GB physical memory environment to use a quirk XHCI_CLEAR_AC64.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > ---
> >  drivers/usb/host/xhci-plat.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > index 5c15e9b..4dbd56f 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -39,12 +39,19 @@ static const struct xhci_driver_overrides xhci_plat_overrides __initconst = {
> >
> >  static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
> >  {
> > +	struct usb_hcd *hcd = xhci_to_hcd(xhci);
> > +
> >  	/*
> >  	 * As of now platform drivers don't provide MSI support so we ensure
> >  	 * here that the generic code does not try to make a pci_dev from our
> >  	 * dev struct in order to setup MSI
> >  	 */
> >  	xhci->quirks |= XHCI_PLAT;
> > +
> > +	/* Please refer to the xhci.c about the detail of this quirk */
> 
> this is an odd comment. It should be okay to state here that RCAR
> GEN2/GEN3 lack proper 64BIT support even though register says otherwise.

Thank you for the comment. I will add comments like a patch v1.

Best regards,
Yoshihiro Shimoda

> --
> balbi
diff mbox

Patch

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 5c15e9b..4dbd56f 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -39,12 +39,19 @@  static const struct xhci_driver_overrides xhci_plat_overrides __initconst = {
 
 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
+	struct usb_hcd *hcd = xhci_to_hcd(xhci);
+
 	/*
 	 * As of now platform drivers don't provide MSI support so we ensure
 	 * here that the generic code does not try to make a pci_dev from our
 	 * dev struct in order to setup MSI
 	 */
 	xhci->quirks |= XHCI_PLAT;
+
+	/* Please refer to the xhci.c about the detail of this quirk */
+	if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||
+	    xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3))
+		xhci->quirks |= XHCI_CLEAR_AC64;
 }
 
 /* called during probe() after chip reset completes */