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 v4 2/3] scsi: ufs: Allow platform vendors to set rtt
Date: Thu, 16 May 2024 08:51:23 +0300 [thread overview]
Message-ID: <20240516055124.24490-3-avri.altman@wdc.com> (raw)
In-Reply-To: <20240516055124.24490-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 defer 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 c472bfdf071e..0407d1064e74 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8312,7 +8312,10 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
if (hba->ext_iid_sup)
ufshcd_ext_iid_probe(hba, desc_buf);
- ufshcd_rtt_set(hba, desc_buf);
+ if (hba->vops && hba->vops->rtt_set)
+ hba->vops->rtt_set(hba, desc_buf);
+ else
+ ufshcd_rtt_set(hba, desc_buf);
/*
* ufshcd_read_string_desc returns size of the string
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index d74bd2d67b06..9237ea65bd26 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
+ * @rtt_set: 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 (*rtt_set)(struct ufs_hba *hba, u8 *desc_buf);
};
/* clock gating state */
--
2.34.1
next prev parent reply other threads:[~2024-05-16 5:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 5:51 [PATCH v4 0/3] scsi: ufs: Allow RTT negotiation Avri Altman
2024-05-16 5:51 ` [PATCH v4 1/3] " Avri Altman
2024-05-16 14:28 ` Bart Van Assche
2024-05-16 15:21 ` Avri Altman
2024-05-16 16:04 ` Bart Van Assche
2024-05-16 23:56 ` Avri Altman
2024-05-16 5:51 ` Avri Altman [this message]
2024-05-16 14:12 ` [PATCH v4 2/3] scsi: ufs: Allow platform vendors to set rtt Bart Van Assche
2024-05-16 15:23 ` Avri Altman
2024-05-16 5:51 ` [PATCH v4 3/3] scsi: ufs: sysfs: Make max_number_of_rtt read-write Avri Altman
2024-05-16 14:17 ` Bart Van Assche
2024-05-16 15:31 ` 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=20240516055124.24490-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
all inboxes | Powered by JetHome®