aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2012-01-19 15:01:04 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 09:08:56 -0500
commit9bc3711cbb67ac620bf09b4a147cbab45b2c36c0 (patch)
tree968b501235acd627df8a821706de397d603e3446 /drivers/scsi/hpsa.c
parentf79cfec6b1906ab10ef70dccd601db25c97bae17 (diff)
[SCSI] hpsa: Fix problem with MSA2xxx devices
Upgraded firmware on Smart Array P7xx (and some others) made them show up as SCSI revision 5 devices and this caused the driver to fail to map MSA2xxx logical drives to the correct bus/target/lun. A symptom of this would be that the target ID of the logical drives as presented by the external storage array is ignored, and all such logical drives are assigned to target zero, differentiated only by LUN. Some multipath software reportedly does not deal well with this behavior, failing to recognize different paths to the same device as such. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index d048b69962ea..4e7df2e5701e 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1637,30 +1637,26 @@ static void figure_bus_target_lun(struct ctlr_info *h,
1637 1637
1638 if (is_logical_dev_addr_mode(lunaddrbytes)) { 1638 if (is_logical_dev_addr_mode(lunaddrbytes)) {
1639 /* logical device */ 1639 /* logical device */
1640 if (unlikely(is_scsi_rev_5(h))) { 1640 lunid = le32_to_cpu(*((__le32 *) lunaddrbytes));
1641 /* p1210m, logical drives lun assignments 1641 if (is_msa2xxx(h, device)) {
1642 * match SCSI REPORT LUNS data. 1642 /* msa2xxx way, put logicals on bus 1
1643 * and match target/lun numbers box
1644 * reports.
1643 */ 1645 */
1644 lunid = le32_to_cpu(*((__le32 *) lunaddrbytes)); 1646 *bus = 1;
1645 *bus = 0; 1647 *target = (lunid >> 16) & 0x3fff;
1646 *target = 0; 1648 *lun = lunid & 0x00ff;
1647 *lun = (lunid & 0x3fff) + 1;
1648 } else { 1649 } else {
1649 /* not p1210m... */ 1650 if (likely(is_scsi_rev_5(h))) {
1650 lunid = le32_to_cpu(*((__le32 *) lunaddrbytes)); 1651 /* All current smart arrays (circa 2011) */
1651 if (is_msa2xxx(h, device)) { 1652 *bus = 0;
1652 /* msa2xxx way, put logicals on bus 1 1653 *target = 0;
1653 * and match target/lun numbers box 1654 *lun = (lunid & 0x3fff) + 1;
1654 * reports.
1655 */
1656 *bus = 1;
1657 *target = (lunid >> 16) & 0x3fff;
1658 *lun = lunid & 0x00ff;
1659 } else { 1655 } else {
1660 /* Traditional smart array way. */ 1656 /* Traditional old smart array way. */
1661 *bus = 0; 1657 *bus = 0;
1662 *lun = 0;
1663 *target = lunid & 0x3fff; 1658 *target = lunid & 0x3fff;
1659 *lun = 0;
1664 } 1660 }
1665 } 1661 }
1666 } else { 1662 } else {