Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1847679lqz; Mon, 1 Apr 2024 21:49:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOp0Hr7fSx3wdqVYsYrWVXI+xWajlIeFxc/01Xqjpl73+XC3YaGE24zlE1Usdvk9Rp9Op5ay/jkGcesjZcESFFf3TqSHz2G4y/krZ6xw== X-Google-Smtp-Source: AGHT+IFC7+7JrFsZ42uY9Py6sK9N9lhqh9HieGw1GCVEQjJfXmc2MzOabWdv/fOBVHRsmPH7sRUm X-Received: by 2002:ac2:58d1:0:b0:513:cdb9:bd61 with SMTP id u17-20020ac258d1000000b00513cdb9bd61mr6594534lfo.12.1712033389275; Mon, 01 Apr 2024 21:49:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712033389; cv=pass; d=google.com; s=arc-20160816; b=q4uyMUlmT7EdLaxHGuK48ZCPDvuuf+9f1vD4wY27i6SKeNxLJXN1Fe3yhIbmcbuYVL x5TY1viqtN5zeVfelTS869BoIOgYD8R8WW3TEDFlONPHQes4lSVqYqn8UPmJSzky12vm GXvY0h95oDov2JeSKSKfTL8SiXw0oxXwfPPS1EZmtCxFbKPT0G5Mj2MAXv0FOtzIU4Hn EAT9eLlw7zAxVRRM6kRDRIn/1U1yhRYpDirRmOIJLpRYIl1L+QX8ZiOCbmnmzGd/N8Vc FhJksa5yBWGgESv5qQehkT86mOClonvavxE6fjT/kXP8ttjXC0GNIQuMaMTB7+ujdfw9 nLxg== 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=AGj4RZ3cjGcwy0P9I8T3vHii21kGUZGL+ro5iwHxYmo=; fh=PiAPv5rqktdoNjcVGf1HreJnTtcDSG4q4VtmHm7u3io=; b=OsXLtxxCQDl3ku5kfbAojyWQHEM7PaFZHcJdLkCsrfY9HttecsGlfxDdxKt4+Ip4CQ qyace1qpu4+SV8Ey64fj/FP4ZFdb0W0bU3w9x0YwN2AbrrCXcDBnz21PQY4ZCDk/YAXn rlxQQsJQo9XQ/nnYPEAipDHwjVl5TAUIaT6mFHGg0ENTjYVIvmVsGVmqhZKpHO/d07gb X+tBdJh8gH8nMzV3rfvB5EDKQgyAMvxYJFWX3BC+kEu7ldLmDkylmPqVfkqXfzjOS3rJ ImEZY21VSwiEQ/Li32ItDEPYFZbdhpNtn7k/+DgeTWWcfvVvbUDDzDQbP9facosKKBfh zTxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZUhhC6Bo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127390-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 gv8-20020a170906f10800b00a4e8e093d0csi77078ejb.998.2024.04.01.21.49.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 21:49:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127390-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=ZUhhC6Bo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127390-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 018DE1F245AC for ; Tue, 2 Apr 2024 04:49:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E618B1802B; Tue, 2 Apr 2024 04:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZUhhC6Bo" 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 06FC717C69; Tue, 2 Apr 2024 04:49:37 +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=1712033378; cv=none; b=GboywZ5WOf8T6XsSjQFBouP28xHUwuhcBNWUrOZUT4rEwh1blXL83TchmWRsOZL8/x15wanCHtXs75d6pfOkStcgm4k7jTCTT/oC1Vdv9tIeF9yaKoy7849yS2hqX5Su2K4aRWosdq8xY66RDpk+cfKrF5Jb2TfWBdZNul7sa1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712033378; c=relaxed/simple; bh=HQDW3ERhmazGPaTptv5BcbYjzluSXrBysFXL+s0zZTI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CQKZIVAE3fXX8j0zcsv5C7FiBkG/YQTQhmvC4kHVR0ea3xP++1qfuvl29aqu7/yh8oQgI5e7BIGXt+U7CUC6vnLhK0mK9ZGOa/4fz0kco8PReV9IydhlMpss8VsMLxIkh0vU5ewEngTgYv5fkmKmvtfif5xc39esEuX+XZulOsI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZUhhC6Bo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C899C433C7; Tue, 2 Apr 2024 04:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712033377; bh=HQDW3ERhmazGPaTptv5BcbYjzluSXrBysFXL+s0zZTI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZUhhC6BorLMhZ9OipVKnviMUmboMnGAM7QgD2vHP0Pb3DPuUtRJRcmvFxo+1KPOYn xTRjo+n70N/9+xNo1aCYu2GbH5cdKNbnkCxxdfy7Y1M2InC86p57u4VbUrKw2NM+r7 +mEodWczZ5zWVCzQufJmnjBOFaUB6f+vYPpkjlu+6YoosoTc1iuo3fIAMEbQ614V9Y 30Op1vzJOE4vnfmwhENdvYdjZIoi9dwBOe68OvN3pMwJgoHzgyWcWTFbxyphuwPw1t FxUO0X7Uf79j0/h9ccYIMNv4WMZU9BlehJjUpRRz8qUyn8oOz1RUcXDiBlWahykLiw dX4rZlYLKGydw== Date: Tue, 2 Apr 2024 10:19:28 +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 11/11] scsi: ufs: core: Remove unnecessary wmb() prior to writing run/stop regs Message-ID: <20240402044928.GF2933@thinkpad> References: <20240329-ufs-reset-ensure-effect-before-delay-v5-0-181252004586@redhat.com> <20240329-ufs-reset-ensure-effect-before-delay-v5-11-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-11-181252004586@redhat.com> On Fri, Mar 29, 2024 at 03:46:53PM -0500, Andrew Halaney wrote: > Currently a wmb() is used to ensure that writes to the > UTP_TASK_REQ_LIST_BASE* regs are completed prior to following writes to > the run/stop registers. > > wmb() ensure that the write completes, but completion doesn't mean that > it isn't stored in a buffer somewhere. The recommendation for > ensuring the 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 > > But, none of that is necessary here. All of the writel()/readl()'s here > are to the same endpoint, so they will be ordered. There's no subsequent > delay() etc that requires it to have taken effect already, so no > readback is necessary here. > > For that reason just drop the wmb() altogether. > > Fixes: 897efe628d7e ("scsi: ufs: add missing memory barriers") > Signed-off-by: Andrew Halaney Reviewed-by: Manivannan Sadhasivam - Mani > --- > drivers/ufs/core/ufshcd.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index a2f2941450fd..cf6a24e550f0 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -4769,12 +4769,6 @@ int ufshcd_make_hba_operational(struct ufs_hba *hba) > ufshcd_writel(hba, upper_32_bits(hba->utmrdl_dma_addr), > REG_UTP_TASK_REQ_LIST_BASE_H); > > - /* > - * Make sure base address and interrupt setup are updated before > - * enabling the run/stop registers below. > - */ > - wmb(); > - > /* > * UCRDY, UTMRLDY and UTRLRDY bits must be 1 > */ > > -- > 2.44.0 > > -- மணிவண்ணன் சதாசிவம்