Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3826063pxj; Mon, 7 Jun 2021 22:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAWfbBRCt1zyUKEqUeJ+DqhK4GuttbatHXWENPsXAumm+DMeG7b3RnHhLnFC6fSFwKU59a X-Received: by 2002:a17:907:9721:: with SMTP id jg33mr11822888ejc.64.1623131243894; Mon, 07 Jun 2021 22:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623131243; cv=none; d=google.com; s=arc-20160816; b=o27gC/xaX/3yVZKZl1pYBPSpIksG1dSvoxEdRGC0kOWLJ/IjFhSQEK7AYoFNtoO/Nn jjutz9uJcNMQl2xLVRaBGJUX0ts0oYokJKTnYkTg7ZYXM2JBJCmtHeVOpoY0eFAcv027 fWrc4D8NCmKG5hIWbl/uINnot+YgjKpGQqEXqZ269/XfaGdHAjzUashTm8uNSw4X+bJ9 YoklVvhKFFbXlLeSHZjgzKw7ZyRMwoHvLhpmNcuAZVpewj8Hhr5rxtP67pdsOjwBtQ1o UD5mtMfY1SvjiE6xOw4kF8o0jAfhdaL6B/3MkztE5btc6FoOd9Fm2LZzVYZkyo8sbXZB Mr+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=FTH5irT6do2Mgww4obC31jDBjjRHc32WfJ8ytHIN7i0=; b=JMvTeEnb9K29BR/vGGsU95GLXcJClRWA3cWLmzQWAICGejHJm0+jJRT4ItV8hwCre3 jB9FPs60Hoc+P/zIUgd3Bn0wVzsf/58elm6h7ONueTsyVI5XBNnqFvORj4kFXMzwHxs+ h1dtx2AxF3Legl3FnWdinevOkqyEpcPkuzXUkFKjsHDpGmFbwnYnUT2FrZzVA7wEKr+x 1IDlMzY1imCrsNiD1OPr2zeERb1lRzLBvJUBW6KTZPi24FE+q4+P0pnKO48BeQSwqHfU +EmbPFwLg3GLEBige4E64GDPwAZgPswza38R90jELN00xH849nHLfitl4CU6YpBirJo0 QAHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=bdtkjdPM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec2si14397523ejb.189.2021.06.07.22.47.00; Mon, 07 Jun 2021 22:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=bdtkjdPM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230268AbhFHFrU (ORCPT + 99 others); Tue, 8 Jun 2021 01:47:20 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:40044 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhFHFrQ (ORCPT ); Tue, 8 Jun 2021 01:47:16 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623131124; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=FTH5irT6do2Mgww4obC31jDBjjRHc32WfJ8ytHIN7i0=; b=bdtkjdPMGxhjS057GoBEjREcmZRl4ARbLgakC05oRV08UaTd2DjX/PmgvStG/AzY7o/bvKpg 5qTwmA2zRiqNfVVentwZV4pwDf1SIuA8GMSDLF9ZA1yxpEx5rVTPF2jtLHKxpnOrNRJTZ29M qGQ6hbcynlC+E4zsOzmQ6a7NgtY= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 60bf03dbe570c05619336783 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 08 Jun 2021 05:44:59 GMT Sender: wcheng=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2B98CC433D3; Tue, 8 Jun 2021 05:44:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.110.62.3] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wcheng) by smtp.codeaurora.org (Postfix) with ESMTPSA id 20E97C433D3; Tue, 8 Jun 2021 05:44:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 20E97C433D3 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=wcheng@codeaurora.org Subject: Re: [PATCH v9 0/5] Re-introduce TX FIFO resize for larger EP bursting To: Greg KH , Felipe Balbi Cc: agross@kernel.org, bjorn.andersson@linaro.org, robh+dt@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, jackp@codeaurora.org, Thinh.Nguyen@synopsys.com References: <1621410561-32762-1-git-send-email-wcheng@codeaurora.org> <87k0n9btnb.fsf@kernel.org> From: Wesley Cheng Message-ID: Date: Mon, 7 Jun 2021 22:44:56 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg/Felipe, On 6/4/2021 7:36 AM, Greg KH wrote: > On Fri, Jun 04, 2021 at 05:18:16PM +0300, Felipe Balbi wrote: >> >> Hi, >> >> Greg KH writes: >>> On Wed, May 19, 2021 at 12:49:16AM -0700, Wesley Cheng wrote: >>>> Changes in V9: >>>> - Fixed incorrect patch in series. Removed changes in DTSI, as dwc3-qcom will >>>> add the property by default from the kernel. >>> >>> This patch series has one build failure and one warning added: >>> >>> drivers/usb/dwc3/gadget.c: In function ‘dwc3_gadget_calc_tx_fifo_size’: >>> drivers/usb/dwc3/gadget.c:653:45: warning: passing argument 1 of ‘dwc3_mdwidth’ makes pointer from integer without a cast [-Wint-conversion] >>> 653 | mdwidth = dwc3_mdwidth(dwc->hwparams.hwparams0); >>> | ~~~~~~~~~~~~~^~~~~~~~~~ >>> | | >>> | u32 {aka unsigned int} >>> In file included from drivers/usb/dwc3/debug.h:14, >>> from drivers/usb/dwc3/gadget.c:25: >>> drivers/usb/dwc3/core.h:1493:45: note: expected ‘struct dwc3 *’ but argument is of type ‘u32’ {aka ‘unsigned int’} >>> 1493 | static inline u32 dwc3_mdwidth(struct dwc3 *dwc) >>> | ~~~~~~~~~~~~~^~~ >>> >>> >>> drivers/usb/dwc3/dwc3-qcom.c: In function ‘dwc3_qcom_of_register_core’: >>> drivers/usb/dwc3/dwc3-qcom.c:660:23: error: implicit declaration of function ‘of_add_property’; did you mean ‘of_get_property’? [-Werror=implicit-function-declaration] >>> 660 | ret = of_add_property(dwc3_np, prop); >>> | ^~~~~~~~~~~~~~~ >>> | of_get_property >>> >>> >>> How did you test these? I ran these changes on our internal branches, which were probably missing some of the recent changes done to the DWC3 drivers. Will fix the above compile errors and re-submit. In regards to how much these changes have been tested, we've been maintaining the TX FIFO resize logic downstream for a few years already, so its being used in end products. We also verify this with our internal testing, which has certain benchmarks we need to meet. >> >> to be honest, I don't think these should go in (apart from the build >> failure) because it's likely to break instantiations of the core with >> differing FIFO sizes. Some instantiations even have some endpoints with >> dedicated functionality that requires the default FIFO size configured >> during coreConsultant instantiation. I know of at OMAP5 and some Intel >> implementations which have dedicated endpoints for processor tracing. >> >> With OMAP5, these endpoints are configured at the top of the available >> endpoints, which means that if a gadget driver gets loaded and takes >> over most of the FIFO space because of this resizing, processor tracing >> will have a hard time running. That being said, processor tracing isn't >> supported in upstream at this moment. >> I agree that the application of this logic may differ between vendors, hence why I wanted to keep this controllable by the DT property, so that for those which do not support this use case can leave it disabled. The logic is there to ensure that for a given USB configuration, for each EP it would have at least 1 TX FIFO. For USB configurations which don't utilize all available IN EPs, it would allow re-allocation of internal memory to EPs which will actually be in use. >> I still think this may cause other places to break down. The promise the >> databook makes is that increasing the FIFO size over 2x wMaxPacketSize >> should bring little to no benefit, if we're not maintaining that, I >> wonder if the problem is with some of the BUSCFG registers instead, >> where we configure interconnect bursting and the like. > I've been referring mainly to the DWC3 programming guide for recommendations on how to improve USB performance in: Section 3.3.5 System Bus Features to Improve USB Performance At least when I ran the initial profiling, adjusting the RX/TX thresholds brought little to no benefits. Even in some of the examples, they have diagrams showing a TXFIFO size of 6 max packets (Figure 3-5). I think its difficult to say that the TX fifo resizing won't help in systems with limited, or shared resources where the bus latencies would be somewhat larger. By adjusting the TX FIFO size, the controller would be able to fetch more data from system memory into the memory within the controller, leading to less frequent end of bursts, etc... as data is readily available. In terms of adjusting the AXI/AHB bursting, I would think the bandwidth increase would eventually be constrained based on your system's design. We don't touch the GSBUSCFG registers, and leave them as is based off the recommendations from the HW designers. > Good points. > > Wesley, what kind of testing have you done on this on different devices? > As mentioned above, these changes are currently present on end user devices for the past few years, so its been through a lot of testing :). Thanks Wesley Cheng -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project