From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753430AbbJZW5J (ORCPT ); Mon, 26 Oct 2015 18:57:09 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:39060 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbbJZW5H convert rfc822-to-8bit (ORCPT ); Mon, 26 Oct 2015 18:57:07 -0400 From: John Youn To: Douglas Anderson , John Youn , "balbi@ti.com" CC: Wu Liang Feng , Yunzhi Li , =?iso-8859-1?Q?Heiko_St=FCbner?= , "linux-rockchip@lists.infradead.org" , Julius Werner , "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066 Thread-Topic: [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066 Thread-Index: AQHRC4/10qHD1DejlEeDM0VUsmvttg== Date: Mon, 26 Oct 2015 22:57:04 +0000 Message-ID: <2B3535C5ECE8B5419E3ECBE30077290901DC3A8D5F@US01WEMBX2.internal.synopsys.com> References: <1445384033-17050-1-git-send-email-dianders@chromium.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.161.105] Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 John