From patchwork Fri Mar 29 20:46:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 784541 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 B410413CC63 for ; Fri, 29 Mar 2024 20:50:51 +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=1711745453; cv=none; b=epZ82yfLYGRiZC6y4z93OR9O/jdZ2w3DLE/ngwrFWfSLSnxnldPHRVJvuxQNYdj2vdXIaj/UDHJgggjmABASMeeWvFsAVdipkv+9Tthw6b9Z5WJJa825GOwGwIbcmGUqTBKYdcDLQyWVTCDfFR0zhireYtmgqSFaKSubpEi3Rko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711745453; c=relaxed/simple; bh=BGXknjcLA50bcUKtFtKJCi5N6HFf284Wv0+1aI9g+Qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YkZpnHxrRdtp0bE2I1jh4BCz6HZENtiPAnvsNs0MSjDp3TaoGqbTeoyCexpqeuWTJrLV2bEyPhhLmc3R5JIEhyctf4cktAbu8GOOeVg1T01gSht6wr7h9t5nCPi3S9hYrH00HtHKEc3M5tCm/nEpgmyi3tVfCn99eyiJMYj4i1w= 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=F9gR20l5; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="F9gR20l5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711745450; 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=Uf4SOXbG4RAjshjCtScug3Y0ECaz5dSCoqxe3hdLj3E=; b=F9gR20l5kkJUOdbFC/a/+Q1MbFPY0o+pmrofmwlg0E9g6iazivYS5TCBFecsq4zwK0lZgR gCvvqjnukbAd/KlO5jIiD9CP3rb7CU4AqpH9GUyM+kBhSg20ch7F+d/9ML4nBsnZiRqaPc ke7T0/fNNA+q1vHXG4s843OFJYK7Q7E= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-5KmXAsEyPlugG5Rk_IZSIA-1; Fri, 29 Mar 2024 16:50:49 -0400 X-MC-Unique: 5KmXAsEyPlugG5Rk_IZSIA-1 Received: by mail-ua1-f69.google.com with SMTP id a1e0cc1a2514c-7e05b1ef83dso1098493241.1 for ; Fri, 29 Mar 2024 13:50:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711745448; x=1712350248; 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=Uf4SOXbG4RAjshjCtScug3Y0ECaz5dSCoqxe3hdLj3E=; b=hTqwR2SkAwwFQsgXCQUaWNqIdVSZFxKSSS2QwE0TOhxr653/Ass4ZtbdL7BLVCKlrx 2TLchsRNq/xZmKxVTkRpwUFtfSieMyktnhRc93JNwWb887GjNIPdvXZVvuqdepXcGbQl jXbqMJBM2NEwe58ZqfAFQi6emvSJjlo1UE8y+MhlzjudEJxapUnRAGUAgKA0ff5rRruo w9+Mt9qrv/35Xo5L8mYBAptYI0/ZGOADgnQdmujtHhcEmLUQbpR04OLsySTr6vp6ozQV uyaKkToueoWvOBxhrl7I+l7Twi+8crArk06LVHt/JG6PuaPQNvAULHr0PJbZ5pQPjtCx MKfw== X-Forwarded-Encrypted: i=1; AJvYcCUmBxHaxnUOqBdwlvXFsyJYfAZzbG5o3TX3WFrCycfqp+6ToE0pGHwsvY9ttgZUH9vKUVq1sunVSRV7+12PmKIDlgBTpMFEHpaZIheH5Q== X-Gm-Message-State: AOJu0YyKls743SRZC7edIDw+dDjqd+8meF+BcDsTqrgpy8xLJ5Fa9m3L Q8a16yXxWd6MrKtq8sDGjzyfkSCwLYvO+r9aW6KOLdSmEySVcPerFZRmkB4C5DzdGIRgD1OLQ2r PJSI1o7RUoRQw7APD/b8VrBhSF3M3Tbspx2Xhb+5uEWQFHvb4hBGpcBq9ZyEOtpg= X-Received: by 2002:a05:6102:dd3:b0:476:fab9:237d with SMTP id e19-20020a0561020dd300b00476fab9237dmr3651558vst.2.1711745448249; Fri, 29 Mar 2024 13:50:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbJHgBjF3eN8i3ddN3z1R3cQ/XH02K5EBI2mtVmXktFIkJdXz1ZhnDrVZGUZxKmIZMOtcJjg== X-Received: by 2002:a05:6102:dd3:b0:476:fab9:237d with SMTP id e19-20020a0561020dd300b00476fab9237dmr3651537vst.2.1711745447887; Fri, 29 Mar 2024 13:50:47 -0700 (PDT) Received: from x1gen2nano.redhat.com ([2600:1700:1ff0:d0e0::33]) by smtp.gmail.com with ESMTPSA id jz10-20020a0562140e6a00b00698f27c6460sm794271qvb.110.2024.03.29.13.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 13:50:44 -0700 (PDT) From: Andrew Halaney To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , "James E.J. Bottomley" , "Martin K. Petersen" , Hannes Reinecke , Janek Kotas , Alim Akhtar , Avri Altman , Bart Van Assche , Can Guo , Anjana Hari Cc: Andrew Halaney , Will Deacon , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 11/11] scsi: ufs: core: Remove unnecessary wmb() prior to writing run/stop regs Date: Fri, 29 Mar 2024 15:46:53 -0500 Message-ID: <20240329-ufs-reset-ensure-effect-before-delay-v5-11-181252004586@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329-ufs-reset-ensure-effect-before-delay-v5-0-181252004586@redhat.com> References: <20240329-ufs-reset-ensure-effect-before-delay-v5-0-181252004586@redhat.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.13.0 Currently a wmb() is used to ensure that writes to the UTP_TASK_REQ_LIST_BASE* regs are completed prior to following writes to the run/stop registers. wmb() ensure that the write completes, but completion doesn't mean that it isn't stored in a buffer somewhere. The recommendation for ensuring the 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 But, none of that is necessary here. All of the writel()/readl()'s here are to the same endpoint, so they will be ordered. There's no subsequent delay() etc that requires it to have taken effect already, so no readback is necessary here. For that reason just drop the wmb() altogether. Fixes: 897efe628d7e ("scsi: ufs: add missing memory barriers") Signed-off-by: Andrew Halaney --- drivers/ufs/core/ufshcd.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index a2f2941450fd..cf6a24e550f0 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4769,12 +4769,6 @@ int ufshcd_make_hba_operational(struct ufs_hba *hba) ufshcd_writel(hba, upper_32_bits(hba->utmrdl_dma_addr), REG_UTP_TASK_REQ_LIST_BASE_H); - /* - * Make sure base address and interrupt setup are updated before - * enabling the run/stop registers below. - */ - wmb(); - /* * UCRDY, UTMRLDY and UTRLRDY bits must be 1 */