From: Avri Altman <avri.altman@wdc.com>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
Bean Huo <beanhuo@micron.com>,
Peter Wang <peter.wang@mediatek.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Avri Altman <avri.altman@wdc.com>
Subject: [PATCH v5 2/3] scsi: ufs: Allow platform vendors to set rtt
Date: Thu, 23 May 2024 15:58:25 +0300 [thread overview]
Message-ID: <20240523125827.818-3-avri.altman@wdc.com> (raw)
In-Reply-To: <20240523125827.818-1-avri.altman@wdc.com>
Allow platform vendors to take precedence having their own rtt
negotiation mechanism. This makes sense because the host controller's
nortt characteristic may vary among vendors.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
drivers/ufs/core/ufshcd.c | 5 ++++-
include/ufs/ufshcd.h | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 7df8bcacbe7e..d8e0e80d66a5 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8542,7 +8542,10 @@ static int ufshcd_device_params_init(struct ufs_hba *hba)
goto out;
}
- ufshcd_set_rtt(hba);
+ if (hba->vops && hba->vops->set_rtt)
+ hba->vops->set_rtt(hba);
+ else
+ ufshcd_set_rtt(hba);
ufshcd_get_ref_clk_gating_wait(hba);
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index d74bd2d67b06..495b50a72f9f 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -329,6 +329,7 @@ struct ufs_pwr_mode_info {
* @get_outstanding_cqs: called to get outstanding completion queues
* @config_esi: called to config Event Specific Interrupt
* @config_scsi_dev: called to configure SCSI device parameters
+ * @set_rtt: negotiate rtt
*/
struct ufs_hba_variant_ops {
const char *name;
@@ -374,6 +375,7 @@ struct ufs_hba_variant_ops {
int (*get_outstanding_cqs)(struct ufs_hba *hba,
unsigned long *ocqs);
int (*config_esi)(struct ufs_hba *hba);
+ void (*set_rtt)(struct ufs_hba *hba);
};
/* clock gating state */
--
2.34.1
next prev parent reply other threads:[~2024-05-23 12:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-23 12:58 [PATCH v5 0/3] scsi: ufs: Allow RTT negotiation Avri Altman
2024-05-23 12:58 ` [PATCH v5 1/3] " Avri Altman
2024-05-23 12:58 ` Avri Altman [this message]
2024-05-23 13:03 ` [PATCH v5 2/3] scsi: ufs: Allow platform vendors to set rtt Christoph Hellwig
2024-05-23 13:09 ` Avri Altman
2024-05-23 13:11 ` hch
2024-05-24 6:06 ` Peter Wang (王信友)
2024-05-24 13:56 ` Bart Van Assche
2024-05-25 14:55 ` Avri Altman
2024-05-23 12:58 ` [PATCH v5 3/3] scsi: ufs: sysfs: Make max_number_of_rtt read-write Avri Altman
2024-05-23 23:05 ` Bart Van Assche
2024-05-24 3:54 ` Avri Altman
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=20240523125827.818-3-avri.altman@wdc.com \
--to=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).