Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3628868rdh; Mon, 27 Nov 2023 21:55:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDfvfz4PYt8UucSOZ6nqx7Vg3bXBT5aSY3Z+Oem6MwIxbh/kPWNIBR24zmhmOvWQUT5C7a X-Received: by 2002:a17:90b:4f4a:b0:285:a163:c24c with SMTP id pj10-20020a17090b4f4a00b00285a163c24cmr12118950pjb.36.1701150942863; Mon, 27 Nov 2023 21:55:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701150942; cv=none; d=google.com; s=arc-20160816; b=TGFR0QYSHCMOp1SFAP0JwuPDFXPZUOcLNvLT9cDw+iq+7pmWzF1wwCPX6lnwRoCJtT mH2IRNAV/njH1XoF+b37PU2S18BSYsELrN//t5EnaojRB5xWm6zV3EQelNHExsQVAVAD cTwldnavQwbouoMqZzQ7bZci4OHZ4cUEwqS40QnWOb8QkhU4eU/UHWDJ73h/a6t/io54 buinyK7hNNzDx1zqQodfUZkSCHLXGTpMSLL0r+DbzHK7PPq6NTHFOImuAXPBxNCGTd8N 5C+bxN8pWNj7tPPhTbXls/5y0THSaWgw4pFkj2mVnsCMmcYRChGUN5UzXd3M5PG4THBN Wt6Q== 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=pxWp32vDUceavSp0DfvEVXFJhaa9qZ7tNOb+KACr6Cw=; fh=fKTaOfNpNriLh2ihNxnJUGHaZRsAsozL4WgZvGInEC4=; b=ynIFiI7mBh8TE9JdL591hF9vLEJsDMackFxhC1+dDzqKR2yOLD9wA9RAULWCtxe7p/ 2eO5vNaCnV8JIaH6W3YJ01awB21/zXsTypN3GRCU/dMF3EkPEjTUbn9+JlVosoUGS5eh KBqZlhI+sufGT6BFfUZhgrNYFuYh39aEkWkGU1GSvqDY+62ZvztMnZQxqx91uP5ZEGAh 5Rus/tg4nIydUWh54Nl4ETwWjpK2opZ6KwP/86oBGWcf8C1HKqt4OmgRJT4mKzkWcPiu jBlwBk5YPiK5Yq0SpQoWcQsiChdjCiJjzFmuJ8Gs9V5xPMDZmp9ArVyA23E+5eH8aCr3 90xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gn1ehWoe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t2-20020a17090aba8200b00285bb015802si5025920pjr.131.2023.11.27.21.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 21:55:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gn1ehWoe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 9ED27804E834; Mon, 27 Nov 2023 21:55:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343605AbjK1Fzc (ORCPT + 99 others); Tue, 28 Nov 2023 00:55:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343595AbjK1Fza (ORCPT ); Tue, 28 Nov 2023 00:55:30 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96BE9C4 for ; Mon, 27 Nov 2023 21:55:36 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37205C433C7; Tue, 28 Nov 2023 05:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701150936; bh=PpSPC0i09cHtjnQAsG5mVOmu+DNSXaW6HtY35gGeIfA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gn1ehWoed/7O6HrcD+PwXoxBUFjoqenSCYWbctGrrABKhCJNRWNqdjxERDb00dpd0 aieTbP3E9+QhIQ4HARG6jv4uD8ymtz4dbmWS3dmllBSLdBLNUsPKip9eJq7OXPkpTz WWTBL4ovN6k3zCAtg7sfXAG5m9VKHM2pExOJXhcKKbsvpct9AIGPz6kDen/qqTj4IX 3dXee8Mj3nxxWtpYmWG40HEwpPEUE3cI9zhonTDbE/KvW3KkLIvGSqZWLVfYKo8iHe NijjYZULu6YF9UZ9qZXswH0wXZypk7/BvbqZXyuvedbV0iRKaMk5qzrL6Nlj0lvlEF +Rs9Y6F/b74BA== Date: Tue, 28 Nov 2023 11:25:20 +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 06/10] scsi: ufs: ufs-qcom: Limit HS-G5 Rate-A to hosts with HW version 5 Message-ID: <20231128055520.GG3088@thinkpad> References: <1700729190-17268-1-git-send-email-quic_cang@quicinc.com> <1700729190-17268-7-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-7-git-send-email-quic_cang@quicinc.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 21:55:41 -0800 (PST) On Thu, Nov 23, 2023 at 12:46:26AM -0800, Can Guo wrote: > Qcom UFS hosts, with HW ver 5, can only support up to HS-G5 Rate-A due to > HW limitations. If the HS-G5 PHY gear is used, update host_params->hs_rate > to Rate-A, so that the subsequent power mode changes shall stick to Rate-A. > > Signed-off-by: Can Guo Reviewed-by: Manivannan Sadhasivam One question below... > --- > drivers/ufs/host/ufs-qcom.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 9613ad9..6756f8d 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -442,9 +442,25 @@ static u32 ufs_qcom_get_hs_gear(struct ufs_hba *hba) > static int ufs_qcom_power_up_sequence(struct ufs_hba *hba) > { > struct ufs_qcom_host *host = ufshcd_get_variant(hba); > + struct ufs_host_params *host_params = &host->host_params; > struct phy *phy = host->generic_phy; > + enum phy_mode mode; > int ret; > > + /* > + * HW ver 5 can only support up to HS-G5 Rate-A due to HW limitations. > + * If the HS-G5 PHY gear is used, update host_params->hs_rate to Rate-A, > + * so that the subsequent power mode change shall stick to Rate-A. > + */ > + if (host->hw_ver.major == 0x5) { > + if (host->phy_gear == UFS_HS_G5) > + host_params->hs_rate = PA_HS_MODE_A; > + else > + host_params->hs_rate = PA_HS_MODE_B; Is this 'else' part really needed? Since there wouldn't be any 2nd init, I think we can skip that. - Mani > + } > + > + mode = host_params->hs_rate == PA_HS_MODE_B ? PHY_MODE_UFS_HS_B : PHY_MODE_UFS_HS_A; > + > /* Reset UFS Host Controller and PHY */ > ret = ufs_qcom_host_reset(hba); > if (ret) > @@ -459,7 +475,7 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba) > return ret; > } > > - phy_set_mode_ext(phy, PHY_MODE_UFS_HS_B, host->phy_gear); > + phy_set_mode_ext(phy, mode, host->phy_gear); > > /* power on phy - start serdes and phy's power and clocks */ > ret = phy_power_on(phy); > -- > 2.7.4 > -- மணிவண்ணன் சதாசிவம்