Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2372776rdd; Fri, 12 Jan 2024 07:34:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdnzKt+g3SOcdnoHDS+EBEWL62ILr/8eDQOT5qH/205bvFpYudU9NPtGTijg4NNuN3PPAQ X-Received: by 2002:a92:d292:0:b0:360:7828:c653 with SMTP id p18-20020a92d292000000b003607828c653mr1218669ilp.1.1705073671620; Fri, 12 Jan 2024 07:34:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705073671; cv=none; d=google.com; s=arc-20160816; b=bvJIn8Nozx7+tJtsQCas2NBcLzZvcEeC0pgGrjkgIAm1TySpCtJg3UaoqzC/H8j2FM aUPYytWO5Lrxo3PdH8yB29wesmKu5j0IBpX+Vx12mNDjE/aROzlbqnjVAbSNrzNYzACm YjJ8uYGkYV8bfWyFd9lOOcVVuy6DySwwykhoT2lDiHvoRR+axBquWECV5rgIMfzFT9kF o6IMLeazwOq8dU48GI6UgIVOjU/Io5cWJfNhlqiG9TcdN+mF/zUTeoEPwLSQ0AN74fRE N4EfZ/QgLVEgGmFaK1e0I3dR0lj6+d4XsFnetThKNbj0khC+fYaeg2wL7A1IVvtq+sEc kFLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Q11XAhYvlT+pPYbbmi3tnqbrEGmbsowZ/Otmw6pZCPw=; fh=9YngYBTcJzSqQbeqjpP3QZWcP7lent86bPowcexIcCM=; b=w0XOdbAD+IjkezmnAUKgW6b95BYlm7q3k+mxCtvmykWVIpQSb0M26eNre16KpPVOea DFX/JykA3k6Kz+l0NEMVhR8PPALm4SAwLxcfehDo5PuyBaESgg451NLLdsy9Ja+RQ+t/ der/Ehufqe1NtxCbdeFBT556UxFFKPXCoONwuX/WK/aNQzIFo6ccs6VM+KaoZiAYP/jc isHzldPebOPWX+DjGKJwGttxv410lSHoTWlSRa+xDc5XRPb0x3EzKQ0eOFqqLpJM5pzJ JW41E/ed95NtBUUJBNb52GoMCWav9t2/iV/PA7rtoiv64YKmReLw0/5zX0eMhAMwRGQf V6bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="X7632k/F"; spf=pass (google.com: domain of linux-kernel+bounces-24807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x68-20020a636347000000b005cd84b844e5si3485037pgb.595.2024.01.12.07.34.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 07:34:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="X7632k/F"; spf=pass (google.com: domain of linux-kernel+bounces-24807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2BC2A286584 for ; Fri, 12 Jan 2024 15:34:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D9E86EB7E; Fri, 12 Jan 2024 15:34:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="X7632k/F" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9081E6EB57; Fri, 12 Jan 2024 15:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40CDOrcn023577; Fri, 12 Jan 2024 15:33:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=qcppdkim1; bh=Q11XAhYvlT+pPYbbmi3t nqbrEGmbsowZ/Otmw6pZCPw=; b=X7632k/Fs4ESIA4H4gaa1MPB+AoDv7rcdtsr 4SqNWWz2brnMjN0jtiLQ3hADObwF7ScIYxC5BL0F/o8DvgJZMtC5LQoWKG5FP5su ctlaRRisjeF0emWFo3ngQzvRLTmw1yIt430PSbYuyEwBoHWBtvu8Y0XzxmniIUKR z52qUtz+SOR+DI8CA3+tGteuqh9fSnTXIP2ACHyoBdypyy9ad1zayFAcR60+5boo 385vnkHmAXhaiAvqrBswEft6TrOhkV07Lm9MqnFxkzOWVXXNOGenfLnui25D0iEq UbfQb5/dfyXEAB60v2+dC1IbHMSWNZhlsCPtbo/+302uT3RYgg== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vjjjj3425-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 15:33:56 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 40CFXqno032668; Fri, 12 Jan 2024 15:33:52 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3veyxnj2y6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Jan 2024 15:33:52 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 40CFXp1v032660; Fri, 12 Jan 2024 15:33:51 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-nitirawa-hyd.qualcomm.com [10.213.109.152]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 40CFXpi3032657; Fri, 12 Jan 2024 15:33:51 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id 5435E572C41; Fri, 12 Jan 2024 21:03:50 +0530 (+0530) From: Nitin Rawat To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Nitin Rawat Subject: [PATCH V1 0/2] Refactor phy powerup sequence Date: Fri, 12 Jan 2024 21:03:46 +0530 Message-ID: <20240112153348.2778-1-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-ORIG-GUID: fV1al1rQQFm9ktPOmNbbSJEkyTvavawf X-Proofpoint-GUID: fV1al1rQQFm9ktPOmNbbSJEkyTvavawf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 phishscore=0 mlxscore=0 spamscore=0 impostorscore=0 mlxlogscore=424 lowpriorityscore=0 priorityscore=1501 clxscore=1011 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401120121 Refactor phy_power_on and phy_calibrate callbacks. In Current code regulators enable, clks enable, calibrating UFS PHY, start_serdes and polling PCS_ready_status are part of phy_power_on. UFS PHY registers are retained after power collapse, meaning calibrating UFS PHY, start_serdes and polling PCS_ready_status can be done only when hba is powered_on, and not needed every time when phy_power_on is called during resume. Hence keep the code which enables PHY's regulators & clks in phy_power_on and move the rest steps into phy_calibrate function. Since phy_power_on is separated out from phy calibrate, make separate calls to phy_power_on and phy_calibrate calls from ufs qcom driver. Also for better power saving, remove the phy_power_on/off calls from resume/suspend path and put them to ufs_qcom_setup_clocks, so that PHY's regulators & clks can be turned on/off along with UFS's clocks. This patch series is tested on SM8550 MTP, SM8350 MTP and SA8775p. There is functional dependency between ufs-qcom and phy-qcom-qmp-ufs and hence both the patches should be part of same merge window. Nitin Rawat (2): scsi: ufs: qcom : Refactor phy_power_on/off calls phy: qcom: Refactor phy_power_on and phy_calibrate callbacks drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 183 +++++++++--------------- drivers/ufs/host/ufs-qcom.c | 104 +++++++++----- drivers/ufs/host/ufs-qcom.h | 4 + 3 files changed, 139 insertions(+), 152 deletions(-) -- 2.43.0