From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66059651A4; Thu, 21 Dec 2023 19:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d3e2972f65so5866995ad.3; Thu, 21 Dec 2023 11:28:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703186925; x=1703791725; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0Bco0ERQRj3rYAMBWppOOAWWH4RcSWSSR/RuHXwNzZw=; b=lf2metfXrrZuVaujnH+JQ9yRjLu4VoahGFZijYuoFg6DbJhBkxrl2/cRzyIqDX24pc Dl5imzvjaRfz2MMn0NDIuRFKgjQ4XefNwwIfUIiDr1lNj9Y8FcgccsLtt9M5+W1+jyNA DMBJRYUac+P8PpOqViXfcETVcGPyhcTo38DfErMD82uBwWrJHLr+2ILIIwS/zOcrLRSz dMBY6910ViLVrPUf+34pjejvHNyybbNx+vcufcKSMTv7KtwzwQLPxykfUFo2JHQBRrw8 V1niMEk70QmhXMaSnhjEpJT40zgms5dlgS00gq335nyRt4ClPsa0m438bb6VYnxMekXc dDWw== X-Gm-Message-State: AOJu0Ywm/AVC5nJ30+Zv/3lkRgjPikPdfT0PBk6SFkIl3uP3X1AsqxG9 gR/pZxfw99k354M3XhJXYzw= X-Google-Smtp-Source: AGHT+IHSHzhTy84vjyTXbw0y78oR/kW5cDCh5EFHZXHEFoI6LpSDZJKJUPgJMwCmOQ0BzrG8SpVJ0Q== X-Received: by 2002:a17:902:c406:b0:1d3:fa3f:668a with SMTP id k6-20020a170902c40600b001d3fa3f668amr153251plk.58.1703186925077; Thu, 21 Dec 2023 11:28:45 -0800 (PST) Received: from ?IPV6:2620:0:1000:8411:872c:d7b7:41e9:3edd? ([2620:0:1000:8411:872c:d7b7:41e9:3edd]) by smtp.gmail.com with ESMTPSA id l17-20020a170902eb1100b001bf11cf2e21sm1995752plb.210.2023.12.21.11.28.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Dec 2023 11:28:44 -0800 (PST) Message-ID: Date: Thu, 21 Dec 2023 11:28:42 -0800 Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v3 10/11] scsi: ufs: core: Perform read back to commit doorbell 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 , Can Guo Cc: Will Deacon , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231221-ufs-reset-ensure-effect-before-delay-v3-0-2195a1b66d2e@redhat.com> <20231221-ufs-reset-ensure-effect-before-delay-v3-10-2195a1b66d2e@redhat.com> From: Bart Van Assche In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v3-10-2195a1b66d2e@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/21/23 11:09, Andrew Halaney wrote: > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index 75a03ee9a1ba..caebd589e08c 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -7050,7 +7050,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba, > > ufshcd_writel(hba, 1 << task_tag, REG_UTP_TASK_REQ_DOOR_BELL); > /* Make sure that doorbell is committed immediately */ > - wmb(); > + ufshcd_readl(hba, REG_UTP_TASK_REQ_DOOR_BELL); > > spin_unlock_irqrestore(host->host_lock, flags); There is a wait_for_completion_io_timeout() call later in this function and it is safe to write to the REG_UTP_TASK_REQ_DOOR_BELL register from multiple threads concurrently so I think the above wmb() call can be left out entirely. Thanks, Bart.