From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5A85D168C4; Mon, 27 May 2024 19:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716837919; cv=none; b=kRqPygajtlSj8YciA6WdKwUgM6gmbivzDjZMJEPs2XcHkN+/0EmQZEG1L+Do27TTfFx3iFEcNrnp2ipRxuE7I43R9yiEJCvLwTVeuMQDYl6t+q0Q7xuT1/3PXd5ZCn1ieY3FT5wMwThx+XcqI79IR92cTEDqhczk7wdWk4K6KyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716837919; c=relaxed/simple; bh=WWVkWGdDTAw5JVOV4bES0W6BvWfzpemIgJGcuLU3DKc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JRWTVv7eTQXxI+KjGoEZlJmswf9dIv2q/q2hr2I50ck4BNACxMG1XoXLHmOgT/X0gwv8jCOKJmORuQ6dBE1pzwOF8L6bdL4MP67A68vksfHmQKJCW9XJRRytif5IfMFZp3hexPC45lKcaA6FWtzjCd2KHL4HdYMmmspUihFUyX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=m8XwPQbs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="m8XwPQbs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3CAFC2BBFC; Mon, 27 May 2024 19:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716837919; bh=WWVkWGdDTAw5JVOV4bES0W6BvWfzpemIgJGcuLU3DKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m8XwPQbsGZx16vOejp65i4YOFWXv0BiORrG2C1NzQvJVcimFyho5KbxzN7ctoAVOE h8HsnDQNG1be8fESPpfwudm/n+b7q5sLENK3qc/u/e2+IsMNTcWnR3gv5wZQJ9K+yl qmuWXc9qwCzLf++/xSftiaiHhjASPLv3Jv+Qdu24= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Can Guo , Andrew Halaney , Manivannan Sadhasivam , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.8 196/493] scsi: ufs: qcom: Perform read back after writing REG_UFS_SYS1CLK_1US Date: Mon, 27 May 2024 20:53:18 +0200 Message-ID: <20240527185636.755320668@linuxfoundation.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240527185626.546110716@linuxfoundation.org> References: <20240527185626.546110716@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andrew Halaney [ Upstream commit a862fafa263aea0f427d51aca6ff7fd9eeaaa8bd ] Currently after writing to REG_UFS_SYS1CLK_1US a mb() is used to ensure that write has gone through to the device. mb() ensures that the write completes, but completion doesn't mean that it isn't stored in a buffer somewhere. The recommendation for ensuring this bit has 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 bit hits 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: f06fcc7155dc ("scsi: ufs-qcom: add QUniPro hardware support and power optimizations") Reviewed-by: Can Guo Signed-off-by: Andrew Halaney Link: https://lore.kernel.org/r/20240329-ufs-reset-ensure-effect-before-delay-v5-2-181252004586@redhat.com Reviewed-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/ufs/host/ufs-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index bcbcf758925be..8aa55ed45d8e0 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -507,7 +507,7 @@ static int ufs_qcom_cfg_timers(struct ufs_hba *hba, u32 gear, * make sure above write gets applied before we return from * this function. */ - mb(); + ufshcd_readl(hba, REG_UFS_SYS1CLK_1US); } return 0; -- 2.43.0