Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp370512rdb; Thu, 21 Dec 2023 11:29:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhAXWdXEq0ffXtlSeGdvJuvCTVCyP40VHN5JcmYvYPTnF0lwLtZVMpNQMvYUpvDYSFtuln X-Received: by 2002:a05:600c:524d:b0:40d:3ad5:761a with SMTP id fc13-20020a05600c524d00b0040d3ad5761amr119259wmb.77.1703186940686; Thu, 21 Dec 2023 11:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703186940; cv=none; d=google.com; s=arc-20160816; b=X/1HaGhE2UKmhrVNe4wIEUg3yjXKN7BhlbK+WitnyLF9ignS2qg8Z3MqT6Urrn932K kQty4sIlcoUwU76C7hFUhf+5ARwtj2uSJk2dn8GB6uii/9uM8n8Wc1vdBNWc2iXTz4N0 GxF9W/CiQ1VHxbUrdDpIhzpJgynfArgc8vVcpcKfs9rgxzpdhB8Hg+nPdbLZm4ZOKTAA 9cwQIta4m7KVtusmk9GHDj8B4wzUp2XYgWMcb2hByw/FMBHOBAEI+l7OP1OASDM17LWK tBZi99pUoYnxZumtjW2QEoCzxg9T1cdkiPpEQUeHbcndPauTR0fj+YSFrygsMoEKnGZG VT6g== 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; bh=0Bco0ERQRj3rYAMBWppOOAWWH4RcSWSSR/RuHXwNzZw=; fh=St3gBNrE8qj4SMa3Y0xyhxPw88DcH7AOacWDC6HX5R8=; b=YEfvhTkzOW7J5Jc+wmyI3Iihm3VjbooB3WLknY1cxL0upZdrLG1CI5KOefVoD5MfjU o7Ti0sMWD0mjWWGfLwxqEBBtMesu8a07gujFaETbh6Pb46uFzkNy/hqetvWmy5Fc1ByS h/Jtumc0qTAOGWi5ecgpBjvkYZ3c48pgZag6q8i97W5ugP9gyXyBKSfP145VIu1Q+caB bh1C03F5JO0++Tmo3tH6sSkrKUVA18qB95n8WCFz3r8l36WjPzBctWfZs2w1LHcJ8WaX IF4GE86bkJt0vStxeNUeQwDmq7RSBlUsAjwrbZud4v1qldORsYtcs+e5bZsxLoKbxC7Z xtUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8999-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.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 gu6-20020a170906f28600b00a26912cf38asi1069184ejb.389.2023.12.21.11.29.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 11:29:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8999-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; spf=pass (google.com: domain of linux-kernel+bounces-8999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8999-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.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 64B3D1F22635 for ; Thu, 21 Dec 2023 19:29:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 098996EB63; Thu, 21 Dec 2023 19:28:48 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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-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-kernel@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.