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>,
Peter Wang <peter.wang@mediatek.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Bean Huo <beanhuo@micron.com>,
Arthur Simchaev <arthur.simchaev@wdc.com>,
Lu Hongfei <luhongfei@vivo.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Manivannan Sadhasivam <mani@kernel.org>,
Asutosh Das <quic_asutoshd@quicinc.com>,
zhanghui <zhanghui31@xiaomi.com>,
Po-Wen Kao <powen.kao@mediatek.com>,
Eric Biggers <ebiggers@google.com>,
Keoseong Park <keosung.park@samsung.com>
Subject: [PATCH v14 16/19] scsi: ufs: Change the return type of ufshcd_auto_hibern8_update()
Date: Mon, 23 Oct 2023 14:54:07 -0700 [thread overview]
Message-ID: <20231023215638.3405959-17-bvanassche@acm.org> (raw)
In-Reply-To: <20231023215638.3405959-1-bvanassche@acm.org>
A later patch will introduce an error path in ufshcd_auto_hibern8_update().
Change the return type of that function before introducing calls to that
function in the host drivers such that the host drivers only have to be
modified once.
Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Reviewed-by: Peter Wang <peter.wang@mediatek.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/ufs-sysfs.c | 2 +-
drivers/ufs/core/ufshcd-priv.h | 1 -
drivers/ufs/core/ufshcd.c | 6 ++++--
include/ufs/ufshcd.h | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c
index c95906443d5f..a1554eac9bbc 100644
--- a/drivers/ufs/core/ufs-sysfs.c
+++ b/drivers/ufs/core/ufs-sysfs.c
@@ -203,7 +203,7 @@ static ssize_t auto_hibern8_store(struct device *dev,
goto out;
}
- ufshcd_auto_hibern8_update(hba, ufshcd_us_to_ahit(timer));
+ ret = ufshcd_auto_hibern8_update(hba, ufshcd_us_to_ahit(timer));
out:
up(&hba->host_sem);
diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h
index f42d99ce5bf1..de8e891da36a 100644
--- a/drivers/ufs/core/ufshcd-priv.h
+++ b/drivers/ufs/core/ufshcd-priv.h
@@ -60,7 +60,6 @@ int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
enum attr_idn idn, u8 index, u8 selector, u32 *attr_val);
int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
enum flag_idn idn, u8 index, bool *flag_res);
-void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
void ufshcd_compl_one_cqe(struct ufs_hba *hba, int task_tag,
struct cq_entry *cqe);
int ufshcd_mcq_init(struct ufs_hba *hba);
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 38e79ce05545..d3718fbe51b9 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -4313,13 +4313,13 @@ static void ufshcd_configure_auto_hibern8(struct ufs_hba *hba)
ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER);
}
-void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
+int ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
{
unsigned long flags;
bool update = false;
if (!ufshcd_is_auto_hibern8_supported(hba))
- return;
+ return 0;
spin_lock_irqsave(hba->host->host_lock, flags);
if (hba->ahit != ahit) {
@@ -4336,6 +4336,8 @@ void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
ufshcd_release(hba);
ufshcd_rpm_put_sync(hba);
}
+
+ return 0;
}
EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update);
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index fceef91d186e..8fd95a5d5538 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1356,7 +1356,7 @@ 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_update(struct ufs_hba *hba, u32 ahit);
+int 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);
#define SD_ASCII_STD true
next prev parent reply other threads:[~2023-10-23 21:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 21:53 [PATCH v14 00/19] Improve write performance for zoned UFS devices Bart Van Assche
2023-10-23 21:53 ` [PATCH v14 01/19] block: Introduce more member variables related to zone write locking Bart Van Assche
2023-10-23 21:53 ` [PATCH v14 02/19] block: Only use write locking if necessary Bart Van Assche
2023-10-23 23:29 ` Damien Le Moal
2023-10-23 21:53 ` [PATCH v14 03/19] block: Preserve the order of requeued zoned writes Bart Van Assche
2023-10-23 23:30 ` Damien Le Moal
2023-10-23 21:53 ` [PATCH v14 04/19] block/mq-deadline: Only use zone locking if necessary Bart Van Assche
2023-10-23 21:53 ` [PATCH v14 05/19] scsi: Add an argument to scsi_eh_flush_done_q() Bart Van Assche
2023-10-24 0:07 ` Damien Le Moal
2023-10-24 9:26 ` John Garry
2023-10-24 17:17 ` Bart Van Assche
2023-10-24 18:20 ` John Garry
2023-10-23 21:53 ` [PATCH v14 06/19] scsi: core: Introduce a mechanism for reordering requests in the error handler Bart Van Assche
2023-10-24 0:09 ` Damien Le Moal
2023-10-23 21:53 ` [PATCH v14 07/19] scsi: core: Add unit tests for scsi_call_prepare_resubmit() Bart Van Assche
2023-10-23 21:53 ` [PATCH v14 08/19] scsi: sd: Sort commands by LBA before resubmitting Bart Van Assche
2023-10-24 0:11 ` Damien Le Moal
2023-10-23 21:54 ` [PATCH v14 09/19] scsi: sd: Add a unit test for sd_cmp_sector() Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 10/19] scsi: core: Retry unaligned zoned writes Bart Van Assche
2023-10-24 0:13 ` Damien Le Moal
2023-10-24 17:22 ` Bart Van Assche
2023-10-25 7:25 ` Damien Le Moal
2023-10-25 19:28 ` Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 11/19] scsi: sd_zbc: Only require an I/O scheduler if needed Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 12/19] scsi: scsi_debug: Add the preserves_write_order module parameter Bart Van Assche
2023-10-24 0:13 ` Damien Le Moal
2023-10-24 17:25 ` Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 13/19] scsi: scsi_debug: Support injecting unaligned write errors Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 14/19] scsi: ufs: hisi: Rework the code that disables auto-hibernation Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 15/19] scsi: ufs: Rename ufshcd_auto_hibern8_enable() and make it static Bart Van Assche
2023-10-23 21:54 ` Bart Van Assche [this message]
2023-10-23 21:54 ` [PATCH v14 17/19] scsi: ufs: Simplify ufshcd_auto_hibern8_update() Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 18/19] scsi: ufs: Forbid auto-hibernation without I/O scheduler Bart Van Assche
2023-10-23 21:54 ` [PATCH v14 19/19] scsi: ufs: Inform the block layer about write ordering Bart Van Assche
2023-10-23 23:43 ` [PATCH v14 00/19] Improve write performance for zoned UFS devices 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=20231023215638.3405959-17-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=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=luhongfei@vivo.com \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=peter.wang@mediatek.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 \
--cc=zhanghui31@xiaomi.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;
as well as URLs for NNTP newsgroup(s).