Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp654864rdb; Fri, 22 Dec 2023 00:26:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3H9tQ2MkTZvtYR0w7QyXlllyi/QCmiV4wxfTOfJbYApzEBNiPIw0YtLzkxk3XBsFZ2D4t X-Received: by 2002:a05:6214:1301:b0:67a:a721:e12e with SMTP id pn1-20020a056214130100b0067aa721e12emr1020821qvb.91.1703233613390; Fri, 22 Dec 2023 00:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703233613; cv=none; d=google.com; s=arc-20160816; b=ZYdXdsq5QvXnSS+tR1t3aPPY/FuMhVb2EhK8bpYSTZ5+GhOSLhBL7Tu0bMRzGndkJe wtAiRWdx9FDEVB5YvvvzsBVA+kwSBZgT3LRD9eM9az2p8B79/2tZbNSjJOCAaJWChDsl C+6K8Y+/HOh07WMSxcJg5Ga3X4hqstvqfTDTM3IT8t5S+oUYWdUZWeqQKblldO84yHsk riuOZYBAnp9lhc3hmwnkvbh31ebzhpW34n7eT+hfC81VZqPPIwlaAAM6GMjt/q6QDPFL nnSqu2n0eHcRvdbdBjwmcCePzEo1Ap299g4EGlcirXUfQoA1ZhV9Kq6vULV6lWvooHT0 xFzg== 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=5g1p2Y4BWTMxegb43sIopcraCtJSLLhIhPH+HOEyS90=; fh=fRLErKxptKM6ITOLjM0qepzUmZskocnDKd7jwirXhn8=; b=1BPsAXqLrvi8umT0YePAFK/37Kke2tDimDhb3YvMGEu4/KCfuatXotAj+KDktcB61m t1ZkBD0re9Wkiw87/lfRRk2RXO7xIqFjNTFQDL0gY60Eks3Awix+h6wMWq0WysU/OFVM UKEjxbpX+9xdR5NQ3LUCPqkP185CkjcLm9KBTMf7hMlXXBLnIPLiefD0D2+Gne8pW/iE mbiyMkjA54UzS7Xh3TsI8MHpzoMT8BHKJuiskPhU+sDt3yxwzxoPgpul914MhxtVhpF1 ulp0tEABIGiZxnkK2lgD8pXhbKBiIgTfGtRdZiaAoUd2PgkpHMFDMuRAW3A8FGwKNS/l EgVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="bQYl1/Fe"; spf=pass (google.com: domain of linux-kernel+bounces-9495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t7-20020a0cb387000000b0067a1557eb78si3924103qve.198.2023.12.22.00.26.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 00:26:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="bQYl1/Fe"; spf=pass (google.com: domain of linux-kernel+bounces-9495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9495-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 270341C2516D for ; Fri, 22 Dec 2023 08:26:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA59310A03; Fri, 22 Dec 2023 08:26:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bQYl1/Fe" 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 C27A4F9DA; Fri, 22 Dec 2023 08:26:33 +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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BM6mqFf000600; Fri, 22 Dec 2023 08:26:16 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=5g1p2Y4BWTMxegb43sIopcraCtJSLLhIhPH+HOEyS90=; b=bQ Yl1/FeiMdQZpTdo0k0UoJGjj2FgqewEYuAvQ6rtEpI/J4Ayd8tZ3hNQiJm5jr8yv rMsGV7EjNn3YOShN1lQiy1uaPq8AbK1Cbg1NJLdZAGnicyJX2BZgAxG1QQG9vtx1 Z6+3kHdOswXLkaCb8iEXjbOVeLXyJV+ZfLAJCiEsGV5IRSBr7wgNoI8tIBCyuj05 GyrEC9+vAaOLi7qlYw9v0Q2rVPpn7xfEXv57yU87YAhj9aBsIJLV+PWekK0ogkf9 0Kl2Ge1HDaOKngDPsPa7Q30G+oywRIK9rHUPrSuhQO9tQXWaFLzhDh136ERjqKXK ov2cMh475hl71ChfeIQw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v4qe2t97v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:26:16 +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 3BM8QFOV028087 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:26:15 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:26:11 -0800 Message-ID: <1408a374-7a90-427b-a2a7-4b2e9ebacfe8@quicinc.com> Date: Fri, 22 Dec 2023 16:26:12 +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 07/11] scsi: ufs: core: Perform read back after writing UTP_TASK_REQ_LIST_BASE_H 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-7-2195a1b66d2e@redhat.com> From: Can Guo In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v3-7-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: iUod2nl5a-RkJTw_dPQDZZB8zz8W4OnE X-Proofpoint-ORIG-GUID: iUod2nl5a-RkJTw_dPQDZZB8zz8W4OnE 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_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 impostorscore=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 UTP_TASK_REQ_LIST_BASE_L/UTP_TASK_REQ_LIST_BASE_H regs > are written to and then 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 these bits have 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 bits hit 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: 88441a8d355d ("scsi: ufs: core: Add hibernation callbacks") > Signed-off-by: Andrew Halaney > --- > drivers/ufs/core/ufshcd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index d1e33328ff3f..7bfb556e5b8e 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -10351,7 +10351,7 @@ int ufshcd_system_restore(struct device *dev) > * are updated with the latest queue addresses. Only after > * updating these addresses, we can queue the new commands. > */ > - mb(); > + ufshcd_readl(hba, REG_UTP_TASK_REQ_LIST_BASE_H); > > /* Resuming from hibernate, assume that link was OFF */ > ufshcd_set_link_off(hba); > Reviewed-by: Can Guo