Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp337544rdb; Thu, 21 Dec 2023 10:28:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9zoI6vTjQ/W0AdBa5WNVZsjmlzTo1IbGIzLdGP5Jhi0LAk8O27/IYpkqzylvFYmxrPSp+ X-Received: by 2002:a17:902:c1c4:b0:1d3:eb97:9456 with SMTP id c4-20020a170902c1c400b001d3eb979456mr32164plc.63.1703183291059; Thu, 21 Dec 2023 10:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703183291; cv=none; d=google.com; s=arc-20160816; b=eFxa7oecnONdEa+nGiyE9zSwhooZUkVefJHsgUSOqxxF5x90MZUpWPVzt1YgGMHyGo xcXKlr4wT9sQw29NVOChhIO1NJ5vm4tYMTNjNaeX7CjImR7MtIjZRbaLKsZIF9ikjnOH JKeqBy4sFIF4GK+bh/SF7AnPujUdIlYIYqUqsy7kAsjgFkeH6voD7O476t9uZllfpAwT qRzTTj1Mmp7rbSwrOLEUGFDdR5pEIYF74QutyvzDdpzFJ6zyIxCQHGVAqSsHp1Jhgbca P7R3TH3TCrLPanve1sCUOPbB3JlYWWt2mDpihMF9tTQ8dp7mIwBe8I2VgnAeAzvlc1DT zTDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=xUUJuT608SRhCl6+0/SpXWAx7Kuk//nvBAACeA7YhJo=; fh=04D4Yk3yOxJShnjvHS+/hsfQo1XzUk2+baHXEOLZllI=; b=npGZZHDL07jeQk904hDz/SDc/HAHLTjNIvE4IYM8NHtYjMXMnWXaMrhcDnG2jHpU1H QrJj3NmfNMGoVi1vxqqnkZ+mbvgXby09ikYaTNeAK6kknC1H0kla96kOeu3X3Jv+2T6I /HR1HKjY2EQuvGSfmmUVyCRHSpcLT9UZWBgRvxWlpMZ6eSjYpNBgO/1XzI5BkNwaZ5f9 ph2ejYxcJrwMIt02iKEw6073Mv7k2JNYpNWAB2TViqGtRMRLAOZpUkqRfPAQRhGxfp54 p8IECRsF+RINTfC2v+5v1MDpjVzLnt2TeDLWfYTbnmBD4NLvwFnXbVRH+S0rLX/mI43D uDPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P+yvJMF3; spf=pass (google.com: domain of linux-kernel+bounces-8921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id iw19-20020a170903045300b001cf5d537eb6si1854709plb.190.2023.12.21.10.28.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:28:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P+yvJMF3; spf=pass (google.com: domain of linux-kernel+bounces-8921-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3F946284F56 for ; Thu, 21 Dec 2023 18:28:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 784A477636; Thu, 21 Dec 2023 18:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P+yvJMF3" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 6371876DAC for ; Thu, 21 Dec 2023 18:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703183153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xUUJuT608SRhCl6+0/SpXWAx7Kuk//nvBAACeA7YhJo=; b=P+yvJMF31so6khUbP0rICAsBhmtOk5w6hJGSDjer2JThsrko+1vlaIZ5If9xSPfgXKv39E WZStGq3FtaoXbh294XuJtCT5muHd6xtdwBcW+vNdRale5hTZsPH7+FZSFOVV1tiAOcJLcI +kld6Q68OT4r2LZ3t0VNKqwVPcOE0GI= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-164-M5NzNAODNped4jp-bbGllQ-1; Thu, 21 Dec 2023 13:25:51 -0500 X-MC-Unique: M5NzNAODNped4jp-bbGllQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-67f92d392d4so722626d6.2 for ; Thu, 21 Dec 2023 10:25:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703183150; x=1703787950; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xUUJuT608SRhCl6+0/SpXWAx7Kuk//nvBAACeA7YhJo=; b=tTjXug/oMe9nCo4aiszYOKdONtBhnFLGYSUnm3J6a9asyLhl1bc8w38uT8KjS3/v93 EDYwZriCYhI3ivG7TNPOledcPr8Cb8GnSHm+KjNQ7IDyKPTEU7TqxlzurL7OPEvP7aZZ 2qTxRK03AFrxwcbVCnfDSOe37H9konSz69VbKeuoYazlPVXXTLFq4UuvF2LVPkUsBQi6 +YJaYjXmdIlucqMEaT2Kkh1e2PSrVYGMYP6U6Djv984c6T1oTWVDDrjO/A9AY4OGHqJa HykzCwCWk5AwRhUR8xbWKbQgBnCaTMj4lTOxlUSUj3GacoptU+aQQz9zj4fgWlc+W64W Bs/w== X-Gm-Message-State: AOJu0YzS3klQcDUj7/AMNMBEja1v/c8bok9/sXlIbyTVhax1srk3+fA4 ZbM92NUF99tWQ8rtqLlMgE4N0EuCqxfSBX6yXYG8Exs+vfimkuglL/ix4T5XLo5lRHg5L78RKUU 2ib43bii0YAaczn15RkLnBG7jvTzRtpK1 X-Received: by 2002:a05:6214:23cf:b0:67a:a721:f313 with SMTP id hr15-20020a05621423cf00b0067aa721f313mr119294qvb.83.1703183150053; Thu, 21 Dec 2023 10:25:50 -0800 (PST) X-Received: by 2002:a05:6214:23cf:b0:67a:a721:f313 with SMTP id hr15-20020a05621423cf00b0067aa721f313mr119290qvb.83.1703183149828; Thu, 21 Dec 2023 10:25:49 -0800 (PST) Received: from [192.168.1.163] ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id da7-20020a05621408c700b0067f2c03d4adsm779605qvb.100.2023.12.21.10.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:25:46 -0800 (PST) From: Andrew Halaney Date: Thu, 21 Dec 2023 12:25:24 -0600 Subject: [PATCH RFC v2 07/11] scsi: ufs: core: Perform read back after writing UTP_TASK_REQ_LIST_BASE_H 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-Transfer-Encoding: 7bit Message-Id: <20231221-ufs-reset-ensure-effect-before-delay-v2-7-75af2a9bae51@redhat.com> References: <20231221-ufs-reset-ensure-effect-before-delay-v2-0-75af2a9bae51@redhat.com> In-Reply-To: <20231221-ufs-reset-ensure-effect-before-delay-v2-0-75af2a9bae51@redhat.com> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Yaniv Gardi , Dov Levenglick , Hannes Reinecke , Subhash Jadavani , Gilad Broner , Venkat Gopalakrishnan , Janek Kotas , Alim Akhtar , Avri Altman , Bart Van Assche , Anjana Hari , Dolev Raviv , Can Guo Cc: Will Deacon , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Halaney X-Mailer: b4 0.12.3 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); -- 2.43.0