Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3344958rdh; Mon, 27 Nov 2023 11:46:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXAMHsKGGF5JKNykgLchEZOSkiIYOZbnOsj5bZznycrQxYlsBhn8KsDnEJTQ04ANqvVWpD X-Received: by 2002:a17:903:22c1:b0:1cf:9902:66c5 with SMTP id y1-20020a17090322c100b001cf990266c5mr16235534plg.36.1701114369314; Mon, 27 Nov 2023 11:46:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701114369; cv=none; d=google.com; s=arc-20160816; b=PpstFwHPN3rkMo0YTzWHWui7QGBARFbv3AVNZE2v1/GRE0bpYCps8x2WROJV0+BTdX T6t0eJ7TtHlHUILS+RnP2if9SCuX6jfH4ip8zboZ9JT0uYiPFb6gwbYzy9FxwSrIPGDU cGyoLNhTs3gv7eSLI/8IASKQqQ3CWTXCHcSBQNUUjhsZpwMXVOi72sBpPfxBWnGKZEj7 fnWfpbwxy9tWiVe0ui1EVr7KqHCcD7Sla2b2YcHzw41c7NLPACgweXfx6vIkhaHhWMY4 ZlFixAKSp7Fo0tTAENDrZpCB3uJ4aYqPuCj6Uxq43h/CgqK7tZpGL7yOhe+6mLJUpVXf BFpA== 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=EaIoIEqK046xrMwErk4Ckbwbd3NmBlrraNfZlHWUlAA=; fh=kQ51VzD82Ey+JDG7rU++0H/0xMPxJwz//UrSdG2zKwY=; b=IYDLuBwLoYa4LLKZVxvsX+NrdG6eSh3CNv9ax1nY5HjHNRpHlt/MV/MIMYIdE1ujcX j0Rsw3IMbrBB//hBz1gBYAcG8xNVOehkvVCVQb2rKAXKRxSdv2PNaZf9sngO/kyMoh66 fReoVCHv5gPgYF0DEGNP/je/MWXHgTaPk7qPkLird36kugUFKZCEi0rSGIKsTp3v8NnA dczZxoahgrpzNbTlGOlbkI2ulmlMvNtEYrggywu9PUefGjXXSrXJstpjY+iFzBg6lxZ+ l/IAXdl4zJ3HcxnBlMmOJCOtuUyhnInoW8R1X8YShfH6YJvzR51jVY6LSdfIhC6ehvFA oqvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=X7+3syIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u4-20020a170902e5c400b001c9ad8ca211si8655594plf.18.2023.11.27.11.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 11:46:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=X7+3syIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id BAE3D81823A9; Mon, 27 Nov 2023 11:46:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbjK0Tpw (ORCPT + 99 others); Mon, 27 Nov 2023 14:45:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjK0Tpv (ORCPT ); Mon, 27 Nov 2023 14:45:51 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E01B8; Mon, 27 Nov 2023 11:45:57 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ARGbiZS003734; Mon, 27 Nov 2023 19:41:05 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=EaIoIEqK046xrMwErk4Ckbwbd3NmBlrraNfZlHWUlAA=; b=X7+3syImP2B2I6CIg+VZtncwrhMS/C36LuUy/eyEshE0FUScJcy6IRvkwzZ8dVwpDCqL vHA7cK/NxuecXdfFQai65ejXCsyK2li7FUVT/UnEQuTc8bpAv9CDn9x7IYUNFZfqvJ3P TcvN/YzHnAFqulwTM4P1qdBEibsiPc5ORbHpEFZPR86M+eai1vtjo9qVuqlY0BLmkqNj n6S4BQjzKXlSk7xIdinU9FWEcdYn7+t+V0HDe2WzpRR3T6O2hi/SgNqHepLgMqRzQK9p j5R/lJvvBQQxjrU7N1n9ONVos1pUlVuxHrTLgc2TSf/h3XBvlM9lQXjBl6LX7ZlpfI+3 Kg== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3umrqq1kbr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 19:41:05 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3ARJf4c1026517 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Nov 2023 19:41:04 GMT Received: from [10.239.155.136] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) 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 11:41:00 -0800 Message-ID: Date: Tue, 28 Nov 2023 03:40:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] scsi: ufs: qcom: move ufs_qcom_host_reset() to ufs_qcom_device_reset() Content-Language: en-US To: Can Guo , Manivannan Sadhasivam CC: , , , , , , , , , , Andy Gross , Bjorn Andersson , Konrad Dybcio , "James E.J. Bottomley" , "open list:ARM/QUALCOMM SUPPORT" , open list References: <1698145815-17396-1-git-send-email-quic_ziqichen@quicinc.com> <20231025074128.GA3648@thinkpad> <85d7a1ef-92c4-49ae-afe0-727c1b446f55@quicinc.com> From: Ziqi Chen In-Reply-To: <85d7a1ef-92c4-49ae-afe0-727c1b446f55@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: kXOZ0pAZNqg7YjH4R0nJZIrZROTf-Uiy X-Proofpoint-GUID: kXOZ0pAZNqg7YjH4R0nJZIrZROTf-Uiy 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-27_18,2023-11-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311270136 X-Spam-Status: No, score=-2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 27 Nov 2023 11:46:06 -0800 (PST) On 11/22/2023 2:14 PM, Can Guo wrote: > > > On 10/25/2023 3:41 PM, Manivannan Sadhasivam wrote: >> On Tue, Oct 24, 2023 at 07:10:15PM +0800, Ziqi Chen wrote: >>> During PISI test, we found the issue that host Tx still bursting after >> >> What is PISI test? SI measurement. >> >>> H/W reset. Move ufs_qcom_host_reset() to ufs_qcom_device_reset() and >>> reset host before device reset to stop tx burst. >>> >> >> device_reset() callback is supposed to reset only the device and not >> the host. >> So NACK for this patch. > > Agree, the change should come in a more reasonable way. > > Actually, similar code is already there in ufs_mtk_device_reset() in > ufs-mediatek.c, I guess here is trying to mimic that fashion. > > This change, from its functionality point of view, we do need it, > because I occasionally (2 out of 10) hit PHY error on lane 0 during > reboot test (in my case, I tried SM8350, SM8450 and SM8550, all same). > > [    1.911188] [DEBUG]ufshcd_update_uic_error: UECPA:0x80000002 > [    1.922843] [DEBUG]ufshcd_update_uic_error: UECDL:0x80004000 > [    1.934473] [DEBUG]ufshcd_update_uic_error: UECN:0x0 > [    1.944688] [DEBUG]ufshcd_update_uic_error: UECT:0x0 > [    1.954901] [DEBUG]ufshcd_update_uic_error: UECDME:0x0 > > I found out that the PHY error pops out right after UFS device gets > reset in the 2nd init. After having this change in place, the PA/DL > errors are gone. Hi Mani, There is another way that adding a new vops that call XXX_host_reset() from soc vendor driver. in this way, we can call this vops in core layer without the dependency of device reset. due to we already observed such error and received many same reports from different OEMs, we need to fix it in some way. if you think above way is available, I will update new patch in soon. Or could you give us other suggestion? -Ziqi > > Thanks, > Can Guo. >> >> - Mani >> >>> 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 >>> >>