Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp280284pxb; Wed, 22 Sep 2021 01:54:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOD+i8ksdJJY2I/5+b6Oma8T28A6AmGCt5UXYLsLK+JTUpdtVK3FX+asDY3GkVzUXWYMX6 X-Received: by 2002:a05:6e02:eb0:: with SMTP id u16mr24746426ilj.178.1632300896289; Wed, 22 Sep 2021 01:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632300896; cv=none; d=google.com; s=arc-20160816; b=MupzZj6QHuPFLCmxWSUdb+o03OogLhz+fCUGkO+UnL+yZG27adtqKk8SeRHyBAsDIp KU6EwB0nkhNMJX6ExI3wrUpYMaCH1ilqT/mIAjazoFvHwjD4DS0sPhKqyB6DREyllHiK s3PbmniLgogdPoa6KWAwHyN7iidk3WaSw3nAytPAR2m5XOoouiIHXb5BzkXT/3MAb22E VhZ67ycQ9wyLnS7e4Qprhu+vnjIZFiojvgJqKYUvXHH40znMUJvoQrjzMz7pndDr1fXH UsyNzSCy6MbvViDcQq4stmP0WJtxS1nKW4x1REOQkh2lZHMoNEReFDpksc5qtqu5tTCx ygdQ== 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=id+uOqWXqh1BzsspNKQReK/0+hKAUXpygQ1iBVBGuvw=; b=nfboF5MsMKtx24ZzIpQA1vDmfxLUPk72hMnBaWAC+JNsMWWNIKq+kZ0rAmoh3Fmgkb o9JUVa0GBIU+lSA2cAwlIUkEHH5lVbWXXdb8FUyVAWM29M3IsPrIgkvl5spE582jKrdQ GJtpH/VgVvrEZT1UeenKj0QiQ2ULBPeosMQiV+mxDFzZSYuWNIekgPMJIMN5pj3djaew GtrUX45BhwauKLpYJUixzuCcoQ86sCISJ96R0q1+Ou1ZiMGyUdi4uXYBYwNw96WMIesE MzUNTcbELu8F/SNxnQsKLXbYqYgJ+zB/Kb4tBhqHensdJeHiFy2cGU3ybo85eg9Kcdux sZAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=RkLxhKm+; 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 h22si1918908jal.57.2021.09.22.01.54.44; Wed, 22 Sep 2021 01:54:56 -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=RkLxhKm+; 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 S234117AbhIVIzK (ORCPT + 99 others); Wed, 22 Sep 2021 04:55:10 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:50168 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234093AbhIVIzI (ORCPT ); Wed, 22 Sep 2021 04:55:08 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1632300819; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=id+uOqWXqh1BzsspNKQReK/0+hKAUXpygQ1iBVBGuvw=; b=RkLxhKm+0mlrVjq5tkTFtnUgqdZvw2vjkrCFCXL0Pb0ZaVKLCccNORYP7+zmb+iDT+O6RkMW xvicJIZ5XbmAcFMT3wNfyXHaNmVVhmrZO5Izpx+SS1UKg1a9SVaeh6C3Wy13P4Hdl449Ol9v GR466eyFs9JXpnd/7P1e80oMkLg= X-Mailgun-Sending-Ip: 69.72.43.7 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-n06.prod.us-west-2.postgun.com with SMTP id 614aef08b585cc7d2461cdf2 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 22 Sep 2021 08:53:28 GMT Sender: wcheng=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 03754C43617; Wed, 22 Sep 2021 08:53:28 +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 autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.6] (cpe-75-80-185-151.san.res.rr.com [75.80.185.151]) (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 36681C43460; Wed, 22 Sep 2021 08:53:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 36681C43460 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=codeaurora.org Subject: Re: dwc3-qcom: tx-fifo-resize regression on Poco F1 (sdm845) with v5.15-rc1 To: Amit Pundir Cc: Felipe Balbi , Greg Kroah-Hartman , Andy Gross , Bjorn Andersson , Rob Herring , Jack Pham , Thinh Nguyen , John Stultz , linux-usb@vger.kernel.org, lkml , linux-arm-msm , dt References: <64a2a428-8bb1-0078-2403-1ca8e28cf4b1@codeaurora.org> <47a06078-dd41-7b3d-3de3-4e6c24211691@codeaurora.org> From: Wesley Cheng Message-ID: Date: Wed, 22 Sep 2021 01:53:25 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Amit, On 9/21/2021 3:18 AM, Amit Pundir wrote: > On Tue, 21 Sept 2021 at 13:00, Wesley Cheng wrote: >> >> Hi Amit, >> >> On 9/21/2021 12:04 AM, Amit Pundir wrote: >>> Hi Wesley, >>> >>> On Tue, 21 Sept 2021 at 02:44, Wesley Cheng wrote: >>>> >>>> Hi Amit, >>>> >>>> On 9/20/2021 1:45 PM, Amit Pundir wrote: >>>>> Hi Wesley, All, >>>>> >>>>> I see a reboot loop on Xiaomi Pocophone F1 (sdm845) with TX FIFO >>>>> resize patches which landed in v5.15-rc1. Upstream commit cefdd52fa045 >>>>> "usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default" to >>>>> be specific, which switched on this feature by default. >>>>> >>>>> At times the phone crashes into the fastboot mode after the reboot >>>>> loop, but mostly end up booting to UI after a while. This is what it >>>>> looks like https://people.linaro.org/~amit.pundir/beryllium-userdebug/PXL_20210920_162749483.mp4. >>>>> >>>> >>>> I believe Android will attempt a number of bootup sequences and if it >>>> fails, it falls back to fastboot mode. Are there any available logs you >>>> might be able to collect to see where the issue is? >>> >>> It is a stock phone with no UART access, so I can't get early crash >>> logs unless I'm booted up to adb shell. I can try getting some info >>> using pstore-ramoops but warm reset support for sdm845 was not >>> upstreamed when I tried using that the last time. >>> >> >> I see, can we maybe avoid the actual resizing by commenting out the >> following writel() calls, but let the fifo resize logic calculate the EPs? >> >> void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc) >> { >> ... >> /* Don't change TXFRAMNUM on usb31 version */ >> size = DWC3_IP_IS(DWC3) ? 0 : >> dwc3_readl(dwc->regs, DWC3_GTXFIFOSIZ(num >> 1)) & >> DWC31_GTXFIFOSIZ_TXFRAMNUM; >> /* Comment the dwc3_writel() */ >> //dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(num >> 1), size); >> >> and >> >> static int dwc3_gadget_resize_tx_fifos(struct dwc3_ep *dep) >> { >> ... >> /* Comment the dwc3_writel() */ >> //dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(dep->number >> 1), fifo_size); >> dwc->num_ep_resized++; >> >> Those 2 writel() would be the one that actually programs the TXFIFO >> register. I hope when commented out, no resize should actually happen >> anymore. >> >> With this, hopefully we can get some logs from the device at least :) > > I can boot fine with above 2 writel() removed but I don't see EP > counts being printed in the log anywhere and the only relevant > message in dmesg I see is this: > > Duplicate name in dwc3@a600000, renamed to "tx-fifo-resize#1" > > which is interesting because I don't see tx-fifo-resize property being > set by any of the upstream sdm845 or relevant dtsi files. > > Thanks for testing. What is the current composition the device is exposing to the host? Can we get a ftrace log w/ the DWC3 events enabled, as well as the kernel log? (if not at boot up then maybe a plug in/out) This will at least help us identify when the DWC3 ep enable is being called (which triggers the resize routine) Thanks Wesley Cheng -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project