mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 20:53:03 +02:00
scsi: ufs: ufs-pci: Add support for Intel UFS 4.0 HS-Gear5
Reliable HS-Gear5 operation on Intel UFS 4.0 controllers requires
configuring PA_INITIAL_ADAPT before changing the power mode. Without
this setting, the link fails to train reliably at Gear5.
Add a pwr_change_notify() hook to configure the adaptation mode before
the power mode transition. Enable this only for UFS 4.0 and later
controllers by checking hba->ufs_version.
Wire the hook into the existing Meteor Lake family variant operations
table (ufs_intel_mtl_hba_vops) instead of introducing a separate table,
since the Intel UFS 4.0 PCI variant (PCI ID 8086:D335) already uses this
vops table and the hook is internally gated on UFS version >= 4.0.
Use PA_INITIAL_ADAPT when the negotiated TX power mode is FAST_MODE or
FASTAUTO_MODE. Otherwise, reset the adaptation mode to PA_NO_ADAPT,
which is the default setting.
Fixes: 096cd6b7ad ("scsi: ufs: ufs-pci: Add support for Intel Nova Lake")
Signed-off-by: sangram kumar yerra <sangram.k.y@intel.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260818112830.453402-2-sangram.k.y@intel.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
parent
11300f8dde
commit
ef675ea168
|
|
@ -181,6 +181,25 @@ static int ufs_intel_lkf_pwr_change_notify(struct ufs_hba *hba,
|
|||
return err;
|
||||
}
|
||||
|
||||
static int ufs_intel_nvl_pwr_change_notify(struct ufs_hba *hba,
|
||||
enum ufs_notify_change_status stage,
|
||||
struct ufs_pa_layer_attr *dev_req_params)
|
||||
{
|
||||
int adapt_val;
|
||||
|
||||
if (stage != PRE_CHANGE || hba->ufs_version < ufshci_version(4, 0))
|
||||
return 0;
|
||||
|
||||
if (dev_req_params->pwr_tx == FAST_MODE || dev_req_params->pwr_tx == FASTAUTO_MODE)
|
||||
adapt_val = PA_INITIAL_ADAPT;
|
||||
else
|
||||
adapt_val = PA_NO_ADAPT;
|
||||
|
||||
ufshcd_dme_configure_adapt(hba, dev_req_params->gear_tx, adapt_val);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ufs_intel_lkf_apply_dev_quirks(struct ufs_hba *hba)
|
||||
{
|
||||
u32 granularity, peer_granularity;
|
||||
|
|
@ -527,6 +546,7 @@ static struct ufs_hba_variant_ops ufs_intel_mtl_hba_vops = {
|
|||
.exit = ufs_intel_common_exit,
|
||||
.hce_enable_notify = ufs_intel_hce_enable_notify,
|
||||
.link_startup_notify = ufs_intel_link_startup_notify,
|
||||
.pwr_change_notify = ufs_intel_nvl_pwr_change_notify,
|
||||
.resume = ufs_intel_resume,
|
||||
.device_reset = ufs_intel_device_reset,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user