aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2012-01-19 15:01:04 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-01 03:12:57 -0400
commitd4f3ef6343463dd129f1b97d9310a9a7ab235e7b (patch)
tree22b82bd877ddbee60e857deca692a0795a3a7ebb
parent12a055f4e0cfbda9942c6cc1588b7ce5a8f757f7 (diff)
SCSI: hpsa: Fix problem with MSA2xxx devices
commit 9bc3711cbb67ac620bf09b4a147cbab45b2c36c0 upstream. 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> Cc: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 168e67fdf5c..58f99f44bd0 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1654,30 +1654,26 @@ static void figure_bus_target_lun(struct ctlr_info *h,
1654 1654
1655 if (is_logical_dev_addr_mode(lunaddrbytes)) { 1655 if (is_logical_dev_addr_mode(lunaddrbytes)) {
1656 /* logical device */ 1656 /* logical device */
1657 if (unlikely(is_scsi_rev_5(h))) { 1657 lunid = le32_to_cpu(*((__le32 *) lunaddrbytes));
1658 /* p1210m, logical drives lun assignments 1658 if (is_msa2xxx(h, device)) {
1659 * match SCSI REPORT LUNS data. 1659 /* msa2xxx way, put logicals on bus 1
1660 * and match target/lun numbers box
1661 * reports.
1660 */ 1662 */
1661 lunid = le32_to_cpu(*((__le32 *) lunaddrbytes)); 1663 *bus = 1;
1662 *bus = 0; 1664 *target = (lunid >> 16) & 0x3fff;
1663 *target = 0; 1665 *lun = lunid & 0x00ff;
1664 *lun = (lunid & 0x3fff) + 1;
1665 } else { 1666 } else {
1666 /* not p1210m... */ 1667 if (likely(is_scsi_rev_5(h))) {
1667 lunid = le32_to_cpu(*((__le32 *) lunaddrbytes)); 1668 /* All current smart arrays (circa 2011) */
1668 if (is_msa2xxx(h, device)) { 1669 *bus = 0;
1669 /* msa2xxx way, put logicals on bus 1 1670 *target = 0;
1670 * and match target/lun numbers box 1671 *lun = (lunid & 0x3fff) + 1;
1671 * reports.
1672 */
1673 *bus = 1;
1674 *target = (lunid >> 16) & 0x3fff;
1675 *lun = lunid & 0x00ff;
1676 } else { 1672 } else {
1677 /* Traditional smart array way. */ 1673 /* Traditional old smart array way. */
1678 *bus = 0; 1674 *bus = 0;
1679 *lun = 0;
1680 *target = lunid & 0x3fff; 1675 *target = lunid & 0x3fff;
1676 *lun = 0;
1681 } 1677 }
1682 } 1678 }
1683 } else { 1679 } else {