Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp655068rdb; Fri, 22 Dec 2023 00:27:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGh1cFaG70+2+xYs/vn+wJy0nkFEt74rKFt07NGUXvCBkS+FT8EoBQ5Q/VFSREKKT89VmYE X-Received: by 2002:a05:6358:3a1b:b0:172:c06c:fce3 with SMTP id g27-20020a0563583a1b00b00172c06cfce3mr864122rwe.58.1703233659022; Fri, 22 Dec 2023 00:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703233658; cv=none; d=google.com; s=arc-20160816; b=uOG9sf0elLruVxhkGs2Jp5ZYue43wA62RbjEPzC4e2Tnpho07ozbVH/7s+N3+Gtn7o Wt+Wdk78VkigK/1qFp09XX3Q+CQB3/1w4ootwysjEl7Q+XsBMSk3brWddxvBkUGklXTd 1N5Udb29Et7+MxB/kcG1gFSCXsyUWeShF49f0GmBEDKeRToK+IHiFtNw3pwhwbtRmD8+ KEk2MKYsqS/6Xf/qs8DlvDkV6WYPV3FZbtaWF9YVzcHsqxGNgf14T4D8H3SKwYrIXH44 DqeBFtxKf583qzt6muck69Jm71EHVJuKCtsUlaDVp0rJnMTFUUo34GzfyK8HYBSgkoNB o3hQ== 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=IMurFZ9YPEhXkzguDLU/fHg9rMH3BKtFIDfQ16v5W48=; fh=fRLErKxptKM6ITOLjM0qepzUmZskocnDKd7jwirXhn8=; b=EIalMjs0zMvwgENHFnc4PBNf+ZD9BAJef2quDYJiyTbZgxpO7fjLsBM3byT27UqovR LZEp9L24+jNcMqo3yFQdg9OpnbTX7na6dMmOFlFvuz4T0YPk3RoH/bUQUk3axtk4k1+t 9WvM4H8MjfkbuJ6WFyJTPbZ8zCNv9BhhBnEfKudSJrou2HXty3ec/gMq21wifqMv1DOa BOCnv56oPGQs/O1hfB0fj8w9+39jlhYkaX4eCSjrBLoK6eWD/gT7XQBPJ8EcZn91gdEp C3/zOjx/xyT6Nsce1JPGUogmNK9H+hwl//15NVgw14vlpSLMqKMoT9TfqBMuzy/kbHOv SS7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lnNuGTVV; spf=pass (google.com: domain of linux-kernel+bounces-9497-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9497-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 mz21-20020a17090b379500b0028bcc1b6edasi2244541pjb.38.2023.12.22.00.27.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 00:27:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9497-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=lnNuGTVV; spf=pass (google.com: domain of linux-kernel+bounces-9497-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9497-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 9C9BD2837BE for ; Fri, 22 Dec 2023 08:27:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A19B179AC; Fri, 22 Dec 2023 08:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="lnNuGTVV" 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 65A6D17984; Fri, 22 Dec 2023 08:27:04 +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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BM7AXrr010122; Fri, 22 Dec 2023 08:26:40 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=IMurFZ9YPEhXkzguDLU/fHg9rMH3BKtFIDfQ16v5W48=; b=ln NuGTVVpBKGbQ/QZiRTLY8japikZHoSsjam82iaHbSncziDtY8vl/yd8Q9lUM3sKP z4DBCNti6D0EdsCx6YHrobqCqmnHDCJSRE6ZKGhaWGNanBn+0STZlGbhLqUze1fn OM+j+zaScu+jQm1B0pvV3jfDjowqWDKlpaWp+uXmS2hzkU9ejJFgLWkcKyNwxn9G KZEk6RetTHYVSeI2hQqsC8WkGu92vmdhcvaCT53bPAMzyGyUg9pRCM5N/pnb79IP StIjZC3DrIXDmiCw/fPpKFXCcIx6FO9XbPo7XKZzFMHWkp7Brvr8rDZmUdL/4KvZ oIwSMkVm/cdUxLNAMlFg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v51u08qf5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:26:40 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BM8QdAp022911 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Dec 2023 08:26:39 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:35 -0800 Message-ID: <9648b3ee-dff9-424f-a6db-3b8051b42fbd@quicinc.com> Date: Fri, 22 Dec 2023 16:26:36 +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 09/11] scsi: ufs: core: Perform read back after disabling UIC_COMMAND_COMPL 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-9-2195a1b66d2e@redhat.com> From: Can Guo In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v3-9-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: ZOsTbwVfW9kVeAoOzQyiF8F6aKTaeV33 X-Proofpoint-ORIG-GUID: ZOsTbwVfW9kVeAoOzQyiF8F6aKTaeV33 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 lowpriorityscore=0 mlxscore=0 bulkscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 phishscore=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 UIC_COMMAND_COMPL interrupt is disabled and a wmb() is > used to complete the register write before any following writes. > > wmb() ensures the writes complete in that order, 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 wmb()'s > purpose wasn't to add extra ordering (on top of the ordering guaranteed > by writel()/readl()), it can safely be removed. > > Fixes: d75f7fe495cf ("scsi: ufs: reduce the interrupts for power mode change requests") > 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 bb603769b029..75a03ee9a1ba 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -4240,7 +4240,7 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd) > * Make sure UIC command completion interrupt is disabled before > * issuing UIC command. > */ > - wmb(); > + ufshcd_readl(hba, REG_INTERRUPT_ENABLE); > reenable_intr = true; > } > spin_unlock_irqrestore(hba->host->host_lock, flags); > Reviewed-by: Can Guo