From patchwork Tue Jul 25 19:27:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Rawat X-Patchwork-Id: 125782 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2690951vqg; Tue, 25 Jul 2023 12:37:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqCWSPbJ1yJpP4cH1/2bYkLsqoZNimlpyiP9Q5ohNXo9eIvnGgCVcklKYYFOxMjyq+MsBs X-Received: by 2002:a17:90a:530f:b0:268:18e:ade5 with SMTP id x15-20020a17090a530f00b00268018eade5mr109376pjh.24.1690313841099; Tue, 25 Jul 2023 12:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690313841; cv=none; d=google.com; s=arc-20160816; b=uh4ZeuIIpFvTX42yDhsaY8Tw9FNyNWMKNIu98BJQaBAR4g9VkvyWjsm4ZaOgaGlZuR TbmU1dgbWeUvYycb0uQ+gaRVygUjRGP8VTaDcV2mxNdo+K4nwayLdPeao9fDB0RwXfxk Icw3Qs3DHr0qptmfs7M3cTNUjJNCS3pTNqMzoLNyu/NDifdOD3W5LsX2cfguWx6wzGih H5na8B1WH8FchoZrClwscq2uJNp4fL+gGxM7sm7NtpGv9yWM59NFkQ1c5AFV5vsJzVdU JRX7NEdmApybcxlbtbgtDqRAQJ4PYTnkqqHatUAVUA0RVnxrklXHYpVIZP9qJ4c3gN6A eiLw== 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=cS16Xqrg2iJTs/6E607OdqvHSWo3HavCEpJocMm0Bxc=; fh=oWoQmLJBMwg7njcL7TpQjBDqqWtqDTETVnMHtPj2T8o=; b=J+obrIIRpp/8xFpdBYMjdWAgbH4AYFJb8lW/bc9H1mtwYslmIRR9D6beBR2hC5wStG thf/GPeaDcjYwkohLMBq1B4oRdH4TKTr+Zw3ih7W9Ktx2NWnTCrB474aBFTXkz2TaYFw JKYqts0a5jpNHco+tdooW0s3B2yJUZ06TJOGGdrVUK3M9yUWniPpi4yYIAzNsQZB1oGL wS3JDeCxFeem25w4oqNEryd9KHXs+xVcjMte5lqcaj8rsMJZOj72Y3nnHsDeqPK5OKCj 8TyjYOXBfCiARrZ1MRUL59VCtyfLnEPsQZRux3JVZcksxk4Q07LU42c6Tl2gyccrCU3U JX7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OKlrr5ar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a17090a588f00b00263f3eb229fsi13849986pji.47.2023.07.25.12.37.07; Tue, 25 Jul 2023 12:37:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=OKlrr5ar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbjGYT2P (ORCPT + 99 others); Tue, 25 Jul 2023 15:28:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbjGYT2L (ORCPT ); Tue, 25 Jul 2023 15:28:11 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94961FE; Tue, 25 Jul 2023 12:28:10 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36PBT5MT001889; Tue, 25 Jul 2023 19:27:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=cS16Xqrg2iJTs/6E607OdqvHSWo3HavCEpJocMm0Bxc=; b=OKlrr5arRmaF5/cCD914aof8JSSPMM6o3I5AYquFiedCvO5kO9yU4kW7gTetonCutCnh MJR1yXhcagcUi3Zsk3l9B9R0Uc2siYQzTd0pVwspn6Xlez5vr/j995j6iW6Z1gLzyV0n DJNmrhK/uxKRtzE2YLe3MQ7JYjUTcVzHUo8oRG3IRPLOpm0HZwpN6KNh4lCnrj8gOzap qo4KCFd1V5fsrxppVbkywSRKWix3i17PvvA7u5368+6WmkWabFuyVo0S4BeuAmFAt7hf om04ku7MGwpkH4JO/nKO+tlr9UgkIPMpqMLuyr6zbawB9mX9CGH8wLNiENvTIRcXiVWK sw== 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 3s1v6ubama-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jul 2023 19:27:21 +0000 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 36PJRI4Z032690; Tue, 25 Jul 2023 19:27:18 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3s086kx1yf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Jul 2023 19:27:18 +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 36PJRHQV032683; Tue, 25 Jul 2023 19:27:17 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 36PJRHCq032678; Tue, 25 Jul 2023 19:27:17 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2342877) id EF4E45001B7; Wed, 26 Jul 2023 00:57:16 +0530 (+0530) From: Nitin Rawat To: powen.kao@mediatek.com, bvanassche@acm.org, alim.akhtar@samsung.com, adrian.hunter@intel.com, jejb@linux.ibm.com, stanley.chu@mediatek.com, asutoshd@codeaurora.org, quic_cang@quicinc.com, mani@kernel.org, martin.petersen@oracle.com, beanhuo@micron.com, ebiggers@google.com, agross@kernel.org, Arthur.Simchaev@wdc.com, konrad.dybcio@linaro.org Cc: quic_ziqichen@quicinc.com, quic_nguyenb@quicinc.com, quic_narepall@quicinc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nitin Rawat , Manish Pandey Subject: [PATCH V1 2/2] scsi: ufs: ufs-qcom: check host controller state Date: Wed, 26 Jul 2023 00:57:10 +0530 Message-Id: <20230725192710.26698-3-quic_nitirawa@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230725192710.26698-1-quic_nitirawa@quicinc.com> References: <20230725192710.26698-1-quic_nitirawa@quicinc.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-ORIG-GUID: uBXE_Fa1OxtnatsY-akVNZr_I3VkUYe6 X-Proofpoint-GUID: uBXE_Fa1OxtnatsY-akVNZr_I3VkUYe6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-25_10,2023-07-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307250167 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772422525857377962 X-GMAIL-MSGID: 1772422525857377962 Check host controller state before sending hibern8 command. Signed-off-by: Manish Pandey Signed-off-by: Nitin Rawat --- drivers/ufs/host/ufs-qcom.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 8d6fd4c3324f..95412e98a598 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -1254,6 +1254,10 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, struct ufs_pa_layer_attr *dev_req_params = &host->dev_req_params; int err = 0; + /* check the host controller state before sending hibern8 cmd */ + if (!ufshcd_is_hba_active(hba)) + return 0; + if (status == PRE_CHANGE) { err = ufshcd_uic_hibern8_enter(hba); if (err)