diff options
author | Xiangliang Yu <yuxiangl@marvell.com> | 2011-09-29 00:32:37 -0700 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-02 13:09:18 -0500 |
commit | 6ceae7c6234f2961dc59912412e8c0706d825873 (patch) | |
tree | 1ddbb99ef9109bc5cf6995e61be431c094233c6a /drivers/scsi/mvsas | |
parent | 983d3fdd332742167d0482c06fd29cf4b8a687c0 (diff) | |
download | linux-stable-6ceae7c6234f2961dc59912412e8c0706d825873.tar.gz linux-stable-6ceae7c6234f2961dc59912412e8c0706d825873.tar.bz2 linux-stable-6ceae7c6234f2961dc59912412e8c0706d825873.zip |
[SCSI] mvsas: fix expander link error
Expanders fail to link when the phy rates are mismatched.
Signed-off-by: Xiangliang Yu <yuxiangl@marvell.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mvsas')
-rw-r--r-- | drivers/scsi/mvsas/mv_sas.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index f2ac01fd09c0..ab2a71fd0fde 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c @@ -396,7 +396,7 @@ static int mvs_task_prep_smp(struct mvs_info *mvi, /* generate open address frame hdr (first 12 bytes) */ /* initiator, SMP, ftype 1h */ buf_oaf[0] = (1 << 7) | (PROTOCOL_SMP << 4) | 0x01; - buf_oaf[1] = dev->linkrate & 0xf; + buf_oaf[1] = min(sas_port->linkrate, dev->linkrate) & 0xf; *(u16 *)(buf_oaf + 2) = 0xFFFF; /* SAS SPEC */ memcpy(buf_oaf + 4, dev->sas_addr, SAS_ADDR_SIZE); @@ -541,7 +541,7 @@ static int mvs_task_prep_ata(struct mvs_info *mvi, /* generate open address frame hdr (first 12 bytes) */ /* initiator, STP, ftype 1h */ buf_oaf[0] = (1 << 7) | (PROTOCOL_STP << 4) | 0x1; - buf_oaf[1] = dev->linkrate & 0xf; + buf_oaf[1] = min(sas_port->linkrate, dev->linkrate) & 0xf; *(u16 *)(buf_oaf + 2) = cpu_to_be16(mvi_dev->device_id + 1); memcpy(buf_oaf + 4, dev->sas_addr, SAS_ADDR_SIZE); @@ -649,7 +649,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi, /* generate open address frame hdr (first 12 bytes) */ /* initiator, SSP, ftype 1h */ buf_oaf[0] = (1 << 7) | (PROTOCOL_SSP << 4) | 0x1; - buf_oaf[1] = dev->linkrate & 0xf; + buf_oaf[1] = min(sas_port->linkrate, dev->linkrate) & 0xf; *(u16 *)(buf_oaf + 2) = cpu_to_be16(mvi_dev->device_id + 1); memcpy(buf_oaf + 4, dev->sas_addr, SAS_ADDR_SIZE); |