From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Ke Wei <kewei.mv@gmail.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH] mvsas: plumb in phy speeds
Date: Sat, 01 Mar 2008 11:20:22 -0600 [thread overview]
Message-ID: <1204392022.4003.108.camel@localhost.localdomain> (raw)
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@HansenPartnership.com>
---
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);
reply other threads:[~2008-03-01 17:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1204392022.4003.108.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=kewei.mv@gmail.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox