Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1809462rda; Tue, 24 Oct 2023 04:11:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFI5SKO61v4J/sWInDoMK3LgiUf8gTeL7MZyzOHqQ//2ibYBeFTWPgqMuVZLy5ye4caPRA X-Received: by 2002:a17:90a:fb48:b0:27d:4259:b7ef with SMTP id iq8-20020a17090afb4800b0027d4259b7efmr12827292pjb.23.1698145890036; Tue, 24 Oct 2023 04:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698145890; cv=none; d=google.com; s=arc-20160816; b=H4hAVIlnd1lBqYEv0Vg65ZbHMgFIwPgNOiFmfW04tc7AHzuCCOUPAH+YPs85lR5pHx 4ssgv2NByFzquyKF1+L7P/3ewchy8o6h8Fwp2iUn7IQ2lbsW17ceDXkJvN6az25jIAkz 7PWuo/1X2TTuqNWjesgPh7FaQ40LT9hhhDbmZgYju2xD0weu6x9N3l/iYIY59x8Ld92y dl+5xb69PS/bYyi1NK3atnTk2KMDeuSg4EEvA1AIroI+PA+qFFee50m1h9FpLUVbHEpe GIOIW5NHjgufZK1FsvasDgzVe154TBVdD+zV5GCsTbs3nx8TpAPdQbxHr2FMWbsFxpKv q3vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=RKHcsUwcj/5VoPnr1a/q9B/c3g3rMYfwfHimA7AV0TU=; fh=/lWEkm4SnX71O9/PAj1nlMp+8oOAyCgtOA9TfcecPgI=; b=BP75Q4PCxZePJeFnOZuMmnGPu7Yv4tqXoesgCztoxoJGHXqqOZ+QHP1t7+F/FVT+A3 kv4P15hbFunPX8Fg+kY5obS3T5rdfPwN4CNisGrDRpeWReJrEFw+j5RolyZms8yOwz1P fKNoVgTtHrLxYmxsFom5wbP3X7Zl7uT5/vEOc94R3FQlzGtC0sBNbNUvv3foD+BNpYjh rcg0Siwfewj/C5y8gOZ0vlBIVS1ZDMbJxwH4K7E0xz8Lv7GI6ftJIHj0UC7wQJ6ScgjG VrIwZwzloQ/vQFuBzEb5rKt+ZVnlaXUdwiE0EBzEc4cifuTpZw4Yexs+erQeHAE8zB3g EOrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=iIyNnwZw; 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 kx17-20020a17090b229100b0027d0b9c0b90si8184835pjb.153.2023.10.24.04.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 04:11:30 -0700 (PDT) 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=iIyNnwZw; 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 9553C8068969; Tue, 24 Oct 2023 04:11:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbjJXLLC (ORCPT + 99 others); Tue, 24 Oct 2023 07:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjJXLLB (ORCPT ); Tue, 24 Oct 2023 07:11:01 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924A112C; Tue, 24 Oct 2023 04:10:59 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39OAt7ex002437; Tue, 24 Oct 2023 11:10:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id; s=qcppdkim1; bh=RKHcsUwcj/5VoPnr1a/q9B/c3g3rMYfwfHimA7AV0TU=; b=iIyNnwZwuSuO1rZcsbUFcDlgKaXoY0Zz3id476HMsRmPfqW1ZaXujpUyIoCC0epjl+Yq STSeSJahQu/LcWg8ZbZtU49njGpVtwXtNUH/QF2zaj/cLqvLwAhip4N7fUgriJiSUast WB288vOmCebGINfWWcRvEbhQHIzxjtEr0zy6hCwQH1smGZduJlTAUvc5LKM0SbUlMs3o 6DaR5oPrLQfihHiGNY6FruY3nqICLTJ9xFQIlFMZcktfg/JAw++Q2ocp4mOm4jqYX5NJ 3CZaF8KlmXwP6bYErDASiZidoYypmxly40RfLqNQvSFIFTkfCSu7xcnBWINjmQq9Tq9m vw== Received: from aptaippmta01.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com [103.229.16.4]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3twsnntf6k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Oct 2023 11:10:24 +0000 Received: from pps.filterd (APTAIPPMTA01.qualcomm.com [127.0.0.1]) by APTAIPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 39OBAMnu017209; Tue, 24 Oct 2023 11:10:22 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APTAIPPMTA01.qualcomm.com (PPS) with ESMTP id 3tv7qkedch-1; Tue, 24 Oct 2023 11:10:22 +0000 Received: from APTAIPPMTA01.qualcomm.com (APTAIPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39OBAMcQ017204; Tue, 24 Oct 2023 11:10:22 GMT Received: from cbsp-sh-gv.qualcomm.com (CBSP-SH-gv.ap.qualcomm.com [10.231.249.68]) by APTAIPPMTA01.qualcomm.com (PPS) with ESMTP id 39OBALoG017203; Tue, 24 Oct 2023 11:10:22 +0000 Received: by cbsp-sh-gv.qualcomm.com (Postfix, from userid 393357) id D6F6E533A; Tue, 24 Oct 2023 19:10:20 +0800 (CST) From: Ziqi Chen To: quic_asutoshd@quicinc.com, quic_cang@quicinc.com, bvanassche@acm.org, mani@kernel.org, beanhuo@micron.com, avri.altman@wdc.com, junwoo80.lee@samsung.com, martin.petersen@oracle.com, quic_ziqichen@quicinc.com, quic_nguyenb@quicinc.com, quic_nitirawa@quicinc.com, quic_rampraka@quicinc.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:ARM/QUALCOMM SUPPORT), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] scsi: ufs: qcom: move ufs_qcom_host_reset() to ufs_qcom_device_reset() Date: Tue, 24 Oct 2023 19:10:15 +0800 Message-Id: <1698145815-17396-1-git-send-email-quic_ziqichen@quicinc.com> X-Mailer: git-send-email 2.7.4 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: EoyL9d-JVNstofh06Y_xquhU9LlSo8ih X-Proofpoint-GUID: EoyL9d-JVNstofh06Y_xquhU9LlSo8ih X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-24_11,2023-10-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 malwarescore=0 adultscore=0 clxscore=1011 suspectscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310240094 X-Spam-Status: No, score=-1.7 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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 04:11:11 -0700 (PDT) During PISI test, we found the issue that host Tx still bursting after H/W reset. Move ufs_qcom_host_reset() to ufs_qcom_device_reset() and reset host before device reset to stop tx burst. Signed-off-by: Ziqi Chen --- drivers/ufs/host/ufs-qcom.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 96cb8b5..43163d3 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -445,12 +445,6 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba) struct phy *phy = host->generic_phy; int ret; - /* Reset UFS Host Controller and PHY */ - ret = ufs_qcom_host_reset(hba); - if (ret) - dev_warn(hba->dev, "%s: host reset returned %d\n", - __func__, ret); - /* phy initialization - calibrate the phy */ ret = phy_init(phy); if (ret) { @@ -1709,6 +1703,13 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba) static int ufs_qcom_device_reset(struct ufs_hba *hba) { struct ufs_qcom_host *host = ufshcd_get_variant(hba); + int ret = 0; + + /* Reset UFS Host Controller and PHY */ + ret = ufs_qcom_host_reset(hba); + if (ret) + dev_warn(hba->dev, "%s: host reset returned %d\n", + __func__, ret); /* reset gpio is optional */ if (!host->device_reset) -- 2.7.4