Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2579621rdf; Mon, 6 Nov 2023 20:48:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfgjrEkkWI+QZWGco7qcWMXS7SlLmNKaJ+c3NwiTjUKAsSBei2x3fM45nXSifDXQ/A30hC X-Received: by 2002:a17:903:2450:b0:1cc:70e4:28e9 with SMTP id l16-20020a170903245000b001cc70e428e9mr18961984pls.49.1699332497036; Mon, 06 Nov 2023 20:48:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699332497; cv=none; d=google.com; s=arc-20160816; b=voLOULp9JS0tSapCqlPq4bZ1M4Z1qJUqeWUG2gfirsxqHdq9Yoi7s4F0L22a/oVxVI CbwyFBPBHFY6irV0qS08TB/PA32AU9xEjh2xjycoYcZgrEMX0ri/kDYxDkxgV9Lhkf6S RjWaqj4C6KvCsTtif6JX4c5R1ZuKAeDkXyi8d4e0qyGX81QBKJbvIWkTwpcw3scY+uQY /fs/uAyYliXxOyFenTXA2dmMhMqfJOOGY7glkycyw/VhfGRc/jjegTLDZGYka5us5Rrz u0g5+OkOUGKLHRYuA8HtmDsuhSYmwWT01k3rc2XoSkOdCuyktCH+ApEE4vWGbu2k/833 wKYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=4oCdX+o+C4WN1iHUVi8rtCosO3nRaCMx/0gq4hRLvCQ=; fh=8bV6FCFG/N/2jxXoFdmypf6Ntw3OxS1Jhr+g1hXsEvY=; b=dS1CKEw+qNUkQoxrzKlw7QyA3OfQIgxGS5fhanPTAmEKvyYd5txsU92hUcnBbt+ymt KvDDOBP8huMgm1cqUcW994fj6DNtMqaYGpDDFqdDU9Wsl/3GxGTxeg+X5qn16R5Nk+5x vbXTOWyubceQ2HwwSdS4Za5kwtNhBHdwdpT2Zy4CRE6ljeXy7poYVQ+evaploqhUO+hA GqhPrhPt5hN3n+Ip672UHOVt86TDTa5CM6DZwoBxUa23i16JFtc4lzr7bQos4iAZPniy AGkpevMe2usb+CZeLQrHXpclSOfxjQZipn3dy3mfF+LnnnExw+jHKEvqI020vqD7fnk7 7zBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@qualcomm.com header.s=qcppdkim1 header.b=VFP8WkIj; 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=qti.qualcomm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q5-20020a170902a3c500b001bbdb34628bsi9484143plb.289.2023.11.06.20.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 20:48:17 -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=@qualcomm.com header.s=qcppdkim1 header.b=VFP8WkIj; 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=qti.qualcomm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2C0FA80BB527; Mon, 6 Nov 2023 20:48:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233562AbjKGEr0 (ORCPT + 99 others); Mon, 6 Nov 2023 23:47:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233534AbjKGErS (ORCPT ); Mon, 6 Nov 2023 23:47:18 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8FB0135; Mon, 6 Nov 2023 20:47:03 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A72NHF1022765; Tue, 7 Nov 2023 04:46:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=4oCdX+o+C4WN1iHUVi8rtCosO3nRaCMx/0gq4hRLvCQ=; b=VFP8WkIjlnIipDHXS3XVkaVSdJ12NVldGSC6y7NVU2uOvaTrQi17EId6CDB3pu2Pjnis AJ4rXnO6iHHQwRz1iFrXG6F3PVS36X/QmpmcOl8OHj0/YuYi9GCrwCmlWhECcmXYJ0pm iK5YVivnh3bqvTYl8adj+A3RQlP/MulielL9hvprfa+tz+IwbvWb/BLK4LKc+smW/6nC Y0LTd9mtaGGewEi/hZHJHl7hF67cKToLm8OjhmoHJGmgqFjfG04hEwLGR7Xg0FQ5Ep10 Ey+SBZZBhV0aZuFMk76xraRA7uLEZzyx4NNhKvscbZZE/o8v48zJpyzUms+zSHTJFS78 tw== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u6xduabhx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 04:46:50 +0000 Received: from pps.filterd (NASANPPMTA05.qualcomm.com [127.0.0.1]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3A74kPdL024917; Tue, 7 Nov 2023 04:46:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NASANPPMTA05.qualcomm.com (PPS) with ESMTP id 3u78ha354x-1; Tue, 07 Nov 2023 04:46:49 +0000 Received: from NASANPPMTA05.qualcomm.com (NASANPPMTA05.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A74gOJf018919; Tue, 7 Nov 2023 04:46:49 GMT Received: from stor-dylan.qualcomm.com (stor-dylan.qualcomm.com [192.168.140.207]) by NASANPPMTA05.qualcomm.com (PPS) with ESMTP id 3A74knbI025345; Tue, 07 Nov 2023 04:46:49 +0000 Received: by stor-dylan.qualcomm.com (Postfix, from userid 359480) id 3902120A78; Mon, 6 Nov 2023 20:46:49 -0800 (PST) From: Can Guo To: quic_cang@quicinc.com, bvanassche@acm.org, mani@kernel.org, stanley.chu@mediatek.com, adrian.hunter@intel.com, beanhuo@micron.com, avri.altman@wdc.com, junwoo80.lee@samsung.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , "James E.J. Bottomley" , linux-arm-msm@vger.kernel.org (open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 5/7] scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 5 and newer Date: Mon, 6 Nov 2023 20:46:11 -0800 Message-Id: <1699332374-9324-6-git-send-email-cang@qti.qualcomm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1699332374-9324-1-git-send-email-cang@qti.qualcomm.com> References: <1699332374-9324-1-git-send-email-cang@qti.qualcomm.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: trSbQ4TI09d3NRK9YNYXZEIhnRTw8tsi X-Proofpoint-ORIG-GUID: trSbQ4TI09d3NRK9YNYXZEIhnRTw8tsi 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-06_15,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 impostorscore=0 mlxscore=0 malwarescore=0 clxscore=1015 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311070038 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 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]); Mon, 06 Nov 2023 20:48:05 -0800 (PST) From: Can Guo Set the initial PHY gear to max HS gear for hosts with HW ver 5 and newer. 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 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 55ee31d..94d34b5 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -1069,6 +1069,14 @@ static void ufs_qcom_set_host_params(struct ufs_hba *hba) /* This driver only supports symmetic gear setting i.e., hs_tx_gear == hs_rx_gear */ host_params->hs_tx_gear = host_params->hs_rx_gear = ufs_qcom_get_hs_gear(hba); + 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. + */ + if (host->hw_ver.major < 0x5) + host->phy_gear = UFS_HS_G2; } static void ufs_qcom_set_caps(struct ufs_hba *hba) @@ -1313,12 +1321,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