Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: hpsa: correct enclosure sas address

The original complaint was the lsscsi -t showed the same SAS address of the
two enclosures (SEP devices). In fact the SAS address was being set to the
Enclosure Logical Identifier (ELI).

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Don Brace and committed by
Martin K. Petersen
01d0e789 f13cff6c

+22 -4
+21 -4
drivers/scsi/hpsa.c
··· 3440 3440 struct ext_report_lun_entry *rle = &rlep->LUN[rle_index]; 3441 3441 u16 bmic_device_index = 0; 3442 3442 3443 - bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]); 3444 - 3445 - encl_dev->sas_address = 3443 + encl_dev->eli = 3446 3444 hpsa_get_enclosure_logical_identifier(h, scsi3addr); 3445 + 3446 + bmic_device_index = GET_BMIC_DRIVE_NUMBER(&rle->lunid[0]); 3447 3447 3448 3448 if (encl_dev->target == -1 || encl_dev->lun == -1) { 3449 3449 rc = IO_OK; ··· 9697 9697 static int 9698 9698 hpsa_sas_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) 9699 9699 { 9700 - *identifier = rphy->identify.sas_address; 9700 + struct Scsi_Host *shost = phy_to_shost(rphy); 9701 + struct ctlr_info *h; 9702 + struct hpsa_scsi_dev_t *sd; 9703 + 9704 + if (!shost) 9705 + return -ENXIO; 9706 + 9707 + h = shost_to_hba(shost); 9708 + 9709 + if (!h) 9710 + return -ENXIO; 9711 + 9712 + sd = hpsa_find_device_by_sas_rphy(h, rphy); 9713 + if (!sd) 9714 + return -ENXIO; 9715 + 9716 + *identifier = sd->eli; 9717 + 9701 9718 return 0; 9702 9719 } 9703 9720
+1
drivers/scsi/hpsa.h
··· 68 68 #define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0" 69 69 unsigned char device_id[16]; /* from inquiry pg. 0x83 */ 70 70 u64 sas_address; 71 + u64 eli; /* from report diags. */ 71 72 unsigned char vendor[8]; /* bytes 8-15 of inquiry data */ 72 73 unsigned char model[16]; /* bytes 16-31 of inquiry data */ 73 74 unsigned char rev; /* byte 2 of inquiry data */