From: Ranjan Kumar <ranjan.kumar@broadcom.com>
[ Upstream commit 4be7599d6b27bade41bfccca42901b917c01c30c ]
Add handling for MPI26_SAS_NEG_LINK_RATE_22_5 in
_transport_convert_phy_link_rate(). This maps the new 22.5 Gbps
negotiated rate to SAS_LINK_RATE_22_5_GBPS, to get correct PHY link
speeds.
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Message-Id: [off-list ref]
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
YES
- Adding the `MPI26_SAS_NEG_LINK_RATE_22_5` case in
`_transport_convert_phy_link_rate()` maps firmware’s new 22.5 Gbps
negotiation code to the existing transport-layer enum
(`SAS_LINK_RATE_22_5_GBPS`), ensuring the driver reports the correct
speed instead of falling into the “unknown” default path
(`drivers/scsi/mpt3sas/mpt3sas_transport.c:169`,
`drivers/scsi/mpt3sas/mpt3sas_transport.c:188`).
- The converted value feeds directly into each SAS phy’s
`negotiated_linkrate` field when links are refreshed
(`drivers/scsi/mpt3sas/mpt3sas_transport.c:1160`), which backs sysfs
reporting and link-management heuristics; without the mapping,
hardware running at 22.5 Gbps is exposed as “unknown”, degrading
diagnostics and any policy that depends on link speed.
- All constants used here have been present in stables for years (e.g.,
`MPI26_SAS_NEG_LINK_RATE_22_5` in
`drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h:2067`, `SAS_LINK_RATE_22_5_GBPS`
in `include/scsi/scsi_transport_sas.h:44`), so the change is self-
contained, matches what the newer mpi3mr driver already does for the
same rate, and carries negligible regression risk.
drivers/scsi/mpt3sas/mpt3sas_transport.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c
index 66fd301f03b0d..f3400d01cc2ae 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
@@ -166,6 +166,9 @@ _transport_convert_phy_link_rate(u8 link_rate)
case MPI25_SAS_NEG_LINK_RATE_12_0:
rc = SAS_LINK_RATE_12_0_GBPS;
break;
+ case MPI26_SAS_NEG_LINK_RATE_22_5:
+ rc = SAS_LINK_RATE_22_5_GBPS;
+ break;
case MPI2_SAS_NEG_LINK_RATE_PHY_DISABLED:
rc = SAS_PHY_DISABLED;
break;
--
2.51.0