From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bvanassche@acm.org>,
"Bao D . Nguyen" <quic_nguyenb@quicinc.com>,
Can Guo <quic_cang@quicinc.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Bean Huo <beanhuo@micron.com>,
Asutosh Das <quic_asutoshd@quicinc.com>,
Arthur Simchaev <Arthur.Simchaev@wdc.com>,
Manivannan Sadhasivam <mani@kernel.org>,
Po-Wen Kao <powen.kao@mediatek.com>,
Eric Biggers <ebiggers@google.com>,
Keoseong Park <keosung.park@samsung.com>,
Daniil Lunev <dlunev@chromium.org>
Subject: [PATCH v11 12/16] scsi: ufs: Rename ufshcd_auto_hibern8_enable() and make it static
Date: Tue, 22 Aug 2023 12:17:07 -0700 [thread overview]
Message-ID: <20230822191822.337080-13-bvanassche@acm.org> (raw)
In-Reply-To: <20230822191822.337080-1-bvanassche@acm.org>
Rename ufshcd_auto_hibern8_enable() into ufshcd_configure_auto_hibern8()
since this function can enable or disable auto-hibernation. Since
ufshcd_auto_hibern8_enable() is only used inside the UFSHCI driver core,
declare it static. Additionally, move the definition of this function to
just before its first caller.
Suggested-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/ufs/core/ufshcd.c | 24 +++++++++++-------------
include/ufs/ufshcd.h | 1 -
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 129446775796..f1bba459b46f 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -4337,6 +4337,14 @@ int ufshcd_uic_hibern8_exit(struct ufs_hba *hba)
}
EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_exit);
+static void ufshcd_configure_auto_hibern8(struct ufs_hba *hba)
+{
+ if (!ufshcd_is_auto_hibern8_supported(hba))
+ return;
+
+ ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER);
+}
+
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
{
unsigned long flags;
@@ -4356,21 +4364,13 @@ void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
!pm_runtime_suspended(&hba->ufs_device_wlun->sdev_gendev)) {
ufshcd_rpm_get_sync(hba);
ufshcd_hold(hba);
- ufshcd_auto_hibern8_enable(hba);
+ ufshcd_configure_auto_hibern8(hba);
ufshcd_release(hba);
ufshcd_rpm_put_sync(hba);
}
}
EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update);
-void ufshcd_auto_hibern8_enable(struct ufs_hba *hba)
-{
- if (!ufshcd_is_auto_hibern8_supported(hba))
- return;
-
- ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER);
-}
-
/**
* ufshcd_init_pwr_info - setting the POR (power on reset)
* values in hba power info
@@ -8815,8 +8815,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params)
if (hba->ee_usr_mask)
ufshcd_write_ee_control(hba);
- /* Enable Auto-Hibernate if configured */
- ufshcd_auto_hibern8_enable(hba);
+ ufshcd_configure_auto_hibern8(hba);
ufshpb_toggle_state(hba, HPB_RESET, HPB_PRESENT);
out:
@@ -9809,8 +9808,7 @@ static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
cancel_delayed_work(&hba->rpm_dev_flush_recheck_work);
}
- /* Enable Auto-Hibernate if configured */
- ufshcd_auto_hibern8_enable(hba);
+ ufshcd_configure_auto_hibern8(hba);
ufshpb_resume(hba);
goto out;
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 6dc11fa0ebb1..040d66d99912 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1363,7 +1363,6 @@ static inline int ufshcd_disable_host_tx_lcc(struct ufs_hba *hba)
return ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
}
-void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
void ufshcd_fixup_dev_quirks(struct ufs_hba *hba,
const struct ufs_dev_quirk *fixups);
next prev parent reply other threads:[~2023-08-22 19:19 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 19:16 [PATCH v11 00/16] Improve write performance for zoned UFS devices Bart Van Assche
2023-08-22 19:16 ` [PATCH v11 01/16] block: Introduce more member variables related to zone write locking Bart Van Assche
2023-08-23 6:18 ` Hannes Reinecke
2023-08-23 8:08 ` Nitesh Shetty
2023-08-22 19:16 ` [PATCH v11 02/16] block: Only use write locking if necessary Bart Van Assche
2023-08-23 6:19 ` Hannes Reinecke
2023-08-23 8:09 ` Nitesh Shetty
2023-08-22 19:16 ` [PATCH v11 03/16] block/mq-deadline: Only use zone " Bart Van Assche
2023-08-23 6:21 ` Hannes Reinecke
2023-08-23 8:23 ` Nitesh Shetty
2023-08-22 19:16 ` [PATCH v11 04/16] scsi: core: Introduce a mechanism for reordering requests in the error handler Bart Van Assche
2023-08-23 6:26 ` Hannes Reinecke
2023-08-23 15:15 ` Bart Van Assche
2023-08-23 23:22 ` Damien Le Moal
2023-08-24 14:47 ` Bart Van Assche
2023-08-24 16:44 ` Hannes Reinecke
2023-08-24 16:52 ` Bart Van Assche
2023-08-24 23:53 ` Damien Le Moal
2023-08-25 1:00 ` Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 05/16] scsi: core: Add unit tests for scsi_call_prepare_resubmit() Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 06/16] scsi: sd: Sort commands by LBA before resubmitting Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 07/16] scsi: core: Retry unaligned zoned writes Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 08/16] scsi: sd_zbc: Only require an I/O scheduler if needed Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 09/16] scsi: scsi_debug: Add the preserves_write_order module parameter Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 10/16] scsi: scsi_debug: Support injecting unaligned write errors Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 11/16] scsi: ufs: hisi: Rework the code that disables auto-hibernation Bart Van Assche
2023-08-22 19:17 ` Bart Van Assche [this message]
2023-08-22 19:17 ` [PATCH v11 13/16] scsi: ufs: Change the return type of ufshcd_auto_hibern8_update() Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 14/16] scsi: ufs: Simplify ufshcd_auto_hibern8_update() Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 15/16] scsi: ufs: Forbid auto-hibernation without I/O scheduler Bart Van Assche
2023-08-22 19:17 ` [PATCH v11 16/16] scsi: ufs: Inform the block layer about write ordering 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=20230822191822.337080-13-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=Arthur.Simchaev@wdc.com \
--cc=avri.altman@wdc.com \
--cc=axboe@kernel.dk \
--cc=beanhuo@micron.com \
--cc=dlunev@chromium.org \
--cc=ebiggers@google.com \
--cc=hch@lst.de \
--cc=jejb@linux.ibm.com \
--cc=keosung.park@samsung.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=powen.kao@mediatek.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=stanley.chu@mediatek.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