Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Peter Wang <peter.wang@mediatek.com>,
	Huan Tang <tanghuan@vivo.com>, Avri Altman <avri.altman@wdc.com>,
	Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>,
	"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
	Daniel Lee <chullee@google.com>, Liu Song <liu.song13@zte.com.cn>,
	Bean Huo <huobean@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: [PATCH 6/7] ufs: core: Remove superfluous ufshcd_{hold,release}() calls
Date: Fri, 16 Jan 2026 10:26:08 -0800	[thread overview]
Message-ID: <20260116182628.3255116-7-bvanassche@acm.org> (raw)
In-Reply-To: <20260116182628.3255116-1-bvanassche@acm.org>

ufshcd_hold() and ufshcd_release() have been modified such that these
call runtime power management functions on the WLUN. Hence,
ufshcd_hold() calls that follow a ufshcd_rpm_get_sync() call and also
ufshcd_release() calls that precede ufshcd_rpm_put_sync() can be left
out.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufs-sysfs.c | 2 --
 drivers/ufs/core/ufshcd.c    | 4 ----
 2 files changed, 6 deletions(-)

diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c
index b33f8656edb5..2cc7f5063286 100644
--- a/drivers/ufs/core/ufs-sysfs.c
+++ b/drivers/ufs/core/ufs-sysfs.c
@@ -256,9 +256,7 @@ static int ufshcd_read_hci_reg(struct ufs_hba *hba, u32 *val, unsigned int reg)
 	}
 
 	ufshcd_rpm_get_sync(hba);
-	ufshcd_hold(hba);
 	*val = ufshcd_readl(hba, reg);
-	ufshcd_release(hba);
 	ufshcd_rpm_put_sync(hba);
 
 	up(&hba->host_sem);
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 1189a9fd39ff..8c388275308f 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -1809,7 +1809,6 @@ static ssize_t ufshcd_clkscale_enable_store(struct device *dev,
 		goto out;
 
 	ufshcd_rpm_get_sync(hba);
-	ufshcd_hold(hba);
 
 	hba->clk_scaling.is_enabled = value;
 
@@ -1834,7 +1833,6 @@ static ssize_t ufshcd_clkscale_enable_store(struct device *dev,
 		hba->clk_scaling.target_freq = freq;
 
 out_rel:
-	ufshcd_release(hba);
 	ufshcd_rpm_put_sync(hba);
 out:
 	up(&hba->host_sem);
@@ -4368,9 +4366,7 @@ void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
 	WRITE_ONCE(hba->ahit, ahit);
 	if (!pm_runtime_suspended(&hba->ufs_device_wlun->sdev_gendev)) {
 		ufshcd_rpm_get_sync(hba);
-		ufshcd_hold(hba);
 		ufshcd_configure_auto_hibern8(hba);
-		ufshcd_release(hba);
 		ufshcd_rpm_put_sync(hba);
 	}
 }

  parent reply	other threads:[~2026-01-16 18:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 18:26 [PATCH 0/7] ufs: Remove the clock gating code Bart Van Assche
2026-01-16 18:26 ` [PATCH 1/7] ufs: core: Change the type of an ufshcd_clkgate_delay_set() argument Bart Van Assche
2026-01-16 18:26 ` [PATCH 2/7] ufs: host: mediatek: Use ufshcd_clkgate_delay_set() Bart Van Assche
2026-01-16 18:26 ` [PATCH 3/7] ufs: core: Redirect clock gating to RPM Bart Van Assche
2026-01-17  2:05   ` kernel test robot
2026-01-17  2:16   ` kernel test robot
2026-01-16 18:26 ` [PATCH 4/7] ufs: core: Switch from " Bart Van Assche
2026-01-16 18:26 ` [PATCH 5/7] ufs: core: Remove unused code and data structures Bart Van Assche
2026-01-17  2:16   ` kernel test robot
2026-01-16 18:26 ` Bart Van Assche [this message]
2026-01-16 18:26 ` [PATCH 7/7] ufs: core: Remove ufshcd_{hold,release}() calls from the I/O path Bart Van Assche
2026-01-22 17:30 ` [PATCH 0/7] ufs: Remove the clock gating code Manivannan Sadhasivam
2026-01-23  7:26   ` Peter Wang (王信友)
2026-01-23 23:27     ` Bart Van Assche
2026-01-26  3:44       ` Peter Wang (王信友)
2026-01-26 22:27         ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260116182628.3255116-7-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=chullee@google.com \
    --cc=huobean@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liu.song13@zte.com.cn \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@mediatek.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=tanghuan@vivo.com \
    --cc=zhongqiu.han@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox