From patchwork Fri Jan 29 02:19:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 8157491 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 9C547BEEE5 for ; Fri, 29 Jan 2016 02:21:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A57B020374 for ; Fri, 29 Jan 2016 02:21:10 +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 DAE2520265 for ; Fri, 29 Jan 2016 02:21:09 +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 1aOygO-0006me-S7; Fri, 29 Jan 2016 02:21:08 +0000 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOygF-0006fZ-Vm for linux-rockchip@lists.infradead.org; Fri, 29 Jan 2016 02:21:03 +0000 Received: by mail-pf0-x22a.google.com with SMTP id n128so33245136pfn.3 for ; Thu, 28 Jan 2016 18:20:39 -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=HCZ0p2hK+VhOLeyAZDIsN35PfMhHlLexWuyEr/A4lGk=; b=IOfTXQinxY9fOOf63iHgwQNXKC4UePf9L/dp/28A+jedS/pO/ei8und9kYdRvjSpT0 HpCUF4pD+1f6jt5qMMVlNkLHaOl5ahUXRyGujqLbor59P9S+T1fZCQagNFsP6Tj6Mv7B RmjsbYt0izXvMb85L8q25MGZHNT2NpKnz0fgQ= 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=HCZ0p2hK+VhOLeyAZDIsN35PfMhHlLexWuyEr/A4lGk=; b=DTvhgZ5+TdtJdhiRU/n5APaHYCgqloafwzcREp6UY5m+JhHIfzEBJ0mQT76MuX9FTA L/rbgdfQhaRlonTALSV6oqbkrnve0Trih0z3Gxcie5FIQPKIYD8zzNzTYyIjWRlqjwRO pEyUqtBC6gL6KkjMfkGAyNfkoasURw3SwKvxBpJ1wc3VJMo31aPWETvmxVvYD5XEQ7nk LErlN7xJNGhSmhLV818xqoZICK1Um9vFv7+tUD7yQKTavusRpogQ57gm3+Nc5mOh1xHw oD940q/DEiAjUx8f70ligo+smetsj2euwx+Kv6EMp/zvKe3txEPtJUUxOhTT5tdTW+An 35Gw== X-Gm-Message-State: AG10YOQQoI8EMp8cjhPXUGqG6aaH6u0Q5edSGcI662QxOQCxLEnWvxSkjLMJo0aR93jTgw== X-Received: by 10.98.71.147 with SMTP id p19mr6841015pfi.165.1454034039342; Thu, 28 Jan 2016 18:20:39 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by smtp.gmail.com with ESMTPSA id ux2sm19314864pac.46.2016.01.28.18.20.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 18:20:38 -0800 (PST) From: Douglas Anderson To: John Youn , balbi@ti.com, kever.yang@rock-chips.com Subject: [PATCH v6 03/22] usb: dwc2: host: Set host_rx_fifo_size to 525 for rk3066 Date: Thu, 28 Jan 2016 18:19:54 -0800 Message-Id: <1454034013-24657-4-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1454034013-24657-1-git-send-email-dianders@chromium.org> References: <1454034013-24657-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160128_182100_047726_C7905FDA X-CRM114-Status: GOOD ( 13.15 ) 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, stefan.wahren@i2se.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, linux-rpi-kernel@lists.infradead.org, gregory.herrero@intel.com, 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. 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 Tested-by: Heiko Stuebner --- Changes in v6: - Back to 525 dwords, not 528. - Add Kever's Reviewed-by. - Add Heiko's Tested-by. 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..b277e521a311 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 = 525, /* 525 DWORDs */ .host_nperio_tx_fifo_size = 128, /* 128 DWORDs */ .host_perio_tx_fifo_size = 256, /* 256 DWORDs */ .max_transfer_size = -1,