Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3630798rdh; Mon, 27 Nov 2023 22:01:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGfAo/6a4chVczEHB/bxPmUxehTDU/uaQBcABu2isXg5A4afU/sWgesC8E0Uhs1JM53Ipp X-Received: by 2002:a05:6808:1211:b0:3b8:3d37:998f with SMTP id a17-20020a056808121100b003b83d37998fmr21292348oil.40.1701151275868; Mon, 27 Nov 2023 22:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701151275; cv=none; d=google.com; s=arc-20160816; b=FIRF6gAduPFrsm800rbW51kbJTBNdL4O5fiFm/mfv3neIgm+LVdCOJOG5fOn1VFr+W NGKQljby37CwfkMBDcnaJk1utemL3GVWQ2dRGYhAxBWMAwcv2ubGqr36ohHoUtRG6haI CoEAiXhx9J32jPIQnnUZIb7cAiCYPz8KPWM4aOONRTwnAKQxpBH1WgBm75TWFaZMhvnq PqSUjiF8tgc12ehnAkgp1cfzKgE31qRUaiVVz8Sassa+O2DwfEpRB2r+PSTLY9yYv0Yr g+uJIU1vYBatHz/SIJF3HX2Pmfdop5emR/qwziefOzdRk2GNS7CiNo2lPk1WgQ8GWvDi v5Fg== 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=rit94cL/f8SMLAN3U3Xxf2vfDomZWfyDo4cGOU0yyek=; fh=fKTaOfNpNriLh2ihNxnJUGHaZRsAsozL4WgZvGInEC4=; b=af/dDMLFN0HFTHn5TnS0elyAh36XtJNVpakQfGY1l3Y4E6RxunQEKY4cSxdHRTI31l iw5xuCgiTqa3lNWY5m/7HhcSVJAMQmEOhYZ4rfiL1o0EDHdnDMX5j/8ZGD0ollL0bQgO PX7qR59/5b8BGz32MelSQhGeYLxOuykIXAkYBHE0sGSWrVwdXdNgxDL2llSvIPhJ+gDB aUEC3/n4Jfqs8Y7GFS23Iw4CgzqcdqPXW76AE0R4BYWSR/b6fVM4ppSz5+tmdeX/XdAI eN1MstwxK7oYF+5M0LTw2MXaftWjgwf/9/KDFOmlGNWhMyoVWFJI3JGeZKJgLU2Jr0Vk PWVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HS4tQajd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b20-20020a63d314000000b005be34495eedsi11351223pgg.118.2023.11.27.22.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 22:01:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HS4tQajd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 9CDC5807782A; Mon, 27 Nov 2023 22:01:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343594AbjK1GA4 (ORCPT + 99 others); Tue, 28 Nov 2023 01:00:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343562AbjK1GAy (ORCPT ); Tue, 28 Nov 2023 01:00:54 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF13DC4 for ; Mon, 27 Nov 2023 22:01:00 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E98BBC433C7; Tue, 28 Nov 2023 06:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701151260; bh=EmSRmB2oOmQQilyIRrm1yWV+Y6rGwVrGp62r+MRCOT0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HS4tQajdUVUFlC6yrPhG5YVFPgqYnCkB3m4xVYKG4vocgoxOSfQx2/4rIGjchvE9p 08UMVKJHXc+J8y8QI942vMt6ioOwPBPhBGjf+Z0shJClxJ7EnguKgAmCkgzgHPqeLn snG0vaXP5us0ok7r2HcwMj0oqPKl15PWaEwQLY0qdcmy0hXzzw3xlzTe7fZJAOYInK 1qNyOPCGe5A9MGkcBUd3pRE1s0HvnWMq44GQvtemFUHQT3/LI9WlYCaUsEPbc36mrP 1oJjGxN0dKFjEUTwEswgCVjR00bEDR4oF4o+bfgTMBR59oAGOocD/ayXJiS8aVYJV2 vEaDVcgMqp0gw== Date: Tue, 28 Nov 2023 11:30:46 +0530 From: Manivannan Sadhasivam To: Can Guo Cc: bvanassche@acm.org, adrian.hunter@intel.com, beanhuo@micron.com, avri.altman@wdc.com, junwoo80.lee@samsung.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , "James E.J. Bottomley" , open list Subject: Re: [PATCH v5 07/10] scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 5 and newer Message-ID: <20231128060046.GH3088@thinkpad> References: <1700729190-17268-1-git-send-email-quic_cang@quicinc.com> <1700729190-17268-8-git-send-email-quic_cang@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1700729190-17268-8-git-send-email-quic_cang@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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 22:01:11 -0800 (PST) On Thu, Nov 23, 2023 at 12:46:27AM -0800, Can Guo wrote: > Set the initial PHY gear to max HS gear for hosts with HW ver 5 and newer. > MAX_GEAR will be used for hosts with hw_ver.major >= 4 > This patch is not changing any functionalities or logic but only a > preparation patch for the next patch in this series. > > Signed-off-by: Can Guo > --- > drivers/ufs/host/ufs-qcom.c | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 6756f8d..7bbccf4 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -1067,6 +1067,20 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba) > hba->quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH; > } > > +static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host) > +{ > + struct ufs_host_params *host_params = &host->host_params; > + > + host->phy_gear = host_params->hs_tx_gear; > + > + /* > + * Power up the PHY using the minimum supported gear (UFS_HS_G2). > + * Switching to max gear will be performed during reinit if supported. You need to reword this comment too. > + */ > + if (host->hw_ver.major < 0x5) As I mentioned above, MAX_GEAR will be used if hw_ver.major is >=4 in ufs_qcom_get_hs_gear(). So this check should be (< 0x4). - Mani > + host->phy_gear = UFS_HS_G2; > +} > + > static void ufs_qcom_set_host_params(struct ufs_hba *hba) > { > struct ufs_qcom_host *host = ufshcd_get_variant(hba); > @@ -1303,6 +1317,7 @@ static int ufs_qcom_init(struct ufs_hba *hba) > ufs_qcom_set_caps(hba); > ufs_qcom_advertise_quirks(hba); > ufs_qcom_set_host_params(hba); > + ufs_qcom_set_phy_gear(host); > > err = ufs_qcom_ice_init(host); > if (err) > @@ -1320,12 +1335,6 @@ static int ufs_qcom_init(struct ufs_hba *hba) > dev_warn(dev, "%s: failed to configure the testbus %d\n", > __func__, err); > > - /* > - * Power up the PHY using the minimum supported gear (UFS_HS_G2). > - * Switching to max gear will be performed during reinit if supported. > - */ > - host->phy_gear = UFS_HS_G2; > - > return 0; > > out_variant_clear: > -- > 2.7.4 > -- மணிவண்ணன் சதாசிவம்