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>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Peter Wang <peter.wang@mediatek.com>,
Avri Altman <avri.altman@wdc.com>,
Andrew Halaney <ahalaney@redhat.com>,
Bean Huo <beanhuo@micron.com>
Subject: [PATCH v4 10/10] scsi: ufs: core: Remove the second argument of ufshcd_device_init()
Date: Thu, 5 Sep 2024 15:01:36 -0700 [thread overview]
Message-ID: <20240905220214.738506-11-bvanassche@acm.org> (raw)
In-Reply-To: <20240905220214.738506-1-bvanassche@acm.org>
Both ufshcd_device_init() callers pass 'false' as second argument. Hence,
remove that second argument.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/ufs/core/ufshcd.c | 44 +++++----------------------------------
1 file changed, 5 insertions(+), 39 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 17615b56e83e..779a0c7559b2 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -298,7 +298,7 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba);
static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd);
static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag);
static void ufshcd_hba_exit(struct ufs_hba *hba);
-static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params);
+static int ufshcd_device_init(struct ufs_hba *hba);
static int ufshcd_probe_hba(struct ufs_hba *hba);
static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on);
static inline void ufshcd_add_delay_before_dme_cmd(struct ufs_hba *hba);
@@ -7695,7 +7695,7 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
/* Establish the link again and restore the device */
if (!err) {
- err = ufshcd_device_init(hba, /*init_dev_params=*/false);
+ err = ufshcd_device_init(hba);
if (!err)
err = ufshcd_probe_hba(hba);
}
@@ -8770,9 +8770,8 @@ static int ufshcd_post_device_init(struct ufs_hba *hba)
return 0;
}
-static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
+static int ufshcd_device_init(struct ufs_hba *hba)
{
- struct Scsi_Host *host = hba->host;
int ret;
ret = ufshcd_activate_link(hba);
@@ -8780,7 +8779,7 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
return ret;
/* Reconfigure MCQ upon reset */
- if (hba->mcq_enabled && !init_dev_params) {
+ if (hba->mcq_enabled) {
ufshcd_config_mcq(hba);
ufshcd_mcq_enable(hba);
}
@@ -8795,39 +8794,6 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
if (ret)
return ret;
- /*
- * Initialize UFS device parameters used by driver, these
- * parameters are associated with UFS descriptors.
- */
- if (init_dev_params) {
- ret = ufshcd_device_params_init(hba);
- if (ret)
- return ret;
- if (is_mcq_supported(hba) && !hba->scsi_host_added) {
- ufshcd_mcq_enable(hba);
- ret = ufshcd_alloc_mcq(hba);
- if (!ret) {
- ufshcd_config_mcq(hba);
- } else {
- /* Continue with SDB mode */
- ufshcd_mcq_disable(hba);
- use_mcq_mode = false;
- dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
- ret);
- }
- ret = scsi_add_host(host, hba->dev);
- if (ret) {
- dev_err(hba->dev, "scsi_add_host failed\n");
- return ret;
- }
- hba->scsi_host_added = true;
- } else if (is_mcq_supported(hba)) {
- /* UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH is set */
- ufshcd_config_mcq(hba);
- ufshcd_mcq_enable(hba);
- }
- }
-
return ufshcd_post_device_init(hba);
}
@@ -8861,7 +8827,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
}
/* Reinit the device */
- ret = ufshcd_device_init(hba, /*init_dev_params=*/false);
+ ret = ufshcd_device_init(hba);
if (ret)
goto out;
}
prev parent reply other threads:[~2024-09-05 22:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 22:01 [PATCH v4 00/10] Simplify the UFS driver initialization code Bart Van Assche
2024-09-05 22:01 ` [PATCH v4 01/10] scsi: ufs: core: Introduce ufshcd_add_scsi_host() Bart Van Assche
2024-09-06 23:51 ` Bao D. Nguyen
2024-09-05 22:01 ` [PATCH v4 02/10] scsi: ufs: core: Introduce ufshcd_activate_link() Bart Van Assche
2024-09-06 23:59 ` Bao D. Nguyen
2024-09-09 17:08 ` Bart Van Assche
2024-09-05 22:01 ` [PATCH v4 03/10] scsi: ufs: core: Introduce ufshcd_post_device_init() Bart Van Assche
2024-09-07 0:24 ` Bao D. Nguyen
2024-09-05 22:01 ` [PATCH v4 04/10] scsi: ufs: core: Call ufshcd_add_scsi_host() later Bart Van Assche
2024-09-07 10:52 ` Bao D. Nguyen
2024-09-05 22:01 ` [PATCH v4 05/10] scsi: ufs: core: Move the ufshcd_device_init() call Bart Van Assche
2024-09-07 11:12 ` Bao D. Nguyen
2024-09-05 22:01 ` [PATCH v4 06/10] scsi: ufs: core: Move the ufshcd_device_init(hba, true) call Bart Van Assche
2024-09-07 19:38 ` Bao D. Nguyen
2024-09-05 22:01 ` [PATCH v4 07/10] scsi: ufs: core: Expand " Bart Van Assche
2024-09-07 20:15 ` Bao D. Nguyen
2024-09-05 22:01 ` [PATCH v4 08/10] scsi: ufs: core: Move the MCQ scsi_add_host() call Bart Van Assche
2024-09-07 20:27 ` Bao D. Nguyen
2024-09-05 22:01 ` [PATCH v4 09/10] scsi: ufs: core: Move code out of an if-statement Bart Van Assche
2024-09-07 20:36 ` Bao D. Nguyen
2024-09-05 22:01 ` Bart Van Assche [this message]
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=20240905220214.738506-11-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=ahalaney@redhat.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=linux-scsi@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@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