Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3762414rdh; Tue, 28 Nov 2023 03:16:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBz5FFalyn4YbMBcCnXoC4ohz7ImE1MMOXIqb34IJiMCYmrTLgEAph2MsCsPf0h1jKEEff X-Received: by 2002:a05:6a00:2d28:b0:6cb:daec:8b75 with SMTP id fa40-20020a056a002d2800b006cbdaec8b75mr14639181pfb.22.1701170197927; Tue, 28 Nov 2023 03:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701170197; cv=none; d=google.com; s=arc-20160816; b=Y6y8QMx0P17OO7fdYsRF611QqeEn/A+ELO2RXxCMtdqjZBinsYceD/F2Weg/rh+nro +WQmQsz8MqaBDtSl5URXX1vMBdjwPSa2JZHwPzauPU63XZua8dIGQA1ivW8gqUWT3gbs Oo8xIziMpqinJ85K66MyWHXXrzROwRUzIXYb7WnkvguCVAdRxcAmgo1EHLCnKSt7Wiyj uFjjs2Ai0UKJc5A3a8UPcfgySUouA9VMZVVRA3HUWyonFWHoEv6SEkd4XtNNWggSjGJv sZ/8IRkYG/n3gddSoN7IXBhGIXOVqDwt6dKZi2MrQ7A+wtNtk3JBvnbmn22I7sOYccB4 pH7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=x35iljnvySX+tOsbkdrF2sGaCm5Xv4vJwwmfjVtlNuI=; fh=7vP5qHssQPI5XGFW4bLy45Q0pfZRgV4rrNPMNPMrYP8=; b=W2PwOmWPdt1toBZ63BfhPA83hkPnT5ZwoBHFiAXrPCsXDgXcw2sDjwiupXJGEvAHh2 SGhh+6rDYqvzL5lYTIfqertevZR5TA61ORbjWjWCpF/By4U0kySDtmh3MHN47tPls6/F 6O/fnlevyhd+NgH7w32+EpxnHtMVgokQlMjoOnsSbv746IJhLjHXedOQZhuTRa9hL4xF mUmwzNz5eNVzFIkCKfwo0m7v16yVOX1eDVrxopAw2f9NYxZvmW71UEnPXzCbvRTvlU6U a8dPlR+vsh/BHZ/19RaDg3nrA0d9dya6cyupYa9vYlodXo7G4PyBF+BjkM/ETN/wpzTu YCqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rZNdqWOh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m8-20020a056a00080800b006cb68d85220si12281654pfk.286.2023.11.28.03.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:16:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rZNdqWOh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 21AB9809F3B7; Tue, 28 Nov 2023 03:16:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344510AbjK1LPs (ORCPT + 99 others); Tue, 28 Nov 2023 06:15:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344547AbjK1LPj (ORCPT ); Tue, 28 Nov 2023 06:15:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DD0010CA for ; Tue, 28 Nov 2023 03:15:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 568CBC433C7; Tue, 28 Nov 2023 11:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701170142; bh=3+j71CuhjAOePD46bT+Oifrh9ykcPU2RFbLXXeRFQys=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rZNdqWOh6qU+ZW25NoVDR0ho+3PC8J3JfEp9d+h766C2jbGpO5HIcLr6YeQ0g875U xPFXxdB13sTGHFWZOZDKxFUqZtN8xVGKLLnMalBzIdomBJ0X9klYxzCt223iI74Y0f d+07Tg31Jg5TODNX0V54OQNBF+CGfBC0ppetifmnZWxu9Hfde84vdYYsYPnRSp2PiY R+2+uI0enCq8TAZ4Xyaf5/NOGjVJ5obgM04WQfKcx+HBXIzlZP7YteB1/F4bP5Ad8k qQBKajWstbNG99FyIHBOWU+LuIKGROsMBCMQj0hOnG90h+c2em5TOlbfgpV8S7l7li SMSKHgYBeX7bw== Date: Tue, 28 Nov 2023 16:45:28 +0530 From: Manivannan Sadhasivam To: Can Guo Cc: Ziqi Chen , quic_asutoshd@quicinc.com, bvanassche@acm.org, beanhuo@micron.com, avri.altman@wdc.com, junwoo80.lee@samsung.com, martin.petersen@oracle.com, quic_nguyenb@quicinc.com, quic_nitirawa@quicinc.com, quic_rampraka@quicinc.com, linux-scsi@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , "James E.J. Bottomley" , "open list:ARM/QUALCOMM SUPPORT" , open list Subject: Re: [PATCH] scsi: ufs: qcom: move ufs_qcom_host_reset() to ufs_qcom_device_reset() Message-ID: <20231128111528.GR3088@thinkpad> References: <1698145815-17396-1-git-send-email-quic_ziqichen@quicinc.com> <20231025074128.GA3648@thinkpad> <85d7a1ef-92c4-49ae-afe0-727c1b446f55@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <85d7a1ef-92c4-49ae-afe0-727c1b446f55@quicinc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 28 Nov 2023 03:16:13 -0800 (PST) On Wed, Nov 22, 2023 at 02:14:57PM +0800, Can Guo wrote: > > > On 10/25/2023 3:41 PM, Manivannan Sadhasivam wrote: > > On Tue, Oct 24, 2023 at 07:10:15PM +0800, Ziqi Chen wrote: > > > During PISI test, we found the issue that host Tx still bursting after > > > > What is PISI test? > > > > > H/W reset. Move ufs_qcom_host_reset() to ufs_qcom_device_reset() and > > > reset host before device reset to stop tx burst. > > > > > > > device_reset() callback is supposed to reset only the device and not the host. > > So NACK for this patch. > > Agree, the change should come in a more reasonable way. > > Actually, similar code is already there in ufs_mtk_device_reset() in > ufs-mediatek.c, I guess here is trying to mimic that fashion. > > This change, from its functionality point of view, we do need it, because I > occasionally (2 out of 10) hit PHY error on lane 0 during reboot test (in my > case, I tried SM8350, SM8450 and SM8550, all same). > I do not suspect the intention of this patch, but I do not like the way how it is being done. Even if the reset has to be moved, the patch description should describe how it fixes the issue. - Mani > [ 1.911188] [DEBUG]ufshcd_update_uic_error: UECPA:0x80000002 > [ 1.922843] [DEBUG]ufshcd_update_uic_error: UECDL:0x80004000 > [ 1.934473] [DEBUG]ufshcd_update_uic_error: UECN:0x0 > [ 1.944688] [DEBUG]ufshcd_update_uic_error: UECT:0x0 > [ 1.954901] [DEBUG]ufshcd_update_uic_error: UECDME:0x0 > > I found out that the PHY error pops out right after UFS device gets reset in > the 2nd init. After having this change in place, the PA/DL errors are gone. > > Thanks, > Can Guo. > > > > - Mani > > > > > Signed-off-by: Ziqi Chen > > > --- > > > drivers/ufs/host/ufs-qcom.c | 13 +++++++------ > > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > > > index 96cb8b5..43163d3 100644 > > > --- a/drivers/ufs/host/ufs-qcom.c > > > +++ b/drivers/ufs/host/ufs-qcom.c > > > @@ -445,12 +445,6 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba) > > > struct phy *phy = host->generic_phy; > > > int ret; > > > - /* Reset UFS Host Controller and PHY */ > > > - ret = ufs_qcom_host_reset(hba); > > > - if (ret) > > > - dev_warn(hba->dev, "%s: host reset returned %d\n", > > > - __func__, ret); > > > - > > > /* phy initialization - calibrate the phy */ > > > ret = phy_init(phy); > > > if (ret) { > > > @@ -1709,6 +1703,13 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba) > > > static int ufs_qcom_device_reset(struct ufs_hba *hba) > > > { > > > struct ufs_qcom_host *host = ufshcd_get_variant(hba); > > > + int ret = 0; > > > + > > > + /* Reset UFS Host Controller and PHY */ > > > + ret = ufs_qcom_host_reset(hba); > > > + if (ret) > > > + dev_warn(hba->dev, "%s: host reset returned %d\n", > > > + __func__, ret); > > > /* reset gpio is optional */ > > > if (!host->device_reset) > > > -- > > > 2.7.4 > > > > > -- மணிவண்ணன் சதாசிவம்