From patchwork Mon Jan 22 17:24:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13525881 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 2CA3E6311E for ; Mon, 22 Jan 2024 17:25:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944343; cv=none; b=OssdJnJXWf+YIxrzTzeS3u0ff3Cjd16a39Gjbb0RqwicFLe55qWETtKOi0CE7qqb3SVRRQbfv+wlkKyRjZnChTCH05l8I7GZ2tqiaj+mvwgIkRdkjEk2OQqX3uZLwZN4R0BbmPylyqXgXuOgA+Co7T07I8sgogvsJUNcX6L3b0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944343; c=relaxed/simple; bh=lrt06U9MjfT0+aAqB1+xoJHCrTf+UY09+oCiHhhT3Fc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aMJox8Ke/1A4TX99+Av6XZYpyBCXF3Szm+Xry9mZV/WJDpy40H68O6aMnIopoP8g2/NLoU8ib/9AY6e+ZZMEhoqyl8qvHlzgAE36XjAUuC8IovIXNvQYmrYK+1cdDmEiRwewTW05aBqCpvIl6G71ObtqK8qwMqmYVsOqhZlDVlE= 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=igFqURIF; arc=none smtp.client-ip=170.10.129.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="igFqURIF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705944341; 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=xvA2uv2JUZrdT2MKiipHpiF6tbdfVobWEO3O5fZ7MOA=; b=igFqURIFOW2u6PsxYBft1AMTYtpwpZkQzSjE4oBXde86q3mNRQkhh8ep474A+1BtOS5WyN T0LBmpVoGfFdwBdpY8i2wtTT/KrVzT+jiNtt8tEMRiWIT1ikI4aAdEB5//hfzhC8xOxnmP 2zZslSDjoVM+y3nCQBtsApsi+5iZZvA= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-t6Bxg40VMPSY-4vgg9WXdA-1; Mon, 22 Jan 2024 12:25:39 -0500 X-MC-Unique: t6Bxg40VMPSY-4vgg9WXdA-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-429ca123301so70278811cf.1 for ; Mon, 22 Jan 2024 09:25:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705944337; x=1706549137; 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=xvA2uv2JUZrdT2MKiipHpiF6tbdfVobWEO3O5fZ7MOA=; b=gwkL8Evgrr7JpMmg/ElvooDrTcmeNtWpFXpEHF9Sv4B6LX4Sb8gqsLaY3oK3vW68PQ 1BnPprOo2Qr+/oOV3KBaT4JY514jGENL+7Z3gmTBDXzEI1KJckcMXeVInnP/MH2sBDC1 pZ0ef1ePjc/2qKWibib9N//GTiyqv8N0kpvtvs/2Xg33ulaoYm2MzZ/oURWz70up3aeM jodoHhnVsun8rvfdv408k9diQcBbsZneIJwrK8FmFXXYVE0ldgLd8BxWmU+gjAqWby4b qIoPnvAsKd5224R31uEM+or0OeB6cxVB6Qs4UZx0HI/TVcsb5uGoOpFEiYjR0RHnFkha LEyQ== X-Gm-Message-State: AOJu0YzgwplPRIdOdD+l5OWMH7qsADF5kdT8DJyI6S+K/oNjQK40Ni5y PCKgq1yM4g8fos3pMj6o8vReNe1mQxuZgdoItirCQe1F9teT+YZZ+rYjE7nTZA8GtaO1YquSrLn vbHXiv0H0mxGRsBdojdkr/w9xzMvn15nd4pUpwHEXZYErWnm5QTGYs2jm0qxQUX0= X-Received: by 2002:ac8:4c8c:0:b0:42a:2666:a410 with SMTP id j12-20020ac84c8c000000b0042a2666a410mr5552774qtv.63.1705944336853; Mon, 22 Jan 2024 09:25:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJcK9rtAYzFRJnLuAvRQK60DVL+9ETfuJh2rfvtLBRbekkrCVPXBMhXR6sp/967Twv/QzifA== X-Received: by 2002:ac8:4c8c:0:b0:42a:2666:a410 with SMTP id j12-20020ac84c8c000000b0042a2666a410mr5552733qtv.63.1705944336119; Mon, 22 Jan 2024 09:25:36 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 09:25:35 -0800 (PST) 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 Cc: Andrew Halaney , Will Deacon , linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC v4 11/11] scsi: ufs: core: Remove unnecessary wmb() prior to writing run/stop regs Date: Mon, 22 Jan 2024 11:24:07 -0600 Message-ID: <20240122-ufs-reset-ensure-effect-before-delay-v4-11-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-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.12.3 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 21f93d8e5818..358857ea9ff6 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4722,12 +4722,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 */