Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1847152lqz; Mon, 1 Apr 2024 21:47:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdWXf8WWDhnykF/+6m1R/51CC/kHnCw8NifO0T+WljUZ/8w48M77b1vY9egYAY4mDbZAYx+8FkFGPfY0TI3qY9/eoBsk8Rki6r3GnjJw== X-Google-Smtp-Source: AGHT+IFyfOmP0Iqo4LLHxeQmL0FmuZJthfPTioX0WH6eru3l7eZQyOaEoYLKLplmPI6N0g5zDPJ5 X-Received: by 2002:a50:9f44:0:b0:568:a792:276 with SMTP id b62-20020a509f44000000b00568a7920276mr357849edf.7.1712033276526; Mon, 01 Apr 2024 21:47:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712033276; cv=pass; d=google.com; s=arc-20160816; b=ADzmhE5Li/0zBn1ev2S7H6iNUvrj6Cx6+5mURrJqrqEaqeUfzJbKUNE/tJiSaMzmpV yOdKPa23XPPpSDB1yg8vaNpxLmyMxHMrI513a+TThAi2XYJoH9qXQA1ZNC76nBI+/a10 3s9TfzVdMwYHdygB7sPconfzc3rTvCwxm5JUArzRFfCNpt+VH9oLO4SSxgDSUAMGkUx/ IatQSg7+lTZX5wdVdCdKe5Yl/ovuIfHZ4H5nzRgyKHZX00nDPp5XDjVJApVAPpnSpfRV 3y4bcA2M227uobgALjuglsiq1CtLst00TAiZgEB6LWWGhjVycRvKBUIHNpHGYnyS6m9Z w/Hg== 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=oEl7+niS0sbkIeQzH+wAe0DGNe7oQVG3MzgtBElzzfU=; fh=PiAPv5rqktdoNjcVGf1HreJnTtcDSG4q4VtmHm7u3io=; b=uz32ZVjDTYGp04BzId5s+ROfsigoA0Yqcd2eLojZGYbZtAQoHY+o4LL1S0W4mSJQQ7 qH7eifgD8cgoUVFvY3GnF5midB4G/LyV4BSknB6l2394famG58BoAxF2OPRGxPmuZjoa PWve331DsQtIZijMTqLZftWodEmMAlc9fcJ2ujYmuqnbUWQZJT3H1bXcoHY4yaSD33TW L9or76VuMWi63l2tY3XsQQQaYSmdZRNZp9rCSYnGbLQUDgD+dv1eVYD/7pcQEAVGqAsi zjNLDKgrnqp3qEcufIdQDDr0m9QpdtoggdeMJTXV9ilJ3j6+SiWsHdwvZhnleyypRLAJ M86w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="NpuOmR0/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i20-20020a05640242d400b0056dc828f7c5si2547903edc.288.2024.04.01.21.47.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 21:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127387-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=@kernel.org header.s=k20201202 header.b="NpuOmR0/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127387-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 36C241F23635 for ; Tue, 2 Apr 2024 04:47:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4438217C96; Tue, 2 Apr 2024 04:47:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NpuOmR0/" 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 65C8513AEE; Tue, 2 Apr 2024 04:47:45 +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=1712033265; cv=none; b=ASFfhgcmdJ5fifBQRR9jYMtg1LsL28JsO031X+jMR1YraG3BkcZ6YQBAGT8SYULmMtYuSbODkB53pLZimccKNAggEjif4r4fpcgv6hvOdWF4YA+fd7tryHptSsAbW3uv3n/I1z5vwLk3ocMqTlwNaGRc51wuC6YiW+iYcAT2F34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712033265; c=relaxed/simple; bh=fIbRMyu2FSJwTCkrEkncIv8XsK1ysTaoL3oaW3uwl6o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J0v1y9YuXwqpDAEaK8B4ylbElNy6U3rNr/XvnqmApAi0b53ZSFwutqb8vzsjojdZHxfAU9zLD3ZU3U77ZArCCo0Z/k6qJfOGsmNisVCJ7GMrLfIwSeDxT2f6otSpmT11FjNpcdNFBGBMb9OGSwzbNOSdYKxJAOZcSqr5kR5vzjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NpuOmR0/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FDA9C433F1; Tue, 2 Apr 2024 04:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712033264; bh=fIbRMyu2FSJwTCkrEkncIv8XsK1ysTaoL3oaW3uwl6o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NpuOmR0/FGJOnCZGzJ3S6AbppyjVo9LF7bPap4p2ckE+771FM64GhAKmoK/xo0+fc 1jq2EwzUQVmo64ifTR8ua9fqDQs92H9MSc0ucbwui7uKByvFdnROHhA+X8sWNwsWM/ 0ECmn9CPLUF7nhZnp9eBZqgh9XQVTbSgKhqjr6bQk3EQ+uK42DUFdnCBtIcvrJtbPz 2Nat/T9kvXaZ+P+qbOULtjKOLIrXpAmu61kRBprdjiQYEQMnY5X26gD11f4DpyH8G3 WXhLjKELuFRceoooqMvcuiBErdYPps6rDPpuAbBeLq/QmDa5ISl8bIm98rMczdiP1p 6px8MEsOCJ8jQ== Date: Tue, 2 Apr 2024 10:17:35 +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 04/11] scsi: ufs: qcom: Perform read back after writing unipro mode Message-ID: <20240402044735.GD2933@thinkpad> References: <20240329-ufs-reset-ensure-effect-before-delay-v5-0-181252004586@redhat.com> <20240329-ufs-reset-ensure-effect-before-delay-v5-4-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-4-181252004586@redhat.com> On Fri, Mar 29, 2024 at 03:46:46PM -0500, 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 > > But, there's really no reason to even ensure completion before > continuing. The only requirement here is that this write is ordered to > this endpoint (which readl()/writel() guarantees already). For that > reason the mb() can be dropped altogether without anything forcing > completion. > > Fixes: f06fcc7155dc ("scsi: ufs-qcom: add QUniPro hardware support and power optimizations") > Signed-off-by: Andrew Halaney Reviewed-by: Manivannan Sadhasivam - Mani > --- > drivers/ufs/host/ufs-qcom.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 649fada24345..66a6c95f5d72 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -278,9 +278,6 @@ static void ufs_qcom_select_unipro_mode(struct ufs_qcom_host *host) > > if (host->hw_ver.major >= 0x05) > ufshcd_rmwl(host->hba, QUNIPRO_G4_SEL, 0, REG_UFS_CFG0); > - > - /* make sure above configuration is applied before we return */ > - mb(); > } > > /* > > -- > 2.44.0 > > -- மணிவண்ணன் சதாசிவம்