Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1252368 > unrolled thread

[PATCH] usb: dwc2: host: Fix ahbcfg for rk3066

Started byDouglas Anderson <dianders@chromium.org>
First post2015-10-21 01:40 +0200
Last post2015-10-30 09:10 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066 Douglas Anderson <dianders@chromium.org> - 2015-10-21 01:40 +0200
    Re: [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066 Heiko Stübner <heiko@sntech.de> - 2015-10-24 15:10 +0200
    Re: [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066 John Youn <John.Youn@synopsys.com> - 2015-10-27 00:00 +0100
    Re: [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066 Liangfeng Wu <wulf@rock-chips.com> - 2015-10-30 09:10 +0100

#1252368 — [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066

FromDouglas Anderson <dianders@chromium.org>
Date2015-10-21 01:40 +0200
Subject[PATCH] usb: dwc2: host: Fix ahbcfg for rk3066
Message-ID<qlOFz-20f-3@gated-at.bofh.it>
The comment for ahbcfg for rk3066 parameters (also used for rk3288)
claimed that ahbcfg was INCR16, but it wasn't.  Since the bits weren't
shifted properly, the 0x7 ended up being masked and we ended up
programming 0x3 for the HBstLen.  Let's set it to INCR16 properly.

As per Wu Liang Feng at Rockchip this may increase transmission
efficiency.  I did blackbox tests with writing 0s to a USB-based SD
reader (forcefully capping CPU Freq to try to measure efficiency):
  cd /sys/devices/system/cpu/cpu0/cpufreq
  echo userspace > scaling_governor
  echo 126000 > scaling_setspeed
  for i in $(seq 10); do
    dd if=/dev/zero of=/dev/sdb bs=1M count=750
  done

With the above tests I found that speeds went from ~15MB/s to ~18MB/s.
Note that most other tests I did (including reading from the same USB
reader) didn't show any difference in performance.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
 drivers/usb/dwc2/platform.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 5859b0f..e61d773 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -108,7 +108,8 @@ static const struct dwc2_core_params params_rk3066 = {
 	.host_ls_low_power_phy_clk	= -1,
 	.ts_dline			= -1,
 	.reload_ctl			= -1,
-	.ahbcfg				= 0x7, /* INCR16 */
+	.ahbcfg				= GAHBCFG_HBSTLEN_INCR16 <<
+					  GAHBCFG_HBSTLEN_SHIFT,
 	.uframe_sched			= -1,
 	.external_id_pin_ctl		= -1,
 	.hibernation			= -1,
-- 
2.6.0.rc2.230.g3dd15c0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1255177

FromHeiko Stübner <heiko@sntech.de>
Date2015-10-24 15:10 +0200
Message-ID<qn6K5-1az-7@gated-at.bofh.it>
In reply to#1252368
Am Dienstag, 20. Oktober 2015, 16:33:53 schrieb Douglas Anderson:
> The comment for ahbcfg for rk3066 parameters (also used for rk3288)
> claimed that ahbcfg was INCR16, but it wasn't.  Since the bits weren't
> shifted properly, the 0x7 ended up being masked and we ended up
> programming 0x3 for the HBstLen.  Let's set it to INCR16 properly.
> 
> As per Wu Liang Feng at Rockchip this may increase transmission
> efficiency.  I did blackbox tests with writing 0s to a USB-based SD
> reader (forcefully capping CPU Freq to try to measure efficiency):
>   cd /sys/devices/system/cpu/cpu0/cpufreq
>   echo userspace > scaling_governor
>   echo 126000 > scaling_setspeed
>   for i in $(seq 10); do
>     dd if=/dev/zero of=/dev/sdb bs=1M count=750
>   done
> 
> With the above tests I found that speeds went from ~15MB/s to ~18MB/s.
> Note that most other tests I did (including reading from the same USB
> reader) didn't show any difference in performance.
> 
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

I gave this a spin on a rk3288-firefly, runs fine and doesn't have any 
negative effects, so

Tested-by: Heiko Stuebner <heiko@sntech.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1256333

FromJohn Youn <John.Youn@synopsys.com>
Date2015-10-27 00:00 +0100
Message-ID<qnYUa-5Ev-1@gated-at.bofh.it>
In reply to#1252368
On 10/20/2015 4:35 PM, Douglas Anderson wrote:
> The comment for ahbcfg for rk3066 parameters (also used for rk3288)
> claimed that ahbcfg was INCR16, but it wasn't.  Since the bits weren't
> shifted properly, the 0x7 ended up being masked and we ended up
> programming 0x3 for the HBstLen.  Let's set it to INCR16 properly.
> 
> As per Wu Liang Feng at Rockchip this may increase transmission
> efficiency.  I did blackbox tests with writing 0s to a USB-based SD
> reader (forcefully capping CPU Freq to try to measure efficiency):
>   cd /sys/devices/system/cpu/cpu0/cpufreq
>   echo userspace > scaling_governor
>   echo 126000 > scaling_setspeed
>   for i in $(seq 10); do
>     dd if=/dev/zero of=/dev/sdb bs=1M count=750
>   done
> 
> With the above tests I found that speeds went from ~15MB/s to ~18MB/s.
> Note that most other tests I did (including reading from the same USB
> reader) didn't show any difference in performance.
> 
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>  drivers/usb/dwc2/platform.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 5859b0f..e61d773 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -108,7 +108,8 @@ static const struct dwc2_core_params params_rk3066 = {
>  	.host_ls_low_power_phy_clk	= -1,
>  	.ts_dline			= -1,
>  	.reload_ctl			= -1,
> -	.ahbcfg				= 0x7, /* INCR16 */
> +	.ahbcfg				= GAHBCFG_HBSTLEN_INCR16 <<
> +					  GAHBCFG_HBSTLEN_SHIFT,
>  	.uframe_sched			= -1,
>  	.external_id_pin_ctl		= -1,
>  	.hibernation			= -1,
> 


Acked-by: John Youn <johnyoun@synopsys.com>


John

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259291

FromLiangfeng Wu <wulf@rock-chips.com>
Date2015-10-30 09:10 +0100
Message-ID<qpcV3-3mx-15@gated-at.bofh.it>
In reply to#1252368
On 10/21/2015 07:33 AM, Douglas Anderson wrote:
> The comment for ahbcfg for rk3066 parameters (also used for rk3288)
> claimed that ahbcfg was INCR16, but it wasn't.  Since the bits weren't
> shifted properly, the 0x7 ended up being masked and we ended up
> programming 0x3 for the HBstLen.  Let's set it to INCR16 properly.
>
> As per Wu Liang Feng at Rockchip this may increase transmission
> efficiency.  I did blackbox tests with writing 0s to a USB-based SD
> reader (forcefully capping CPU Freq to try to measure efficiency):
>    cd /sys/devices/system/cpu/cpu0/cpufreq
>    echo userspace > scaling_governor
>    echo 126000 > scaling_setspeed
>    for i in $(seq 10); do
>      dd if=/dev/zero of=/dev/sdb bs=1M count=750
>    done
>
> With the above tests I found that speeds went from ~15MB/s to ~18MB/s.
> Note that most other tests I did (including reading from the same USB
> reader) didn't show any difference in performance.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>   drivers/usb/dwc2/platform.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 5859b0f..e61d773 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -108,7 +108,8 @@ static const struct dwc2_core_params params_rk3066 = {
>   	.host_ls_low_power_phy_clk	= -1,
>   	.ts_dline			= -1,
>   	.reload_ctl			= -1,
> -	.ahbcfg				= 0x7, /* INCR16 */
> +	.ahbcfg				= GAHBCFG_HBSTLEN_INCR16 <<
> +					  GAHBCFG_HBSTLEN_SHIFT,
>   	.uframe_sched			= -1,
>   	.external_id_pin_ctl		= -1,
>   	.hibernation			= -1,

Reviewed-by:  Liangfeng Wu <wulf@rock-chips.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web