From patchwork Fri Jan 22 18:18:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8091721 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F05F3BEEE5 for ; Fri, 22 Jan 2016 18:19:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 205E52034A for ; Fri, 22 Jan 2016 18:19:57 +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 E5DBE2057F for ; Fri, 22 Jan 2016 18:19:55 +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 1aMgJP-0003yi-Gn; Fri, 22 Jan 2016 18:19:55 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aMgJM-0003t8-LV for linux-rockchip@lists.infradead.org; Fri, 22 Jan 2016 18:19:53 +0000 Received: by mail-pa0-x232.google.com with SMTP id cy9so45424188pac.0 for ; Fri, 22 Jan 2016 10:19:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6pjxN6LWVeFCRVFDXgQ7KszxEzPSb8Qq3gR8qsSm75I=; b=Jgoslk4EoPFcNQpDV5e/Njs+EYkye13IGnuwYseLBrsBSKt/+t3JGbrUf1H024teqt nS507sML5lw/d07Lef0Pt+0ruh4CeoBgaiZrNRf4FU9Qku0fU5Vd1wI4kia14h8lMK8n N494Z2yWpAhKJDX5a1dq345TBV+0Jvov6Kfz4= 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:in-reply-to :references; bh=6pjxN6LWVeFCRVFDXgQ7KszxEzPSb8Qq3gR8qsSm75I=; b=NgyxiDzGFVakEj/QKLC7wObyQ/uUQoQd5Bf5/cO9PTJnomGxksfCecBNXxQxrYfPaz nAiBjwbvnz3hdfAqlrmhB+N60Dd6PuCD7h2gUF98/fq/EsDm+AT2MnxjgOTrzRbhVqED dhtSVbeu+w6iGZBHoyMULqjqGnc7YlG4b09BvC6TR6sSPsQxF5x38DiJ6VYSjSzuBiYn 07QNuzPQ3SvEZdFeD4dIv/tiNfH4sECtYhid2ez4NWz+P4K1O1QyOW27vYx/SJUhX8dt lmg5QkWy+0oWcHG3u1cGvzzIxV7gJ0csAvkilePUgFrQiMDF6jZuGz0mCexaHYJSGAJU jMQA== X-Gm-Message-State: AG10YOS4GTXBQusghh/nFxAu5qbqEpYZdYet1xau/Xm1WjU1bxsKNmWBAJvXFVoRdSudzw== X-Received: by 10.66.149.7 with SMTP id tw7mr6488038pab.72.1453486771913; Fri, 22 Jan 2016 10:19:31 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id y86sm11276415pfa.26.2016.01.22.10.19.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jan 2016 10:19:31 -0800 (PST) From: Douglas Anderson To: John Youn , balbi@ti.com, kever.yang@rock-chips.com Subject: [PATCH v5 03/21] usb: dwc2: host: Set host_rx_fifo_size to 528 for rk3066 Date: Fri, 22 Jan 2016 10:18:38 -0800 Message-Id: <1453486736-15358-4-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1453486736-15358-1-git-send-email-dianders@chromium.org> References: <1453486736-15358-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160122_101952_824064_B28D7437 X-CRM114-Status: GOOD ( 13.63 ) 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: huangtao@rock-chips.com, gregory.herrero@intel.com, heiko@sntech.de, johnyoun@synopsys.com, gregkh@linuxfoundation.org, ming.lei@canonical.com, linux-usb@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, yousaf.kaukab@intel.com, stern@rowland.harvard.edu, william.wu@rock-chips.com, Julius Werner , dinguyen@opensource.altera.com MIME-Version: 1.0 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 As documented in dwc2_calculate_dynamic_fifo(), host_rx_fifo_size should really be: 2 * ((Largest Packet size / 4) + 1 + 1) + n with n = number of host channel. We have 9 host channels, so 2 * ((1024/4) + 2) + 9 = 516 + 9 = 525 We've got 960 / 972 total_fifo_size on rk3288 (and presumably on rk3066) and 525 + 128 + 256 = 909 so we're still under on both ports even when we increment by 5. Since we have space, Kever Yang suggests bumping by 8. He says this will meet INCR16 access and next fifo type can start with a aligned address. ...so let's bump up by 8. In the future, it would be nice if dwc2_calculate_dynamic_fifo() could handle the "too small" FIFO case and come up with something more dynamically. When we do that we can figure out how to allocate the extra 48 / 60 bytes of FIFO that we're currently wasting. NOTE: no known bugs are fixed by this patch, but it seems like a simple fix and ought to fix someone. Signed-off-by: Douglas Anderson Reviewed-by: Kever Yang --- Changes in v5: None Changes in v4: - Set host_rx_fifo_size to 528 for rk3066 new for v4. Changes in v3: None Changes in v2: None drivers/usb/dwc2/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 5008a467ce06..b6d7666e715c 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -126,7 +126,7 @@ static const struct dwc2_core_params params_rk3066 = { .speed = -1, .enable_dynamic_fifo = 1, .en_multiple_tx_fifo = -1, - .host_rx_fifo_size = 520, /* 520 DWORDs */ + .host_rx_fifo_size = 528, /* 528 DWORDs */ .host_nperio_tx_fifo_size = 128, /* 128 DWORDs */ .host_perio_tx_fifo_size = 256, /* 256 DWORDs */ .max_transfer_size = -1,