Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3617574rdh; Mon, 27 Nov 2023 21:16:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGemOZWl/7ZjV6y6Ge1Wt79g8ggtAgvQ0HKbhKT77OEhsv+TLvNtrrnuC0pViVX7KqxSzVB X-Received: by 2002:a17:90b:1a89:b0:285:93ef:115d with SMTP id ng9-20020a17090b1a8900b0028593ef115dmr18582964pjb.4.1701148602752; Mon, 27 Nov 2023 21:16:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701148602; cv=none; d=google.com; s=arc-20160816; b=eZRhJlrMw6N43Bd/m4KyE5zvFvrSGs2b4Kc8C2u59pJMNJeNdmN0hDipMmr2LIlCDO Ved+L8f489T836n21LcaXsTbaHWR3lWzAhWajdPGnui6+CjJVUS4JtfSICCTV5c4hFdD wg/iu8/a2MEQx5OH68NwFI7URqIPzZNNp7cxwgjuAWsDl6NYcf3zb/RklokR5S/w9Q2g 4ySusr0WId53jJN8IAx6/Hs7COBap0MomhELKee9Qx3rJCY+mUP8EtQXYzjx2WZTEeNU lsPKnjbF/npRccEPv9F8Cd3GFNoj4ZbGDahIsnSQFVf1h9vucWvGW5UTHFiG6xqczbp9 lxUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=w44XPQJG8whRuOhW52t2ddCYVfQ6vovk0yt3lNVpZVk=; fh=pETD0MoQSBkiW4IXfki5XCBBmTiihMczf8cQZytafmI=; b=UpT9uflVC+GtjNyOPVshxzQiVT78vt4VlgadnQjsaUeixBzl0m3zkNo4FCSlgNbB1/ 9udzx/SnYl/b8/+EClYqt5JWZP1TV2cXMZ1yY2xWMp2vNcblOuvkjUP+0BfJSCIjG2QL 0V3STy5C9Ams+j+wASvGSz5QGGd67DwozqMKAyK+9cNgZh0N/oqDRisyBJqg3lAeudR4 bOHECxZgwoUZF48j8ARR1frnJ6je9zMblR3tQj8hhJMTvPA4Yj67UeUaImZ6WFarVuMD +N77kYoZWC1QrPg6sWcdeRIMk2TYi7nBZrNTqHpXnqnSvHrNHaWbGcC/Htd9U8ouhIKF klbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=b36F17bw; 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=quicinc.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j22-20020a17090a7e9600b002747da1ef66si10903680pjl.53.2023.11.27.21.16.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 21:16: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=@quicinc.com header.s=qcppdkim1 header.b=b36F17bw; 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=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BA356804F602; Mon, 27 Nov 2023 21:16:38 -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 S1343512AbjK1FQZ (ORCPT + 99 others); Tue, 28 Nov 2023 00:16:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232891AbjK1FQY (ORCPT ); Tue, 28 Nov 2023 00:16:24 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6FDC1AD; Mon, 27 Nov 2023 21:16:30 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AS4Ku2h010017; Tue, 28 Nov 2023 05:16:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=w44XPQJG8whRuOhW52t2ddCYVfQ6vovk0yt3lNVpZVk=; b=b36F17bwsSrA5xP4Mvjd5chliyfj3R/QXAwFqeSfKIr6SlD2krYJ9DW+Hv6iqvqBi7oe tP70sJaIwIKrasO+G8WWXl1lI+uAtOVp3xQ+G07CJMTSUpV0Gdl42Ih5j1qQxhhA6cRA BtWV3lc6edawK4atV1s8AQlWZJbIpp9mXVF7tVxsIfmzi6kaLYHSuDr/haecPAPu2bn6 hARpOa22i4qBFUjmfKIAFvopFd3exLMUaDawBjfdq2OXmXGq4822SzRnC3jV0R1LHpuu +o7frgTxYOAlNm6tLjRJ3Mo1+CUNk9wmmfiP041vdYluN6nny8nvKBmFKjDky9G23CD1 Mg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3umrqq2j4b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Nov 2023 05:16:00 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AS5FxvH030238 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Nov 2023 05:15:59 GMT Received: from [10.50.30.106] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 27 Nov 2023 21:15:53 -0800 Message-ID: <93319f31-56fc-9a2e-287e-db22286b4125@quicinc.com> Date: Tue, 28 Nov 2023 10:45:49 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH v5 06/10] scsi: ufs: ufs-qcom: Limit HS-G5 Rate-A to hosts with HW version 5 Content-Language: en-US To: Can Guo , , , , , , , CC: , , Andy Gross , Bjorn Andersson , Konrad Dybcio , "James E.J. Bottomley" , "open list" References: <1700729190-17268-1-git-send-email-quic_cang@quicinc.com> <1700729190-17268-7-git-send-email-quic_cang@quicinc.com> From: Nitin Rawat In-Reply-To: <1700729190-17268-7-git-send-email-quic_cang@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: veZrweu3bBHu7n9IOchXX3FtZhglKBxr X-Proofpoint-GUID: veZrweu3bBHu7n9IOchXX3FtZhglKBxr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-28_03,2023-11-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 priorityscore=1501 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxlogscore=976 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311280039 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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:16:41 -0800 (PST) On 11/23/2023 2:16 PM, 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 > --- > 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; > + } > + > + 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); Reviewed-by: Nitin Rawat