Message ID | 20240122-ufs-reset-ensure-effect-before-delay-v4-8-90a54c832508@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-33811-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2748938dyb; Mon, 22 Jan 2024 10:14:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEj48mHs74vzJfnXqRstgQ8oGDbDIWQRnvFfQnmHNJ3VhS/Vs775OP1KK429BZYRsZBw1kg X-Received: by 2002:a17:902:a50b:b0:1d5:afad:26a0 with SMTP id s11-20020a170902a50b00b001d5afad26a0mr1777991plq.93.1705947240478; Mon, 22 Jan 2024 10:14:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705947240; cv=pass; d=google.com; s=arc-20160816; b=R6T3NtNh3jeG7c53JI5VgwbJB1RP38dEX9r9wSNw5ZbcMCwu67O0Ksa8sTcxm2xc7s Nw9Shf180/1ZoXYE4WirrEGd6lfXD2NltGk8823EhMGK+w2xClro6l5sSXVAdFmF9HHp CGpifsO1VUo2CYbQMYXe6GNh3YDx+tYSOm300fuZFZO5yGaWBiy3tnpXCeMFcNufWTwu JQ4kSJpG65guLOWjpxAYJ258806HM1KL4YOlNp+6DsuhkZLPlH3F3IR7mxz71HOzU7eG DqwofoeB9eJOGog5r345Tkx5Bly/nOaMLVxlIbVtYxx5JMPpKBEU7hu12Llxx71BB9yy by6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Jvd6d1nUhV9LrU5f+xXncvSCqH2blthYX1l8ESnZEkg=; fh=sZjr1X209RpV6CW6bF47/guNu/E4ZUOEtACd37gRznE=; b=bYIjJSYIsm84BsZXS0az6jFEuVGnaCT9Yj8o3lhCu/QZ0Ppaau6bRPkC60avOIZEDB yuQrcq87uK18wo3rlin4fizVR2z7ok6joIuxOl3y7hLCPXwFBGD+RmTcA06rOhqhaJ3L n1n8QqzF7WhFHqe/sFVCk3ziUfLHkmmAz7Wr2X1xiG5Qt+snWGL95eDzXfiiUed6K2UR MiO/5/+DDcEYffZzRO0pu6ao0ctGfPWKZ7kXV+w+ZA9IRzmTN2IjwmM25Zw5sdlH9yuP iBrJXnxKAoW4H71S5SNOwSPdNkGqquQPxFZCQezRGQih2D3VNyyJS+DtAtrhdMcC1zjn GcvA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TuODnOtj; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33811-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33811-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k17-20020a170902c41100b001d51f3acb68si8608404plk.280.2024.01.22.10.14.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 10:14:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33811-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TuODnOtj; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33811-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33811-ouuuleilei=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 8D392290EAD for <ouuuleilei@gmail.com>; Mon, 22 Jan 2024 18:04:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C460663128; Mon, 22 Jan 2024 17:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TuODnOtj" 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 A1E6C62A1B for <linux-kernel@vger.kernel.org>; Mon, 22 Jan 2024 17:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944340; cv=none; b=gJB5vATDPuzJqRNU2FfemxH0zl/5rNukYYL0+YbnswkCIQzV9BTFlnOe7xbDYpjXfSglV4BmUq0w3u+3LPOnt6wncvqg7Me79CseC5hGsF/mTJMzQGNCiorwV0d/u/F4V/75Vklewe+RoNVAu7/biL9ihPzo9pyxFPuzWUxL3P4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944340; c=relaxed/simple; bh=W4mJLP2iaxCUp7jWQvTVdyu+M70cTTTVM83ZPvkZy40=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DX7qG71he/Di7IhXW9aTmUEnzTe3Gxfr8ZxDiPb4ihFloFHm8TIKhndsyiBbm8LK9x5YnT2+f2/RhEtMO+wZGuWfPYIyzwzBa91QhbpjQTkBVSPqChDkgVb77pPGZc5XQap6Jb1lY1GCZ0TI11kNbzH/SKTXjfSqRFs4W39VBPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=TuODnOtj; arc=none smtp.client-ip=170.10.133.124 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=1705944337; 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=Jvd6d1nUhV9LrU5f+xXncvSCqH2blthYX1l8ESnZEkg=; b=TuODnOtjCTi+AEZli7hF78l0Y6RJcAD+KjqBiqhv3UQfK2YmFw4Oicmmy2I0DvPnEyHT5f hnBVNG2Vg1m9HgCoEyqqphbJBc4DW8DfnhOuNu4wBGnNmleqAA1JD8/2c1p4Sj6ue7Hasi ygEl8LXjQVJcDjZRIQ5+jpNzW5islrI= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-JxYtus6YN5CcpEvL9Y6N1Q-1; Mon, 22 Jan 2024 12:25:35 -0500 X-MC-Unique: JxYtus6YN5CcpEvL9Y6N1Q-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-781d8e14fd8so532084285a.3 for <linux-kernel@vger.kernel.org>; Mon, 22 Jan 2024 09:25:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705944315; x=1706549115; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jvd6d1nUhV9LrU5f+xXncvSCqH2blthYX1l8ESnZEkg=; b=ktba5ZMfrL8EH8gQ2GwP7TJrDsARKGsBqfWqa4p3982NL4Ok2ABoZcfpOOul492KGS fi68qu8YosJi5TjbrnMezre+hGxRbk8zT+91kv6ApHIdU9MQEowQC9eZfDLwn0Z+WuJb nk8Ww3IZZBi62Smh1tO8x92ZiCP+FJuX6gRXjHKIyHUa+S+6Nresiwn8mGeVMefFqsM5 3o0hztwgx80EPT+SX8rqNhqdpOkY+oZF8Lyb7uSbKp1BJvN2aaH7rmtx8bOAXaq6DXlL +vwp/nEvmysVWet9OUZWIsrfOygt09DExfkX9vGS7lb1czry6ieolGlgTCHnj4cVESUn NqJw== X-Gm-Message-State: AOJu0YzDG+iUoFztxJgSZftqOSozcHeT4YbwtjOo5aLDKRc0a8oiSDWX b4iA/4+7Ly2jOBOyHHCSitwmZpi3ssysOcb+O5OsBaagCmBRjM/MqNczSRpuKaz4A+r/7jK31JJ bpA8mYh4UGJ7uCIx7NrjgmAo/mD1lTyuTC5cBhyJmJ/hcH3hh1WvlEW/UnVMb/A== X-Received: by 2002:a05:620a:8212:b0:783:375d:452c with SMTP id ow18-20020a05620a821200b00783375d452cmr5390428qkn.33.1705944314858; Mon, 22 Jan 2024 09:25:14 -0800 (PST) X-Received: by 2002:a05:620a:8212:b0:783:375d:452c with SMTP id ow18-20020a05620a821200b00783375d452cmr5390410qkn.33.1705944314547; Mon, 22 Jan 2024 09:25:14 -0800 (PST) Received: from fedora.redhat.com ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id c7-20020a05620a200700b00781ae860c31sm2280992qka.70.2024.01.22.09.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 09:25:14 -0800 (PST) From: Andrew Halaney <ahalaney@redhat.com> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Manivannan Sadhasivam <mani@kernel.org>, "James E.J. Bottomley" <jejb@linux.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, Hannes Reinecke <hare@suse.de>, Janek Kotas <jank@cadence.com>, Alim Akhtar <alim.akhtar@samsung.com>, Avri Altman <avri.altman@wdc.com>, Bart Van Assche <bvanassche@acm.org>, Can Guo <quic_cang@quicinc.com> Cc: Andrew Halaney <ahalaney@redhat.com>, Will Deacon <will@kernel.org>, linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Subject: [PATCH RFC v4 08/11] scsi: ufs: core: Perform read back after disabling interrupts Date: Mon, 22 Jan 2024 11:24:04 -0600 Message-ID: <20240122-ufs-reset-ensure-effect-before-delay-v4-8-90a54c832508@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122-ufs-reset-ensure-effect-before-delay-v4-0-90a54c832508@redhat.com> References: <20240122-ufs-reset-ensure-effect-before-delay-v4-0-90a54c832508@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.12.3 Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788815333764722740 X-GMAIL-MSGID: 1788815333764722740 |
Series |
scsi: ufs: Remove overzealous memory barriers
|
|
Commit Message
Andrew Halaney
Jan. 22, 2024, 5:24 p.m. UTC
Currently, interrupts are cleared and disabled prior to registering the interrupt. An mb() is used to complete the clear/disable writes before the interrupt is registered. 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 these 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: 199ef13cac7d ("scsi: ufs: avoid spurious UFS host controller interrupts") Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Can Guo <quic_cang@quicinc.com> Signed-off-by: Andrew Halaney <ahalaney@redhat.com> --- drivers/ufs/core/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.43.0
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index e2e6002fe46a..9b6355555897 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -10564,7 +10564,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) * Make sure that UFS interrupts are disabled and any pending interrupt * status is cleared before registering UFS interrupt handler. */ - mb(); + ufshcd_readl(hba, REG_INTERRUPT_ENABLE); /* IRQ registration */ err = devm_request_irq(dev, irq, ufshcd_intr, IRQF_SHARED, UFSHCD, hba);