From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966960AbcA0TpH (ORCPT ); Wed, 27 Jan 2016 14:45:07 -0500 Received: from mail-yk0-f180.google.com ([209.85.160.180]:34929 "EHLO mail-yk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966114AbcA0To1 (ORCPT ); Wed, 27 Jan 2016 14:44:27 -0500 MIME-Version: 1.0 In-Reply-To: <56A89838.3040202@rock-chips.com> References: <1453486736-15358-1-git-send-email-dianders@chromium.org> <1453486736-15358-4-git-send-email-dianders@chromium.org> <56A89838.3040202@rock-chips.com> Date: Wed, 27 Jan 2016 11:44:26 -0800 X-Google-Sender-Auth: NICbUaLIepRZFR6_g20WUe054Y8 Message-ID: Subject: Re: [PATCH v5 03/21] usb: dwc2: host: Set host_rx_fifo_size to 528 for rk3066 From: Doug Anderson To: Kever Yang Cc: John Youn , Felipe Balbi , =?UTF-8?B?5ZC06Imv5bOw?= , Tao Huang , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "open list:ARM/Rockchip SoC..." , Julius Werner , "Herrero, Gregory" , "Kaukab, Yousaf" , Dinh Nguyen , Alan Stern , Ming Lei , John Youn , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kever, On Wed, Jan 27, 2016 at 2:13 AM, Kever Yang wrote: > Hi Doug, > > On 01/23/2016 02:18 AM, Douglas Anderson wrote: >> >> 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. > > I have double check this feature, the INCR16 is actually a burst 16 > on to the bus, the aligned problem only happen on the DRAM > access, and it's OK for internal RAM access via internal DMA. > > Bump to 8 looks much better when we check the FIFO setting if we > have enough memory, right? :) > > rk3066/rk3188/rk3288 have the same hw config for dwc2 controller, > so this patch should works on those files. > > Reviewed-by: Kever Yang Thanks for double-checking and thanks for the review! If it's all the same to you, I'll probably change it back to 525 and then increase the periodic FIFO size by 3 DWORDS in the next patch. 12 bytes may not be much, but might as well make use of them to improve performance / compatibility? Presumably you're also OK with the next patch in the series: ("usb: dwc2: host: Set host_perio_tx_fifo_size to 304 for rk3066")? Note to anyone who may be thinking of applying patches in this series: * You can skip both this and the next patch if you wish and any other patches in the series are unaffected. * You can request that I spin just these two patches and I will do it ASAP. Otherwise I'll add that fix to the next spin of the whole series. * You can make the changes yourself to this patch and the next one (this patch should be 525 and the next should increase host_perio_tx_fifo_size to 307). I'm OK with any of those 3 things. ;) -Doug