Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1846597lqz; Mon, 1 Apr 2024 21:45:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVn0TIbQnh2VRXM2LFxOM0sVRlm7vgJvyx5ZMD0sL1hTJc2M3vlC27MwlEtwH6rNQYdqSesR5bBMk9RaaMYtUWZxmQSGjE9TmndMYU50A== X-Google-Smtp-Source: AGHT+IFbdsA5yo947bCqiaVtPvfmu1vqdokasR+Au6QwtbFlCTtzZHCHOr9q4RZHF1qI8udmx7ea X-Received: by 2002:a17:90b:46c6:b0:2a2:176f:fba9 with SMTP id jx6-20020a17090b46c600b002a2176ffba9mr9061647pjb.43.1712033150365; Mon, 01 Apr 2024 21:45:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712033150; cv=pass; d=google.com; s=arc-20160816; b=zCPWdEEAoLETUesqEOVYrj9SlhARhaY6ghygWvhHFe+m8kgXQ/U8VlK0fLAKjKtL/2 /35UqCcCm061pRXuw/iyPqaK0K1XKhHOoh8UWAPwHp5Q1gzbdFC7ZDs8bva7hVBZL2uM 5knR88Mz1ryCRNZFzY+R9egorduUlU6XDI7LDfimUDmwGq9MDhXqlS3f1YpXLamNaPZ6 LETn9av1+wnBhh1uWJYVbW2X44YMIbyXhiTbhVHodNGNtSXsOibg4nnld6YmNArCmYd/ PXQdOBPxj5cYaGmuvte2gR3Z8E/BIUl1UmnRoFwa7QeajZMxVw4drr1ONLvjUsfrtA3R e3AQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yCC91jRqqruY+cMSMrFs9vuC32DRL1YSd6kB5mRmZEY=; fh=PiAPv5rqktdoNjcVGf1HreJnTtcDSG4q4VtmHm7u3io=; b=sUxwoVaXBLpErW++r9Qmqxdd0KHjnM4D47XAf0A10+6LWXuCeQ36rKGvv02MV7QPV+ bzwfmHH5B5Us1+xgXTTwZhNbTzCOBAz4N5y6a8slw3u33qngjyWYGbPsF4ccmPwumybH GgX3XMlbaygqRFYJ1ANTs6a1Pr70vH3isXe0ttGnNWg0UWw2LT3CdG5k3YnVj1/i8um9 A73swQAKGE7xFcuzh5Fj5R5DqL0cop8Li+D2iei5L8TO7DUBfCLCiu8Iu/KCTCGQuQv1 ClMM7X8Cs7OVXvedfZufqWv2uFKDAiPmRK1bwZISHBAzhJ5aQDS6ghOjMyxPieyGHdv4 n2Kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lldcevvM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127385-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x8-20020a17090a8a8800b002a20de331besi9507863pjn.127.2024.04.01.21.45.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 21:45:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127385-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=@kernel.org header.s=k20201202 header.b=lldcevvM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127385-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 1273E285F0C for ; Tue, 2 Apr 2024 04:45:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCBEC17C96; Tue, 2 Apr 2024 04:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lldcevvM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F0E5013AEE; Tue, 2 Apr 2024 04:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712033140; cv=none; b=MHXS2+DrWEF2VneKAnsTZ132LV+wLRuMFpHssxcGN526xGI8zS5+8qXVWpy1B3QMZATahnV5gwb5GAWgJUEKKzqsETcalhmDoPZd6ejFAGTx28gImzVxPCOcqW5hJ5debUaIXkDr5sMec8KbUmADUccP8aG9RepoqqEAfQ3Kxkk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712033140; c=relaxed/simple; bh=P/mK1dfRFSt8ZMwYXQ0eLjKwfZhqrnGkRVKAy0mDLH0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bD6DQZUqX5m+H0gUaZld13Yqv09GPXeO55h4sMYbHhRQMrydAw9hW9GHGdlWErboEzQimSFen9TUSTjnoHpQ8Ad9adYedUcaayva3QQVfTBE3dKfrg0g+A+8XQTJoPMtSMtAfhEwXPo4WL9B+NEZhlvZVo5JQGWVUfsc0aCriJY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lldcevvM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D641C433C7; Tue, 2 Apr 2024 04:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712033139; bh=P/mK1dfRFSt8ZMwYXQ0eLjKwfZhqrnGkRVKAy0mDLH0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lldcevvM6nMb0MxEG/1nqJ7IZddtFhnWFb3M1iB3AzceW25f6gyqxYIV97iaMXSK3 paUGiC9pG1RGQu1NRrTIz+DRUfq5LMps8oKKdhhDIGVlePHhexs7fsQVCfzrbtX4yH rcuMh4KupSUyfZr3K6PNNWImxHRKWSiT+aeyzXyI4DwJfwyyBQpEFqtCwUr5xvjYmT 8WqzSS7/TcCIM4k7gt4BOryZWrtWtH6wGbdOjLnhGMMnDhZTPiG495ZLvi9TuEXZoc uT+cUEz4NkX5jHfj31o9r4NmKx/PLoNwVIYekU34E+JrQFxLBRdxXVOQ2qQuGdDrIf UWCrp1mn4TGKw== Date: Tue, 2 Apr 2024 10:15:29 +0530 From: Manivannan Sadhasivam To: Andrew Halaney Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , "James E.J. Bottomley" , "Martin K. Petersen" , Hannes Reinecke , Janek Kotas , Alim Akhtar , Avri Altman , Bart Van Assche , Can Guo , Anjana Hari , Will Deacon , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 02/11] scsi: ufs: qcom: Perform read back after writing REG_UFS_SYS1CLK_1US Message-ID: <20240402044529.GB2933@thinkpad> References: <20240329-ufs-reset-ensure-effect-before-delay-v5-0-181252004586@redhat.com> <20240329-ufs-reset-ensure-effect-before-delay-v5-2-181252004586@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240329-ufs-reset-ensure-effect-before-delay-v5-2-181252004586@redhat.com> On Fri, Mar 29, 2024 at 03:46:44PM -0500, Andrew Halaney wrote: > Currently after writing to REG_UFS_SYS1CLK_1US a mb() is used to ensure > that write has gone through to the device. > > 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") > Reviewed-by: Can Guo > Signed-off-by: Andrew Halaney Reviewed-by: Manivannan Sadhasivam - Mani > --- > 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 06859e17b67b..804dc8153e7b 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -501,7 +501,7 @@ static int ufs_qcom_cfg_timers(struct ufs_hba *hba, u32 gear, > * make sure above write gets applied before we return from > * this function. > */ > - mb(); > + ufshcd_readl(hba, REG_UFS_SYS1CLK_1US); > } > > return 0; > > -- > 2.44.0 > > -- மணிவண்ணன் சதாசிவம்