[PATCH] mvsas: plumb in phy speeds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

Signed-off-by: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>

---

diff --git a/drivers/scsi/mvsas.c b/drivers/scsi/mvsas.c
index 5ec0665..158568a 100755
--- a/drivers/scsi/mvsas.c
+++ b/drivers/scsi/mvsas.c
@@ -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);


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux