Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp371402rdb; Thu, 21 Dec 2023 11:30:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDMUJ1f8ftRh5mvC3SlBP4cMjlQCLBiuJGYSzvQudNOvVyuWUssnlFisSeiho/NfmssxzQ X-Received: by 2002:a05:620a:4393:b0:781:2761:1166 with SMTP id a19-20020a05620a439300b0078127611166mr353549qkp.125.1703187044141; Thu, 21 Dec 2023 11:30:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703187044; cv=none; d=google.com; s=arc-20160816; b=Xiwka/HHw9nF3JiEZWpYQhhRzQ34Zzn3r9HGuVgmTyKbrvIq0Lainvj8RvQuPIqSAR wNGnH8CJOtZnD2lFhM0ndosbdOY79IZ+0/Q6uWjryLgH9qTMR+2IjJcv9WGaFzzhQGUB NvQXfaGNLqjP++w0O4jJzQmKDEXUqmeDiq4yRDDoaqSlT4pbXuynuIBB74IXqueiMl7U IGpW0hkOX9G5TyeY0kjJcxJ9yahTIaxlh9tgfD6guejDj7ITTZedDO+UZiP754YJNsfd bhZ8QGTaUdWWQ73R1G5mQ4BOAu+1FRSLLqPjxgnqle9tmumweHTsmKOTowp8q/EE+vx7 3+ow== 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=PaCuQQl7ykZXPvtbV2jmLW6ZX1gazXmMk5DzScPV8kQ=; fh=St3gBNrE8qj4SMa3Y0xyhxPw88DcH7AOacWDC6HX5R8=; b=otQijKL8OwCl8o0bhNnDq4GRsGuZe17L51/YbRKUUjBS7BWyGPvMrhzrmou9FAPxNV ae0rK0vW6oyEapx7B/XYpRFEztd4JqSLYR05yD3HcZ6cb9SnqYAKtXEqut1PuENsCSP1 8w7kxAP2QJc0iqfisdtUEz6lZU8g9KJDlwE2brZIYhgpLbVHq0hp7eT9w3eUmRY2JIxd AqsIvn9hoEzLhWyf0jgaxfbUWZ5Zw/NwaDFHhTQg+3LgcieWgqBvRSY5hf4mFghdmffo CcJfBc9/tkOOBnwirP7+wjB3Dpl2aoCLdNIi2iP/ID4Jf28SJo+8Ub5prwEoExoQv/J4 ZVaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c7-20020ae9e207000000b0077f9112aa36si2624078qkc.69.2023.12.21.11.30.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 11:30:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9002-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B72CE1C20B12 for ; Thu, 21 Dec 2023 19:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D3F5651A4; Thu, 21 Dec 2023 19:30:36 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 D5E9B634F7; Thu, 21 Dec 2023 19:30:34 +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-f182.google.com with SMTP id d9443c01a7336-1d3e6c86868so9593975ad.1; Thu, 21 Dec 2023 11:30:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703187034; x=1703791834; 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=PaCuQQl7ykZXPvtbV2jmLW6ZX1gazXmMk5DzScPV8kQ=; b=wdjEQhQ9NpKcxy7MVLjIdsHVOMIS/mjRE8yT/82e9JLp4ji0Y+0tFHJ9MSQIHLvAhs WMO3zMEEBl/6vjQ/jeLcZ6z/32J8dW+UFft19pt7kSjFrr8wVbJBOM6RLr3MSRi28bkM VXRnizyuYkdXMBg7Eta5z0np4X4WpNY9QS20fQE8dbGNanJifJfhpOAcwCZ+vjF5OR6n HTTRC7Eaea6STKs8nsTAAjVt9k8VHBxGY4MOYDTnmqfzz9XpqTKOknHaKY+a7+Y95GD8 ETW6vSZZ8ar1bfjrKPOioT4GWfvWjuYkz0qcw1/wHUsJxJi+lotJBIuFUamQkWxwWnBT x2Cg== X-Gm-Message-State: AOJu0YwfxjNSweosfpsCV87gEtB18h1n3owWWVdfTfPmHPl4x+P4jVn9 S/HDHSO7UHc+sQUniH018ho= X-Received: by 2002:a17:902:b195:b0:1d0:afea:78a8 with SMTP id s21-20020a170902b19500b001d0afea78a8mr113124plr.106.1703187033971; Thu, 21 Dec 2023 11:30:33 -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.30.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Dec 2023 11:30:33 -0800 (PST) Message-ID: Date: Thu, 21 Dec 2023 11:30:31 -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 07/11] scsi: ufs: core: Perform read back after writing UTP_TASK_REQ_LIST_BASE_H 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-7-2195a1b66d2e@redhat.com> From: Bart Van Assche In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v3-7-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: > Currently, the UTP_TASK_REQ_LIST_BASE_L/UTP_TASK_REQ_LIST_BASE_H regs > are written to and then completed with an mb(). > > mb() ensure that the write completes, but completion doesn't mean that > it isn't stored in a buffer somewhere. The recommendation for > ensuring these 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 > > Let's do that to ensure the bits hit 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: 88441a8d355d ("scsi: ufs: core: Add hibernation callbacks") > Signed-off-by: Andrew Halaney > --- > drivers/ufs/core/ufshcd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index d1e33328ff3f..7bfb556e5b8e 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -10351,7 +10351,7 @@ int ufshcd_system_restore(struct device *dev) > * are updated with the latest queue addresses. Only after > * updating these addresses, we can queue the new commands. > */ > - mb(); > + ufshcd_readl(hba, REG_UTP_TASK_REQ_LIST_BASE_H); > > /* Resuming from hibernate, assume that link was OFF */ > ufshcd_set_link_off(hba); Reviewed-by: Bart Van Assche