summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/smartpqi
diff options
context:
space:
mode:
authorKevin Barnett <kevin.barnett@microchip.com>2022-02-01 15:49:13 -0600
committerMartin K. Petersen <martin.petersen@oracle.com>2022-02-07 23:38:36 -0500
commit291c2e0071efbda9d5c360a793abee4055e81fea (patch)
tree6a23b6278eb128c98a3d3837160e75cbc015a8f8 /drivers/scsi/smartpqi
parentc66e078ad89e9f171a2474b255284d95c54c4c36 (diff)
downloadlinux-stable-291c2e0071efbda9d5c360a793abee4055e81fea.tar.gz
linux-stable-291c2e0071efbda9d5c360a793abee4055e81fea.tar.bz2
linux-stable-291c2e0071efbda9d5c360a793abee4055e81fea.zip
scsi: smartpqi: Fix lsscsi -t SAS addresses
Correct lsscsi -t output for newer controllers that support 16-byte WWID in the SAS address field. lsscsi -t was displaying all zeros for SAS addresses. When we added support to smartpqi for 16-byte WWIDs in the RPL data for newer controllers, we were copying the wrong part of the 16-byte WWID to the SAS address field. Link: https://lore.kernel.org/r/164375215363.440833.7298523719813806902.stgit@brunhilda.pdev.net Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/smartpqi')
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 3c3749fcb78c..be4e91aaaa52 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -1182,8 +1182,8 @@ static inline int pqi_report_phys_luns(struct pqi_ctrl_info *ctrl_info, void **b
for (i = 0; i < num_physicals; i++) {
memcpy(&rpl_16byte_wwid_list->lun_entries[i].lunid, &rpl_8byte_wwid_list->lun_entries[i].lunid, sizeof(rpl_8byte_wwid_list->lun_entries[i].lunid));
- memset(&rpl_16byte_wwid_list->lun_entries[i].wwid, 0, 8);
- memcpy(&rpl_16byte_wwid_list->lun_entries[i].wwid[8], &rpl_8byte_wwid_list->lun_entries[i].wwid, sizeof(rpl_8byte_wwid_list->lun_entries[i].wwid));
+ memcpy(&rpl_16byte_wwid_list->lun_entries[i].wwid[0], &rpl_8byte_wwid_list->lun_entries[i].wwid, sizeof(rpl_8byte_wwid_list->lun_entries[i].wwid));
+ memset(&rpl_16byte_wwid_list->lun_entries[i].wwid[8], 0, 8);
rpl_16byte_wwid_list->lun_entries[i].device_type = rpl_8byte_wwid_list->lun_entries[i].device_type;
rpl_16byte_wwid_list->lun_entries[i].device_flags = rpl_8byte_wwid_list->lun_entries[i].device_flags;
rpl_16byte_wwid_list->lun_entries[i].lun_count = rpl_8byte_wwid_list->lun_entries[i].lun_count;
@@ -2472,7 +2472,7 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info)
sizeof(device->volume_id));
}
- device->sas_address = get_unaligned_be64(&device->wwid[8]);
+ device->sas_address = get_unaligned_be64(&device->wwid[0]);
new_device_list[num_valid_devices++] = device;
}