From patchwork Tue Oct 20 23:33:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 7453811 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1C1C39F302 for ; Tue, 20 Oct 2015 23:35:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3DAD620898 for ; Tue, 20 Oct 2015 23:35:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C754F20892 for ; Tue, 20 Oct 2015 23:35:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZogRJ-0001ZU-Rm; Tue, 20 Oct 2015 23:35:33 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZogRH-0001YO-Mu for linux-rockchip@lists.infradead.org; Tue, 20 Oct 2015 23:35:32 +0000 Received: by padhk11 with SMTP id hk11so35033449pad.1 for ; Tue, 20 Oct 2015 16:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=2PiB2ErcXGEpKakky0MBvs8oPZGpZAp1eLew3/o5UbU=; b=n14pHklRUqFJnlZKkutnAUMJweD6E4kBDfT2Q8LG5ht5OgNstxbPfiNhAsHHSMcdN+ g6yKd3byRXG5itDudKdsu7HZTXCD2QAg1U52LSNIfauzJnRBTxyUuEtBQ4b6/5B8YN7W ZKiHXJnsznkH+0CIYBPuTqDeWUKvQFn1DftQs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=2PiB2ErcXGEpKakky0MBvs8oPZGpZAp1eLew3/o5UbU=; b=L30z7o+xwRaWBacHWynELXRZZLHKFXDotbLZNWayyRZQusoNqHoJX2pPIxErV/t8Pw q8Di1K+8Wl+o3DWA08DWxojo+REb2ko7rM+dg2Y6a/HYy74HYWnddqfp8yffpx2ltEO3 w7qFrGaGRoB+NtzsHr6BzdISSORJqfT776Rsz319QvzMOgprmOU+ERX0Xsfu4+q5Q7fC +l7rJzWeR691U65aNHWZ4bzFNcbjWNMevf0odFlrGWIALbexkrWAqbNsdDYuCs2tr2nQ 9NdYTu6gXDSAjv3N6d16SVhBQz8oX9yb5HCt284lBPqbnaoxQ4yWZZN1Fc8OrQ5oh0LD X3qA== X-Gm-Message-State: ALoCoQlBTdzbYPBHu6EWCGBUGtTVoYNRhQifR61uWI/hoxGDlwKMH0Nu3GP3xxt/nQfzz0vqh7P8 X-Received: by 10.67.7.195 with SMTP id de3mr6932366pad.72.1445384108670; Tue, 20 Oct 2015 16:35:08 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id mk5sm5716674pab.44.2015.10.20.16.35.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Oct 2015 16:35:08 -0700 (PDT) From: Douglas Anderson To: John Youn , balbi@ti.com Subject: [PATCH] usb: dwc2: host: Fix ahbcfg for rk3066 Date: Tue, 20 Oct 2015 16:33:53 -0700 Message-Id: <1445384033-17050-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151020_163531_785865_4F61E590 X-CRM114-Status: GOOD ( 14.10 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Heiko=20St=C3=BCbner?= , johnyoun@synopsys.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Yunzhi Li , Julius Werner , Wu Liang Feng Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Heiko Stuebner Acked-by: John Youn Reviewed-by: Liangfeng Wu --- 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,