Re: [PATCH v2 5/6] usb: host: xhci: plat: make use of new methods in xhci_plat_priv

2016-04-21 Thread Mathias Nyman

On 21.04.2016 16:10, Mathias Nyman wrote:

depends on how Mathias wants this to be handled. Mathias, do you want me
to send the full series again ?


any comments here ???



No need to send full series, I'll pick the updated 5/6



Appears that
5ad3b03 usb: host: xhci-plat: fix cannot work if R-Car Gen2/3 run on above 4GB 
phys

in usb-next messes up this series.
Could you rebase on top of usb-next and resend after all.

Thanks
Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 5/6] usb: host: xhci: plat: make use of new methods in xhci_plat_priv

2016-04-21 Thread Mathias Nyman

depends on how Mathias wants this to be handled. Mathias, do you want me
to send the full series again ?


any comments here ???



No need to send full series, I'll pick the updated 5/6

-Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v2 5/6] usb: host: xhci: plat: make use of new methods in xhci_plat_priv

2016-04-21 Thread Felipe Balbi

Mathias,

Felipe Balbi  writes:
> Hi,
>
> Yoshihiro Shimoda  writes:
>> Hi,
>>
>>> Sent: Wednesday, March 30, 2016 2:59 PM
>>> 
>>> Yoshihiro Shimoda  writes:
>>> > [ text/plain ]
>>> > Hi Felipe,
>>> >
>>> > Thank you for the patch!
>>> 
>>> hey, no problem :-)
>>> 
>>> >> Sent: Tuesday, March 29, 2016 7:11 PM
>>> > < snip >
>>> >>  static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
>>> >>  .type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
>>> >>  .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
>>> >> +.init_quirk = xhci_rcar_init_quirk,
>>> >>  };
>>> >
>>> > I should have said explicitly before, but the xhci_plat_renesas_rcar_gen2
>>> > also needs ".plat_start = xhci_rcar_start" like the variable of gen3.
>>> 
>>> good catch, I really missed that one :-)
>>
>> I got it :)
>>
>>> Here's an updated version of $subject:
>>
>> Thank you for the update!
>> Perhaps we need to rebase for the patch 6/6. Anyway, about this patch series:
>
> depends on how Mathias wants this to be handled. Mathias, do you want me
> to send the full series again ?

any comments here ???

-- 
balbi


signature.asc
Description: PGP signature


RE: [PATCH v2 5/6] usb: host: xhci: plat: make use of new methods in xhci_plat_priv

2016-03-30 Thread Felipe Balbi

Hi,

Yoshihiro Shimoda  writes:
> Hi,
>
>> Sent: Wednesday, March 30, 2016 2:59 PM
>> 
>> Yoshihiro Shimoda  writes:
>> > [ text/plain ]
>> > Hi Felipe,
>> >
>> > Thank you for the patch!
>> 
>> hey, no problem :-)
>> 
>> >> Sent: Tuesday, March 29, 2016 7:11 PM
>> > < snip >
>> >>  static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
>> >>   .type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
>> >>   .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
>> >> + .init_quirk = xhci_rcar_init_quirk,
>> >>  };
>> >
>> > I should have said explicitly before, but the xhci_plat_renesas_rcar_gen2
>> > also needs ".plat_start = xhci_rcar_start" like the variable of gen3.
>> 
>> good catch, I really missed that one :-)
>
> I got it :)
>
>> Here's an updated version of $subject:
>
> Thank you for the update!
> Perhaps we need to rebase for the patch 6/6. Anyway, about this patch series:

depends on how Mathias wants this to be handled. Mathias, do you want me
to send the full series again ?

> Acked-by: Yoshihiro Shimoda 

Thanks :-)

-- 
balbi


signature.asc
Description: PGP signature


RE: [PATCH v2 5/6] usb: host: xhci: plat: make use of new methods in xhci_plat_priv

2016-03-30 Thread Yoshihiro Shimoda
Hi,

> Sent: Wednesday, March 30, 2016 2:59 PM
> 
> Yoshihiro Shimoda  writes:
> > [ text/plain ]
> > Hi Felipe,
> >
> > Thank you for the patch!
> 
> hey, no problem :-)
> 
> >> Sent: Tuesday, March 29, 2016 7:11 PM
> > < snip >
> >>  static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
> >>.type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
> >>.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
> >> +  .init_quirk = xhci_rcar_init_quirk,
> >>  };
> >
> > I should have said explicitly before, but the xhci_plat_renesas_rcar_gen2
> > also needs ".plat_start = xhci_rcar_start" like the variable of gen3.
> 
> good catch, I really missed that one :-)

I got it :)

> Here's an updated version of $subject:

Thank you for the update!
Perhaps we need to rebase for the patch 6/6. Anyway, about this patch series:

Acked-by: Yoshihiro Shimoda 

Best regards,
Yoshihiro Shimoda

> 8< cut here 
> 
> From 33607d25f042d4972dcf2a95f35f051c74b12e51 Mon Sep 17 00:00:00 2001
> From: Felipe Balbi 
> Date: Tue, 29 Mar 2016 13:03:31 +0300
> Subject: [PATCH] usb: host: xhci: plat: make use of new methods in
>  xhci_plat_priv
> 
> Now that the code has been refactored enough,
> switching over to using ->plat_start() and
> ->init_quirk() becomes a very simple patch.
> 
> After this patch, there are no further uses for
> xhci_plat_type_is() which will be removed in a
> follow-up patch.
> 
> Signed-off-by: Felipe Balbi 
> ---
>  drivers/usb/host/xhci-plat.c | 42 +++---
>  1 file changed, 27 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index d2a4f2be6a75..9e84992805d6 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -37,6 +37,24 @@ static const struct xhci_driver_overrides 
> xhci_plat_overrides __initconst = {
>   .start = xhci_plat_start,
>  };
> 
> +static void xhci_priv_plat_start(struct usb_hcd *hcd)
> +{
> + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
> +
> + if (priv->plat_start)
> + priv->plat_start(hcd);
> +}
> +
> +static int xhci_priv_init_quirk(struct usb_hcd *hcd)
> +{
> + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
> +
> + if (!priv->init_quirk)
> + return 0;
> +
> + return priv->init_quirk(hcd);
> +}
> +
>  static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
>  {
>   /*
> @@ -52,44 +70,38 @@ static int xhci_plat_setup(struct usb_hcd *hcd)
>  {
>   int ret;
> 
> - if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||
> - xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3)) {
> - ret = xhci_rcar_init_quirk(hcd);
> - if (ret)
> - return ret;
> - }
> 
> - if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_MARVELL_ARMADA)) {
> - ret = xhci_mvebu_mbus_init_quirk(hcd);
> - if (ret)
> - return ret;
> - }
> + ret = xhci_priv_init_quirk(hcd);
> + if (ret)
> + return ret;
> 
>   return xhci_gen_setup(hcd, xhci_plat_quirks);
>  }
> 
>  static int xhci_plat_start(struct usb_hcd *hcd)
>  {
> - if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||
> - xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3))
> - xhci_rcar_start(hcd);
> -
> + xhci_priv_plat_start(hcd);
>   return xhci_run(hcd);
>  }
> 
>  #ifdef CONFIG_OF
>  static const struct xhci_plat_priv xhci_plat_marvell_armada = {
>   .type = XHCI_PLAT_TYPE_MARVELL_ARMADA,
> + .init_quirk = xhci_mvebu_mbus_init_quirk,
>  };
> 
>  static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
>   .type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
>   .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
> + .init_quirk = xhci_rcar_init_quirk,
> + .plat_start = xhci_rcar_start,
>  };
> 
>  static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = {
>   .type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3,
>   .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V2,
> + .init_quirk = xhci_rcar_init_quirk,
> + .plat_start = xhci_rcar_start,
>  };
> 
>  static const struct of_device_id usb_xhci_of_match[] = {
> --
> 2.8.0.rc2
> 
> 
> 
> 
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v2 5/6] usb: host: xhci: plat: make use of new methods in xhci_plat_priv

2016-03-29 Thread Felipe Balbi
Yoshihiro Shimoda  writes:
> [ text/plain ]
> Hi Felipe,
>
> Thank you for the patch!

hey, no problem :-)

>> Sent: Tuesday, March 29, 2016 7:11 PM
> < snip >
>>  static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
>>  .type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
>>  .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
>> +.init_quirk = xhci_rcar_init_quirk,
>>  };
>
> I should have said explicitly before, but the xhci_plat_renesas_rcar_gen2
> also needs ".plat_start = xhci_rcar_start" like the variable of gen3.

good catch, I really missed that one :-)

Here's an updated version of $subject:

8< cut here 

From 33607d25f042d4972dcf2a95f35f051c74b12e51 Mon Sep 17 00:00:00 2001
From: Felipe Balbi 
Date: Tue, 29 Mar 2016 13:03:31 +0300
Subject: [PATCH] usb: host: xhci: plat: make use of new methods in
 xhci_plat_priv

Now that the code has been refactored enough,
switching over to using ->plat_start() and
->init_quirk() becomes a very simple patch.

After this patch, there are no further uses for
xhci_plat_type_is() which will be removed in a
follow-up patch.

Signed-off-by: Felipe Balbi 
---
 drivers/usb/host/xhci-plat.c | 42 +++---
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index d2a4f2be6a75..9e84992805d6 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -37,6 +37,24 @@ static const struct xhci_driver_overrides 
xhci_plat_overrides __initconst = {
.start = xhci_plat_start,
 };
 
+static void xhci_priv_plat_start(struct usb_hcd *hcd)
+{
+   struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
+
+   if (priv->plat_start)
+   priv->plat_start(hcd);
+}
+
+static int xhci_priv_init_quirk(struct usb_hcd *hcd)
+{
+   struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);
+
+   if (!priv->init_quirk)
+   return 0;
+
+   return priv->init_quirk(hcd);
+}
+
 static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
/*
@@ -52,44 +70,38 @@ static int xhci_plat_setup(struct usb_hcd *hcd)
 {
int ret;
 
-   if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||
-   xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3)) {
-   ret = xhci_rcar_init_quirk(hcd);
-   if (ret)
-   return ret;
-   }
 
-   if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_MARVELL_ARMADA)) {
-   ret = xhci_mvebu_mbus_init_quirk(hcd);
-   if (ret)
-   return ret;
-   }
+   ret = xhci_priv_init_quirk(hcd);
+   if (ret)
+   return ret;
 
return xhci_gen_setup(hcd, xhci_plat_quirks);
 }
 
 static int xhci_plat_start(struct usb_hcd *hcd)
 {
-   if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) ||
-   xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3))
-   xhci_rcar_start(hcd);
-
+   xhci_priv_plat_start(hcd);
return xhci_run(hcd);
 }
 
 #ifdef CONFIG_OF
 static const struct xhci_plat_priv xhci_plat_marvell_armada = {
.type = XHCI_PLAT_TYPE_MARVELL_ARMADA,
+   .init_quirk = xhci_mvebu_mbus_init_quirk,
 };
 
 static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
.type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
+   .init_quirk = xhci_rcar_init_quirk,
+   .plat_start = xhci_rcar_start,
 };
 
 static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = {
.type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3,
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V2,
+   .init_quirk = xhci_rcar_init_quirk,
+   .plat_start = xhci_rcar_start,
 };
 
 static const struct of_device_id usb_xhci_of_match[] = {
-- 
2.8.0.rc2




-- 
balbi


signature.asc
Description: PGP signature


RE: [PATCH v2 5/6] usb: host: xhci: plat: make use of new methods in xhci_plat_priv

2016-03-29 Thread Yoshihiro Shimoda
Hi Felipe,

Thank you for the patch!

> Sent: Tuesday, March 29, 2016 7:11 PM
< snip >
>  static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
>   .type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
>   .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
> + .init_quirk = xhci_rcar_init_quirk,
>  };

I should have said explicitly before, but the xhci_plat_renesas_rcar_gen2
also needs ".plat_start = xhci_rcar_start" like the variable of gen3.

< Full code of " xhci_plat_renesas_rcar_gen2" >
static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = {
.type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2,
.firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1,
.init_quirk = xhci_rcar_init_quirk,
.plat_start = xhci_rcar_start,
};

Best regards,
Yoshihiro Shimoda

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html