Re: [PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-07 Thread Leo Yan
On Fri, Jan 06, 2017 at 07:30:28PM -0800, John Youn wrote:
> On 1/6/2017 1:52 PM, John Stultz wrote:
> > On Fri, Jan 6, 2017 at 4:45 AM, Leo Yan  wrote:
> >> Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
> >> changes to type u16 for DT binding "g-rx-fifo-size" and
> >> "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
> >> the first two parameters cannot be passed successfully with wrong data
> >> format. This is found the data transferring broken on 96boards Hikey.
> >>
> >> This patch is to change all parameters to u32 type, and verified on
> >> Hikey board the DT parameters can pass successfully.
> >>
> >> Signed-off-by: Leo Yan 
> > 
> > Nice!
> > 
> > This patch (while it doesn't apply cleanly to v4.10-rc2) does resolve
> > the regression I reported earlier here:
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.spinics.net_lists_linux-2Dusb_msg150766.html=DgIBaQ=DPL6_X_6JkXFx7AXWqB0tg=U3o8uKoKhWme5_V9D-eeCkB11BFwt4KvWztBgdE9ZpA=pIpbe7JcuPH0X7-CYbBt2U3yE2WPSPtrGaMQRtcvQM0=hYurvvfAzlq9WTDnKKUznSRb5thSAvIO9doLJOzfUSo=
> >  
> > 
> > I didn't see the slight shift to u16s there.
> > 
> > Leo, does the patch need a respin, or is it against Linus' HEAD and my
> > tree is stale?

Yeah, I should respin it.

> > Anyway, after re-applying it to my tree:
> > Tested-by: John Stultz 
> > 
> 
> Thanks Leo and John.
> 
> I just sent out a rebased version for Felipe to pick up.

Thanks a lot for both of you :)

> Regards,
> John
> 


Re: [PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-07 Thread Leo Yan
On Fri, Jan 06, 2017 at 07:30:28PM -0800, John Youn wrote:
> On 1/6/2017 1:52 PM, John Stultz wrote:
> > On Fri, Jan 6, 2017 at 4:45 AM, Leo Yan  wrote:
> >> Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
> >> changes to type u16 for DT binding "g-rx-fifo-size" and
> >> "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
> >> the first two parameters cannot be passed successfully with wrong data
> >> format. This is found the data transferring broken on 96boards Hikey.
> >>
> >> This patch is to change all parameters to u32 type, and verified on
> >> Hikey board the DT parameters can pass successfully.
> >>
> >> Signed-off-by: Leo Yan 
> > 
> > Nice!
> > 
> > This patch (while it doesn't apply cleanly to v4.10-rc2) does resolve
> > the regression I reported earlier here:
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.spinics.net_lists_linux-2Dusb_msg150766.html=DgIBaQ=DPL6_X_6JkXFx7AXWqB0tg=U3o8uKoKhWme5_V9D-eeCkB11BFwt4KvWztBgdE9ZpA=pIpbe7JcuPH0X7-CYbBt2U3yE2WPSPtrGaMQRtcvQM0=hYurvvfAzlq9WTDnKKUznSRb5thSAvIO9doLJOzfUSo=
> >  
> > 
> > I didn't see the slight shift to u16s there.
> > 
> > Leo, does the patch need a respin, or is it against Linus' HEAD and my
> > tree is stale?

Yeah, I should respin it.

> > Anyway, after re-applying it to my tree:
> > Tested-by: John Stultz 
> > 
> 
> Thanks Leo and John.
> 
> I just sent out a rebased version for Felipe to pick up.

Thanks a lot for both of you :)

> Regards,
> John
> 


Re: [PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread John Youn
On 1/6/2017 1:52 PM, John Stultz wrote:
> On Fri, Jan 6, 2017 at 4:45 AM, Leo Yan  wrote:
>> Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
>> changes to type u16 for DT binding "g-rx-fifo-size" and
>> "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
>> the first two parameters cannot be passed successfully with wrong data
>> format. This is found the data transferring broken on 96boards Hikey.
>>
>> This patch is to change all parameters to u32 type, and verified on
>> Hikey board the DT parameters can pass successfully.
>>
>> Signed-off-by: Leo Yan 
> 
> Nice!
> 
> This patch (while it doesn't apply cleanly to v4.10-rc2) does resolve
> the regression I reported earlier here:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.spinics.net_lists_linux-2Dusb_msg150766.html=DgIBaQ=DPL6_X_6JkXFx7AXWqB0tg=U3o8uKoKhWme5_V9D-eeCkB11BFwt4KvWztBgdE9ZpA=pIpbe7JcuPH0X7-CYbBt2U3yE2WPSPtrGaMQRtcvQM0=hYurvvfAzlq9WTDnKKUznSRb5thSAvIO9doLJOzfUSo=
>  
> 
> I didn't see the slight shift to u16s there.
> 
> Leo, does the patch need a respin, or is it against Linus' HEAD and my
> tree is stale?
> 
> Anyway, after re-applying it to my tree:
> Tested-by: John Stultz 
> 

Thanks Leo and John.

I just sent out a rebased version for Felipe to pick up.

Regards,
John



Re: [PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread John Youn
On 1/6/2017 1:52 PM, John Stultz wrote:
> On Fri, Jan 6, 2017 at 4:45 AM, Leo Yan  wrote:
>> Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
>> changes to type u16 for DT binding "g-rx-fifo-size" and
>> "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
>> the first two parameters cannot be passed successfully with wrong data
>> format. This is found the data transferring broken on 96boards Hikey.
>>
>> This patch is to change all parameters to u32 type, and verified on
>> Hikey board the DT parameters can pass successfully.
>>
>> Signed-off-by: Leo Yan 
> 
> Nice!
> 
> This patch (while it doesn't apply cleanly to v4.10-rc2) does resolve
> the regression I reported earlier here:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.spinics.net_lists_linux-2Dusb_msg150766.html=DgIBaQ=DPL6_X_6JkXFx7AXWqB0tg=U3o8uKoKhWme5_V9D-eeCkB11BFwt4KvWztBgdE9ZpA=pIpbe7JcuPH0X7-CYbBt2U3yE2WPSPtrGaMQRtcvQM0=hYurvvfAzlq9WTDnKKUznSRb5thSAvIO9doLJOzfUSo=
>  
> 
> I didn't see the slight shift to u16s there.
> 
> Leo, does the patch need a respin, or is it against Linus' HEAD and my
> tree is stale?
> 
> Anyway, after re-applying it to my tree:
> Tested-by: John Stultz 
> 

Thanks Leo and John.

I just sent out a rebased version for Felipe to pick up.

Regards,
John



[PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread John Youn
From: Leo Yan 

Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
changes to type u16 for DT binding "g-rx-fifo-size" and
"g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
the first two parameters cannot be passed successfully with wrong data
format. This is found the data transferring broken on 96boards Hikey.

This patch is to change all parameters to u32 type, and verified on
Hikey board the DT parameters can pass successfully.

[johnyoun: minor rebase]

Signed-off-by: Leo Yan 
Signed-off-by: John Youn 
Tested-by: John Stultz 
---
 drivers/usb/dwc2/core.h   |  4 ++--
 drivers/usb/dwc2/params.c | 10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 9548d3e03453..302b8f5f7d27 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -513,8 +513,8 @@ struct dwc2_core_params {
/* Gadget parameters */
bool g_dma;
bool g_dma_desc;
-   u16 g_rx_fifo_size;
-   u16 g_np_tx_fifo_size;
+   u32 g_rx_fifo_size;
+   u32 g_np_tx_fifo_size;
u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
 };
 
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 11fe68a4627b..bcd1e19b4076 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -385,16 +385,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void 
*param,
 }
 
 /**
- * dwc2_set_param_u16() - Set a u16 parameter
+ * dwc2_set_param_u32() - Set a u32 parameter
  *
  * See dwc2_set_param().
  */
-static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param,
+static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param,
   bool lookup, char *property, u16 legacy,
   u16 def, u16 min, u16 max)
 {
dwc2_set_param(hsotg, param, lookup, property,
-  legacy, def, min, max, 2);
+  legacy, def, min, max, 4);
 }
 
 /**
@@ -1178,12 +1178,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg 
*hsotg,
 * auto-detect if the hardware does not support the
 * default.
 */
-   dwc2_set_param_u16(hsotg, >g_rx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_rx_fifo_size,
   true, "g-rx-fifo-size", 2048,
   hw->rx_fifo_size,
   16, hw->rx_fifo_size);
 
-   dwc2_set_param_u16(hsotg, >g_np_tx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_np_tx_fifo_size,
   true, "g-np-tx-fifo-size", 1024,
   hw->dev_nperio_tx_fifo_size,
   16, hw->dev_nperio_tx_fifo_size);
-- 
2.11.0



[PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread John Youn
From: Leo Yan 

Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
changes to type u16 for DT binding "g-rx-fifo-size" and
"g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
the first two parameters cannot be passed successfully with wrong data
format. This is found the data transferring broken on 96boards Hikey.

This patch is to change all parameters to u32 type, and verified on
Hikey board the DT parameters can pass successfully.

[johnyoun: minor rebase]

Signed-off-by: Leo Yan 
Signed-off-by: John Youn 
Tested-by: John Stultz 
---
 drivers/usb/dwc2/core.h   |  4 ++--
 drivers/usb/dwc2/params.c | 10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 9548d3e03453..302b8f5f7d27 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -513,8 +513,8 @@ struct dwc2_core_params {
/* Gadget parameters */
bool g_dma;
bool g_dma_desc;
-   u16 g_rx_fifo_size;
-   u16 g_np_tx_fifo_size;
+   u32 g_rx_fifo_size;
+   u32 g_np_tx_fifo_size;
u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
 };
 
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 11fe68a4627b..bcd1e19b4076 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -385,16 +385,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void 
*param,
 }
 
 /**
- * dwc2_set_param_u16() - Set a u16 parameter
+ * dwc2_set_param_u32() - Set a u32 parameter
  *
  * See dwc2_set_param().
  */
-static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param,
+static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param,
   bool lookup, char *property, u16 legacy,
   u16 def, u16 min, u16 max)
 {
dwc2_set_param(hsotg, param, lookup, property,
-  legacy, def, min, max, 2);
+  legacy, def, min, max, 4);
 }
 
 /**
@@ -1178,12 +1178,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg 
*hsotg,
 * auto-detect if the hardware does not support the
 * default.
 */
-   dwc2_set_param_u16(hsotg, >g_rx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_rx_fifo_size,
   true, "g-rx-fifo-size", 2048,
   hw->rx_fifo_size,
   16, hw->rx_fifo_size);
 
-   dwc2_set_param_u16(hsotg, >g_np_tx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_np_tx_fifo_size,
   true, "g-np-tx-fifo-size", 1024,
   hw->dev_nperio_tx_fifo_size,
   16, hw->dev_nperio_tx_fifo_size);
-- 
2.11.0



Re: [PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread John Stultz
On Fri, Jan 6, 2017 at 4:45 AM, Leo Yan  wrote:
> Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
> changes to type u16 for DT binding "g-rx-fifo-size" and
> "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
> the first two parameters cannot be passed successfully with wrong data
> format. This is found the data transferring broken on 96boards Hikey.
>
> This patch is to change all parameters to u32 type, and verified on
> Hikey board the DT parameters can pass successfully.
>
> Signed-off-by: Leo Yan 

Nice!

This patch (while it doesn't apply cleanly to v4.10-rc2) does resolve
the regression I reported earlier here:
https://www.spinics.net/lists/linux-usb/msg150766.html

I didn't see the slight shift to u16s there.

Leo, does the patch need a respin, or is it against Linus' HEAD and my
tree is stale?

Anyway, after re-applying it to my tree:
Tested-by: John Stultz 

thanks
-john


Re: [PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread John Stultz
On Fri, Jan 6, 2017 at 4:45 AM, Leo Yan  wrote:
> Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
> changes to type u16 for DT binding "g-rx-fifo-size" and
> "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
> the first two parameters cannot be passed successfully with wrong data
> format. This is found the data transferring broken on 96boards Hikey.
>
> This patch is to change all parameters to u32 type, and verified on
> Hikey board the DT parameters can pass successfully.
>
> Signed-off-by: Leo Yan 

Nice!

This patch (while it doesn't apply cleanly to v4.10-rc2) does resolve
the regression I reported earlier here:
https://www.spinics.net/lists/linux-usb/msg150766.html

I didn't see the slight shift to u16s there.

Leo, does the patch need a respin, or is it against Linus' HEAD and my
tree is stale?

Anyway, after re-applying it to my tree:
Tested-by: John Stultz 

thanks
-john


[PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread Leo Yan
Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
changes to type u16 for DT binding "g-rx-fifo-size" and
"g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
the first two parameters cannot be passed successfully with wrong data
format. This is found the data transferring broken on 96boards Hikey.

This patch is to change all parameters to u32 type, and verified on
Hikey board the DT parameters can pass successfully.

Signed-off-by: Leo Yan 
---
 drivers/usb/dwc2/core.h   |  4 ++--
 drivers/usb/dwc2/params.c | 10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 935ef36..7b2bc39 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -496,8 +496,8 @@ struct dwc2_core_params {
 * properties and cannot be set directly in this structure.
 */
bool g_dma;
-   u16 g_rx_fifo_size;
-   u16 g_np_tx_fifo_size;
+   u32 g_rx_fifo_size;
+   u32 g_np_tx_fifo_size;
u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
 };
 
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index c96ae72..e7b12ef 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -402,16 +402,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void 
*param,
 }
 
 /**
- * dwc2_set_param_u16() - Set a u16 parameter
+ * dwc2_set_param_u32() - Set a u32 parameter
  *
  * See dwc2_set_param().
  */
-static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param,
+static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param,
   bool lookup, char *property, u16 legacy,
   u16 def, u16 min, u16 max)
 {
dwc2_set_param(hsotg, param, lookup, property,
-  legacy, def, min, max, 2);
+  legacy, def, min, max, 4);
 }
 
 /**
@@ -1186,12 +1186,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg 
*hsotg,
 * auto-detect if the hardware does not support the
 * default.
 */
-   dwc2_set_param_u16(hsotg, >g_rx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_rx_fifo_size,
   true, "g-rx-fifo-size", 2048,
   hw->rx_fifo_size,
   16, hw->rx_fifo_size);
 
-   dwc2_set_param_u16(hsotg, >g_np_tx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_np_tx_fifo_size,
   true, "g-np-tx-fifo-size", 1024,
   hw->dev_nperio_tx_fifo_size,
   16, hw->dev_nperio_tx_fifo_size);
-- 
2.7.4



[PATCH] usb: dwc2: use u32 for DT binding parameters

2017-01-06 Thread Leo Yan
Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params")
changes to type u16 for DT binding "g-rx-fifo-size" and
"g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the
the first two parameters cannot be passed successfully with wrong data
format. This is found the data transferring broken on 96boards Hikey.

This patch is to change all parameters to u32 type, and verified on
Hikey board the DT parameters can pass successfully.

Signed-off-by: Leo Yan 
---
 drivers/usb/dwc2/core.h   |  4 ++--
 drivers/usb/dwc2/params.c | 10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 935ef36..7b2bc39 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -496,8 +496,8 @@ struct dwc2_core_params {
 * properties and cannot be set directly in this structure.
 */
bool g_dma;
-   u16 g_rx_fifo_size;
-   u16 g_np_tx_fifo_size;
+   u32 g_rx_fifo_size;
+   u32 g_np_tx_fifo_size;
u32 g_tx_fifo_size[MAX_EPS_CHANNELS];
 };
 
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index c96ae72..e7b12ef 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -402,16 +402,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void 
*param,
 }
 
 /**
- * dwc2_set_param_u16() - Set a u16 parameter
+ * dwc2_set_param_u32() - Set a u32 parameter
  *
  * See dwc2_set_param().
  */
-static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param,
+static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param,
   bool lookup, char *property, u16 legacy,
   u16 def, u16 min, u16 max)
 {
dwc2_set_param(hsotg, param, lookup, property,
-  legacy, def, min, max, 2);
+  legacy, def, min, max, 4);
 }
 
 /**
@@ -1186,12 +1186,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg 
*hsotg,
 * auto-detect if the hardware does not support the
 * default.
 */
-   dwc2_set_param_u16(hsotg, >g_rx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_rx_fifo_size,
   true, "g-rx-fifo-size", 2048,
   hw->rx_fifo_size,
   16, hw->rx_fifo_size);
 
-   dwc2_set_param_u16(hsotg, >g_np_tx_fifo_size,
+   dwc2_set_param_u32(hsotg, >g_np_tx_fifo_size,
   true, "g-np-tx-fifo-size", 1024,
   hw->dev_nperio_tx_fifo_size,
   16, hw->dev_nperio_tx_fifo_size);
-- 
2.7.4