Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp653971rdb; Fri, 22 Dec 2023 00:24:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6xEQG6g8U1Ze7L1PDAtOMpOHVqk7sxre5qYhIhZ7qlFNPeNQggUJwH2QddOQXw6oI4kZ3 X-Received: by 2002:a17:907:9842:b0:a26:97a1:48f1 with SMTP id jj2-20020a170907984200b00a2697a148f1mr240383ejc.81.1703233455931; Fri, 22 Dec 2023 00:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703233455; cv=none; d=google.com; s=arc-20160816; b=J96E/sh5Xgvb7CsZJ/nDVbiW8zfCHt1qKoY0Z9DsuMuC0DCHMHQCvtG8lmNzYKDLfq X+NaJigKjHptStFu3IEO/Z8hRAzIY0HJKqlETrIevP+WXddZBELmkPcb5QZc+TqzBq3b YF5tcxpBKzZkvYEqqwLZiEtuUL+/mhQkkg1JLI/VahzZkn+YPLoeKsUzrhJT/sYlmEa3 agUF86jysUm9bb7S869V1IflYgfeenOzfdFiYzTedhX5/Bs+d1temC8V+rOFjvUCoVTo /rK6lSiA5dfLb68u6G6AyVockCUvas+VL2pkpTTCHCTbGYWbOAYyFTeO/s8+Rz5Lzh4g iveg== 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=y2j3mvTmQM5ETQ3XWWctWQvbXW4eto2AHvpErCu1BfU=; fh=fRLErKxptKM6ITOLjM0qepzUmZskocnDKd7jwirXhn8=; b=PeJV6ZvSxXK7lH7234QS5QaqJ2xt4vN+1ke9jWDYLZcpM9WfCt9epfzWtsAPOnhxSB lZe/ymXkxAtNgqm6C07Ni2HUIK3GvvpVN3scxG0SmYlBR2OhJzwhadhGt3INicv5fMD8 brGb3KhvA0536vmkDovRzD0aTdB8kk7uXIPlVwcmqXgYfqiKFBmShMky0l+gqL/QOde3 pJM99f6CJSrbjq3MnkY7uVtey5jX0ArTYLMtc/EcZa9t0ambYTMlYdXP50l5ucDAongn F8iYNi4rZgPuqQHjDKk8xcxPOcyp3GVbfSCcaEZxOacbw5CPcXtuH/Gfy2m9wfhPOMor CgYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NyOKrkjn; spf=pass (google.com: domain of linux-kernel+bounces-9492-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9492-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x22-20020a170906711600b00a2697370bacsi1603812ejj.835.2023.12.22.00.24.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 00:24:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9492-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NyOKrkjn; spf=pass (google.com: domain of linux-kernel+bounces-9492-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9492-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B04041F24557 for ; Fri, 22 Dec 2023 08:24:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9E9CCA75; Fri, 22 Dec 2023 08:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="NyOKrkjn" X-Original-To: linux-kernel@vger.kernel.org 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 BCE75C8CF; Fri, 22 Dec 2023 08:24:01 +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 (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BM8EOxP000947; Fri, 22 Dec 2023 08:23:47 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=y2j3mvTmQM5ETQ3XWWctWQvbXW4eto2AHvpErCu1BfU=; b=Ny OKrkjnAb21pPYiu0LaW24vf2S4vz9ovQFWPfRI1bOENMpJ5x9qVL7v/6iEan3sY1 0LsfP5EL9/bRl1l6fBiWOq/N39tlPq7jUmQcOyBOoYJQmhvW3I+y4GuGZptbZSoD ZklOzzEE+61li641NEPnI3xRIzjZVdIpFCUK5kICcBHKR9y0qjnN33Vq832o5//R EQAAnVM95oul8ZGEWLpsBhBGuIXBYaffaTtla236KAE9TLWTaFIpKQZe0jZnKQR1 5bqcRd+I/JVWCEgt792Lbl5g93DR3k6pbNn2M297DEV2vPYwinuQXxXVww5O9dAa 7QpTBRLTqDvtsDN60XOg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v4pq3adma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:23:46 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BM8Nj9q027051 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:23:45 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:23:41 -0800 Message-ID: Date: Fri, 22 Dec 2023 16:23:39 +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 04/11] scsi: ufs: qcom: Perform read back after writing unipro mode 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-4-2195a1b66d2e@redhat.com> From: Can Guo In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v3-4-2195a1b66d2e@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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-GUID: UnFESaatNPeTb2Gu8j3YpWdnmBjx8GsO X-Proofpoint-ORIG-GUID: UnFESaatNPeTb2Gu8j3YpWdnmBjx8GsO 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 priorityscore=1501 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 mlxscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 adultscore=0 suspectscore=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 QUNIPRO_SEL bit is written to and then an mb() is used to > ensure that completes before continuing. > > 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: f06fcc7155dc ("scsi: ufs-qcom: add QUniPro hardware support and power optimizations") > Signed-off-by: Andrew Halaney > --- > drivers/ufs/host/ufs-qcom.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 6df2ab3b6f23..ab1ff7432d11 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -280,7 +280,7 @@ static void ufs_qcom_select_unipro_mode(struct ufs_qcom_host *host) > ufshcd_rmwl(host->hba, QUNIPRO_G4_SEL, 0, REG_UFS_CFG0); > > /* make sure above configuration is applied before we return */ > - mb(); > + ufshcd_readl(host->hba, REG_UFS_CFG1); nit: please also add the dummy read comment line to avoid confusions. > } > > /* > With above addressed, Reviewed-by: Can Guo Thanks, Can Guo.