mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 01:45:18 +02:00
BACKPORT: scsi: ufs: core: Maximum RTT supported by the host driver
Allow platform vendors to take precedence having their own max rtt support.
This makes sense because the host controller's nortt characteristic may
vary among vendors.
while at it, set this value for Mediatek, as requested by Peter -
https://lore.kernel.org/all/0a57d6bab739d6a10584f2baba115d00dfc9c94c.camel@mediatek.com/
Change-Id: I577997ccb7d132b10e3fe338108093f4a68b1d35
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20240530142510.734-3-avri.altman@wdc.com
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 362473899
(cherry picked from commit e75ff63300
)
[ bvanassche: converted the MTK RTT limit into a test based on the controller name ]
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
parent
4bf609a0ed
commit
7a9edc1b85
|
@ -8160,6 +8160,9 @@ static void ufshcd_set_rtt(struct ufs_hba *hba)
|
|||
struct ufs_dev_info *dev_info = &hba->dev_info;
|
||||
u32 rtt = 0;
|
||||
u32 dev_rtt = 0;
|
||||
const int max_num_rtt = hba->vops && hba->vops->name &&
|
||||
strcmp(hba->vops->name, "mediatek.ufshci") == 0 ? 2 : 0;
|
||||
int host_rtt_cap = max_num_rtt ? max_num_rtt : to_hba_priv(hba)->nortt;
|
||||
|
||||
/* RTT override makes sense only for UFS-4.0 and above */
|
||||
if (dev_info->wspecversion < 0x400)
|
||||
|
@ -8175,7 +8178,8 @@ static void ufshcd_set_rtt(struct ufs_hba *hba)
|
|||
if (dev_rtt != DEFAULT_MAX_NUM_RTT)
|
||||
return;
|
||||
|
||||
rtt = min_t(int, to_hba_priv(hba)->rtt_cap, to_hba_priv(hba)->nortt);
|
||||
rtt = min_t(int, to_hba_priv(hba)->rtt_cap, host_rtt_cap);
|
||||
|
||||
if (rtt == dev_rtt)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user