Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3672688rdh; Mon, 27 Nov 2023 23:59:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN4mEJ/bPtIzNmfVyY1M8V9eEjDFHMNccUPecCcT+HclZS432DyTG/n1gqjKFNojvYuO/n X-Received: by 2002:a05:6808:1d2:b0:3a8:74bf:8977 with SMTP id x18-20020a05680801d200b003a874bf8977mr15135063oic.56.1701158362663; Mon, 27 Nov 2023 23:59:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701158362; cv=none; d=google.com; s=arc-20160816; b=EbVHYak0pvb3y+HBUAyMXgtuW+pjq904yHwfVeAzBUFw5w13BZJ6lESeLqHFoCjZIf dkgmfvQBGHH+pnLi452923o2gA+9j0K5H0z9o2g/MlA3A/Sh4T2js3phK1gnKs/qX/Re xsKFdFqhI2NnnmVwVfGVdm7bAJINw5M37r7uRv0zgM1iLqA4Z+g+P1EP8LbMsuMFhrUR skaK42pDnKeOTPmqXquw1w+tpIJRqRDLKMq+41a887YvWi6hqsXQamEM8NQYB7IqLwaj G/a1bD6vmFjyAoZAkGq5zhXeVbkcEmEtux8IV0FphRoimOXT18eh6u78dUvaiU370fD1 dAIg== 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=iP4D1xc8qjOBWc18n0ipl4FCtPM7EFhZSPIDx8Ekxhk=; fh=YM0LD5VqvpMoleWDnL4CsnePzsLh2CfZ9fu6cAHHlME=; b=IVITab1hHjjfQD6213VOdO4Uc4tP8eIT20D4hG3pOVaU3Sp3NFKg3iXuXC/21e4FLu Fnfofzx0wNik145YMyfhEFDh/snVLiTqZp5winhIDTu4MQSloOV0U5LyhXSUAX/IIOce /Cb5ZSpSJLSoiW/1qfGH3ZQUj9bFizUSj6lsGN/ly4+N9MIvO+LA14KLlPqx9DmSfGXj TyF1PArzIVtAfmdtTCsbLwBbz4kviH/M3bh/YdUYIybTnGk413yyjwAOoasHrhgpVXBp sQ1QUOTDFI/+Gzkwe7UX6DqYEknQsinVnUxsuuaLeueh3tG2w7iTFPzsew46xcqN9CLf 4Pjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BDiPfUU2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z37-20020a631925000000b005be0ff4f8cdsi11118102pgl.288.2023.11.27.23.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 23:59:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BDiPfUU2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 34F148058B66; Mon, 27 Nov 2023 23:59:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbjK1H7G (ORCPT + 99 others); Tue, 28 Nov 2023 02:59:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjK1H7F (ORCPT ); Tue, 28 Nov 2023 02:59:05 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7DEC98; Mon, 27 Nov 2023 23:59:11 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AS6GqE8001089; Tue, 28 Nov 2023 07:58:49 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=iP4D1xc8qjOBWc18n0ipl4FCtPM7EFhZSPIDx8Ekxhk=; b=BDiPfUU2RMhctcIXaJbw5B2AMsTuGrtKM7+UiQz3hViKlg0ktB63NNVNVDGgn33ApBT2 1fDEdK7mTUhEH4ImeVBFqgLLzraMRlHw6UT2TNX4JgfN+eY14SB3eEYYKThU/GwbgfNe 50WVPCTw5U9OuDkeTGbJamnxc9siBc6BDIBjhqJodAs1/EGZJBKg8hYj5mptB0VelLLX jPU1/t75DS/ljMLwjc46d5d2YpR17PBrxW7i+KMO1nBHmWiKGPTri9qGxbrAddHEmjWV 2OXAFjrq8noGCDXyoqceKcNk8xyHrZuOSDdlV7r2PShly/4be8i/QPtvjRcD4EoldG0z vw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3umt4qjrwr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Nov 2023 07:58:49 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AS7wmWH023979 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Nov 2023 07:58:48 GMT Received: from [10.253.11.37] (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 23:58:45 -0800 Message-ID: Date: Tue, 28 Nov 2023 15:58:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 07/10] scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 5 and newer Content-Language: en-US To: Manivannan Sadhasivam 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-8-git-send-email-quic_cang@quicinc.com> <20231128060046.GH3088@thinkpad> From: Can Guo In-Reply-To: <20231128060046.GH3088@thinkpad> 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: 9qe8RAQpKU5XAiM3wLaKj1tHqJi6QOzm X-Proofpoint-GUID: 9qe8RAQpKU5XAiM3wLaKj1tHqJi6QOzm 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_06,2023-11-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311280061 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 27 Nov 2023 23:59:20 -0800 (PST) Hi Mani, On 11/28/2023 2:00 PM, Manivannan Sadhasivam wrote: > 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 I put it > 5 because I am not intent to touch any old targets which has proven working fine with starting with PHY gear HS_G2. If I put it >= 4, there would be many targets impacted by this change. I need to go back and test those platforms (HW ver == 4). Thanks, Can Guo. > >> 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 >> >