Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp652674rdb; Fri, 22 Dec 2023 00:20:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHe+TQxVl8P0OvU3jZlnlz3/lhw5/wIZU3Ej4U1372pj4F/BgVVhup+h2is9AV4URWSWuv/ X-Received: by 2002:a05:6870:9d06:b0:204:224a:1cc7 with SMTP id pp6-20020a0568709d0600b00204224a1cc7mr1206718oab.102.1703233255850; Fri, 22 Dec 2023 00:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703233255; cv=none; d=google.com; s=arc-20160816; b=WMm+DbAJOEGUUfFcXb8jLXZaOlaV8++i4W1szY97cpKJZUZRe51WgqjUgvpp8+OBB4 gw1zMCOu2yN6/wD2qopKyAu1n2Uc6lvKCdgRa0Rf5k4Dha48DJsaaJEypHfg49Ive27X OQg+9F1KCcc3B1nqxklTytOWFdVcraVqLT6jBQHPqrnW1h0SM2sB5XqB5evHbWn598J0 HrUBk4RNUU2kbwmG36J2VORpRl5rmHzDvN/Zbke1YacIHxof7jSGNuLuOjR7s61X/bmR Of8X5iINptc9jsfn1reCtNT4xHIusydb5mzbTQyEKvxy2bJVyd4E1R+WIWgfSvLkxv84 i75A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=k9NnBgwQWBGlcSjw2XivotEuVpgrgcbg+BSWC1pANec=; fh=fRLErKxptKM6ITOLjM0qepzUmZskocnDKd7jwirXhn8=; b=qFpZMrmwIJzQNFnFEFh0lMXowHBVncUkznao8l92twP40JatbmHrP6S6OKJK3AKXdF LNibv6oRMtfslYrnxNjS7gy/ONr85+aC09HfLwQujKM7M0kqH6aqN4rGq8mld0dSZM7B oMIKWYRDbjX6cOmkdl3nmkYs0N88o4zjXZdFdOdpE10gdpAqh/x9+T75MXjUNlCDND4a xRcfaGJK1FreGnngWjikrzxxGFDLFZZK1TCo4+5Y1dsZPi4Id6W0y61j1PQgCSkXuu7q WAkluEDsv7NsYP+C2CGiRjQJV29X7HVg8wyrLMubxgOYCGaXrP+v1rmiRq2MdEAro/6/ XUOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=TknAz7gp; spf=pass (google.com: domain of linux-kernel+bounces-9489-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9489-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. [139.178.88.99]) by mx.google.com with ESMTPS id m30-20020a637d5e000000b005c6eb3502c0si2858915pgn.273.2023.12.22.00.20.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 00:20:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9489-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=TknAz7gp; spf=pass (google.com: domain of linux-kernel+bounces-9489-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9489-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 50B72287A8A for ; Fri, 22 Dec 2023 08:20:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97EAED2F4; Fri, 22 Dec 2023 08:20:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="TknAz7gp" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 94579C8D5; Fri, 22 Dec 2023 08:20:41 +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=quicinc.com Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BM5tRXd021265; Fri, 22 Dec 2023 08:20:27 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=k9NnBgwQWBGlcSjw2XivotEuVpgrgcbg+BSWC1pANec=; b=Tk nAz7gppl9MkvonLXpmMYcXmPTv/pvgPQOoSOp6+ZfEVq8pK8tG8Qtmdy3Tt1aZxN P0ANBhktzGBvl1kHD1V8elMXzKiA/5i8RhtN9hkSsPK/LKfDGkykffCQahOdzaAW DWWbWzSS1hIgtIJVGm3F9qMpvWBKPdRDv9z157qQPJkOBlG52/POi+GjtQ5xnztS 55eQbub7w4UN6eKqbdeL4f03t9qEMRRkCQFJSsEdjxhLDWN3pt44AaXtde6iy1DU MHWnVJWh6JL6bQZzJIREciMFv925MRI0G4cGO2AXVX/zxb/A7UfNVLFHpGhOCVms 63QkdcBEJRajLZeyXtkw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v4xe513mm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:20:26 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BM8KPm9020211 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:20:25 GMT Received: from [10.253.15.135] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 22 Dec 2023 00:20:21 -0800 Message-ID: <107abfd9-b3f5-4495-b86c-070ed354d2bb@quicinc.com> Date: Fri, 22 Dec 2023 16:20:21 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v3 03/11] scsi: ufs: qcom: Perform read back after writing testbus config Content-Language: en-US To: Andrew Halaney , Andy Gross , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Hannes Reinecke , Janek Kotas , Alim Akhtar , Avri Altman , Bart Van Assche CC: Will Deacon , , , References: <20231221-ufs-reset-ensure-effect-before-delay-v3-0-2195a1b66d2e@redhat.com> <20231221-ufs-reset-ensure-effect-before-delay-v3-3-2195a1b66d2e@redhat.com> From: Can Guo In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v3-3-2195a1b66d2e@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: ALaKptp8_57e4SGB9WqiqVeHmzrlq4Z2 X-Proofpoint-GUID: ALaKptp8_57e4SGB9WqiqVeHmzrlq4Z2 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 impostorscore=0 clxscore=1015 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 priorityscore=1501 mlxlogscore=999 suspectscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312220058 On 12/22/2023 3:09 AM, Andrew Halaney wrote: > Currently, the testbus configuration is written and completed with an > mb(). > > mb() ensure that the write completes, but completion doesn't mean > that it isn't stored in a buffer somewhere. The recommendation for > ensuring this bit has taken effect on the device is to perform a read > back to force it to make it all the way to the device. This is > documented in device-io.rst and a talk by Will Deacon on this can > be seen over here: > > https://youtu.be/i6DayghhA8Q?si=MiyxB5cKJXSaoc01&t=1678 > > Let's do that to ensure the bit hits the device. Because the mb()'s > purpose wasn't to add extra ordering (on top of the ordering guaranteed > by writel()/readl()), it can safely be removed. > > Fixes: 9c46b8676271 ("scsi: ufs-qcom: dump additional testbus registers") > Signed-off-by: Andrew Halaney > --- > drivers/ufs/host/ufs-qcom.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 4c15c8a1d058..6df2ab3b6f23 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -1332,6 +1332,9 @@ static void ufs_qcom_enable_test_bus(struct ufs_qcom_host *host) > ufshcd_rmwl(host->hba, UFS_REG_TEST_BUS_EN, > UFS_REG_TEST_BUS_EN, REG_UFS_CFG1); > ufshcd_rmwl(host->hba, TEST_BUS_EN, TEST_BUS_EN, REG_UFS_CFG1); > + > + /* dummy read to ensure this has been enabled prior to returning */ > + ufshcd_readl(host->hba, REG_UFS_CFG1); > } > > static void ufs_qcom_get_default_testbus_cfg(struct ufs_qcom_host *host) > @@ -1429,11 +1432,6 @@ int ufs_qcom_testbus_config(struct ufs_qcom_host *host) > (u32)host->testbus.select_minor << offset, > reg); > ufs_qcom_enable_test_bus(host); > - /* > - * Make sure the test bus configuration is > - * committed before returning. > - */ > - mb(); > > return 0; > } > Reviewed-by: Can Guo