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

Configure Feed

Select the types of activity you want to include in your feed.

scsi: smartpqi: Expose SAS address for SATA drives

Remove UNIQUE_WWID_IN_REPORT_PHYS_LUN PQI feature.

This feature was originally added to solve a problem with NVMe drives, but
this problem has since been solved a different way, so this PQI feature is
no longer required for any type of drive.

The kernel was not creating symbolic links in sysfs between SATA drives and
their enclosure.

The driver was enabling the UNIQUE_WWID_IN_REPORT_PHYS_LUN PQI feature,
which causes the FW to return a WWID for SATA drives that is derived from a
unique ID read from the SATA drive itself. The driver was exposing this
WWID as the drive's SAS address. However, because this SAS address does not
match the SAS address returned by an enclosure's SES Page 0xA data, the
Linux kernel was not able to match a SATA drive with its enclosure.

Link: https://lore.kernel.org/r/164375213346.440833.12379222470149882747.stgit@brunhilda.pdev.net
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@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>

authored by

Kevin Barnett and committed by
Martin K. Petersen
00598b05 5d8fbce0

+3 -42
-2
drivers/scsi/smartpqi/smartpqi.h
··· 1141 1141 struct pqi_stream_data stream_data[NUM_STREAMS_PER_LUN]; 1142 1142 atomic_t scsi_cmds_outstanding; 1143 1143 atomic_t raid_bypass_cnt; 1144 - u8 page_83_identifier[16]; 1145 1144 }; 1146 1145 1147 1146 /* VPD inquiry pages */ ··· 1330 1331 u8 soft_reset_handshake_supported : 1; 1331 1332 u8 raid_iu_timeout_supported : 1; 1332 1333 u8 tmf_iu_timeout_supported : 1; 1333 - u8 unique_wwid_in_report_phys_lun_supported : 1; 1334 1334 u8 firmware_triage_supported : 1; 1335 1335 u8 rpl_extended_format_4_5_supported : 1; 1336 1336 u8 enable_r1_writes : 1;
+3 -40
drivers/scsi/smartpqi/smartpqi_init.c
··· 1588 1588 sizeof(device->phys_connector)); 1589 1589 device->bay = id_phys->phys_bay_in_box; 1590 1590 1591 - memcpy(&device->page_83_identifier, &id_phys->page_83_identifier, 1592 - sizeof(device->page_83_identifier)); 1593 - 1594 1591 if ((id_phys->even_more_flags & PQI_DEVICE_PHY_MAP_SUPPORTED) && 1595 1592 id_phys->phy_count) 1596 1593 device->phy_id = ··· 2278 2281 scsi3addr[3] |= 0xc0; 2279 2282 } 2280 2283 2281 - static inline bool pqi_is_device_with_sas_address(struct pqi_scsi_dev *device) 2282 - { 2283 - switch (device->device_type) { 2284 - case SA_DEVICE_TYPE_SAS: 2285 - case SA_DEVICE_TYPE_EXPANDER_SMP: 2286 - case SA_DEVICE_TYPE_SES: 2287 - return true; 2288 - } 2289 - 2290 - return false; 2291 - } 2292 - 2293 2284 static inline bool pqi_is_multipath_device(struct pqi_scsi_dev *device) 2294 2285 { 2295 2286 if (pqi_is_logical_device(device)) ··· 2289 2304 static inline bool pqi_expose_device(struct pqi_scsi_dev *device) 2290 2305 { 2291 2306 return !device->is_physical_device || !pqi_skip_device(device->scsi3addr); 2292 - } 2293 - 2294 - static inline void pqi_set_physical_device_wwid(struct pqi_ctrl_info *ctrl_info, 2295 - struct pqi_scsi_dev *device, struct report_phys_lun_16byte_wwid *phys_lun) 2296 - { 2297 - if (ctrl_info->unique_wwid_in_report_phys_lun_supported || 2298 - ctrl_info->rpl_extended_format_4_5_supported || 2299 - pqi_is_device_with_sas_address(device)) 2300 - memcpy(device->wwid, phys_lun->wwid, sizeof(device->wwid)); 2301 - else 2302 - memcpy(&device->wwid[8], device->page_83_identifier, 8); 2303 2307 } 2304 2308 2305 2309 static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) ··· 2458 2484 pqi_assign_bus_target_lun(device); 2459 2485 2460 2486 if (device->is_physical_device) { 2461 - pqi_set_physical_device_wwid(ctrl_info, device, phys_lun); 2487 + memcpy(device->wwid, phys_lun->wwid, sizeof(device->wwid)); 2462 2488 if ((phys_lun->device_flags & 2463 2489 CISS_REPORT_PHYS_DEV_FLAG_AIO_ENABLED) && 2464 2490 phys_lun->aio_handle) { ··· 2471 2497 sizeof(device->volume_id)); 2472 2498 } 2473 2499 2474 - if (pqi_is_device_with_sas_address(device)) 2475 - device->sas_address = get_unaligned_be64(&device->wwid[8]); 2500 + device->sas_address = get_unaligned_be64(&device->wwid[8]); 2476 2501 2477 2502 new_device_list[num_valid_devices++] = device; 2478 2503 } ··· 7060 7087 spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags); 7061 7088 7062 7089 device = sdev->hostdata; 7063 - if (!device || !pqi_is_device_with_sas_address(device)) { 7090 + if (!device) { 7064 7091 spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); 7065 7092 return -ENODEV; 7066 7093 } ··· 7616 7643 case PQI_FIRMWARE_FEATURE_TMF_IU_TIMEOUT: 7617 7644 ctrl_info->tmf_iu_timeout_supported = firmware_feature->enabled; 7618 7645 break; 7619 - case PQI_FIRMWARE_FEATURE_UNIQUE_WWID_IN_REPORT_PHYS_LUN: 7620 - ctrl_info->unique_wwid_in_report_phys_lun_supported = 7621 - firmware_feature->enabled; 7622 - break; 7623 7646 case PQI_FIRMWARE_FEATURE_FW_TRIAGE: 7624 7647 ctrl_info->firmware_triage_supported = firmware_feature->enabled; 7625 7648 pqi_save_fw_triage_setting(ctrl_info, firmware_feature->enabled); ··· 7712 7743 .feature_name = "RAID Bypass on encrypted logical volumes on NVMe", 7713 7744 .feature_bit = PQI_FIRMWARE_FEATURE_RAID_BYPASS_ON_ENCRYPTED_NVME, 7714 7745 .feature_status = pqi_firmware_feature_status, 7715 - }, 7716 - { 7717 - .feature_name = "Unique WWID in Report Physical LUN", 7718 - .feature_bit = PQI_FIRMWARE_FEATURE_UNIQUE_WWID_IN_REPORT_PHYS_LUN, 7719 - .feature_status = pqi_ctrl_update_feature_flags, 7720 7746 }, 7721 7747 { 7722 7748 .feature_name = "Firmware Triage", ··· 7822 7858 ctrl_info->enable_r6_writes = false; 7823 7859 ctrl_info->raid_iu_timeout_supported = false; 7824 7860 ctrl_info->tmf_iu_timeout_supported = false; 7825 - ctrl_info->unique_wwid_in_report_phys_lun_supported = false; 7826 7861 ctrl_info->firmware_triage_supported = false; 7827 7862 ctrl_info->rpl_extended_format_4_5_supported = false; 7828 7863 }