Skip to contentSkip to conversation

mvsas: plumb in phy speeds

PATCH New James Bottomley 1 participant 1 message Mar 1, 2008 SCSI

lore
Share & tools
lore

James Bottomley

author maintainer
#0 lore raw

PATCH 1/1 mvsas: plumb in phy speeds

The current mvsas driver doesn't display any link speeds in /sys. This is because it doesn't actually initialise any. Make mvsas initialise the correct sas_phy link speeds in mvs_update_phyinfo() (remembering that it might be called too early in the init sequence to have a phy).

---

drivers/scsi/mvsas.c +12 -0
index 5ec0665..158568a 100755
@@ -1049,6 +1049,7 @@ static void mvs_scan_start(struct Scsi_Host *shost)
 	struct mvs_info *mvi = SHOST_TO_SAS_HA(shost)->lldd_ha;
 
 	for (i = 0; i < mvi->chip->n_phy; ++i) {
+		mvs_update_phyinfo(mvi, i, 0);
 		mvs_bytes_dmaed(mvi, i);
 	}
 }
@@ -2524,6 +2531,17 @@ static void mvs_update_phyinfo(struct mvs_info *mvi, int i,
 		sas_phy->linkrate =
 			(phy->phy_status & PHY_NEG_SPP_PHYS_LINK_RATE_MASK) >>
 				PHY_NEG_SPP_PHYS_LINK_RATE_MASK_OFFSET;
+		if (sas_phy->phy) {
+			struct sas_phy *sphy = sas_phy->phy;
+
+			sphy->negotiated_linkrate = sas_phy->linkrate;
+			sphy->minimum_linkrate =
+				(phy->phy_status & PHY_MIN_SPP_PHYS_LINK_RATE_MASK) >> 8;
+			sphy->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS;
+			sphy->maximum_linkrate = 
+				(phy->phy_status & PHY_MAX_SPP_PHYS_LINK_RATE_MASK) >> 12;
+			sphy->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS;
+		}
 
 		/* Updated attached_sas_addr */
 		mvs_write_port_cfg_addr(mvi, i, PHYR_ATT_ADDR_HI);