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

scsi: hpsa: update discovery polling

Correct a corner case where newly created volumes are not detected
automatically on an external RAID controller that has no configured
volumes during initial device discovery.

The fix is to set the discovery_polling flag when an external RAID
controller is detected. This causes a device rescan every 20-30 seconds,
so that newly created volumes will be detected automatically.

Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
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

Bader Ali Saleh and committed by
Martin K. Petersen
4e188184 b9b08cad

+28 -13
+26 -13
drivers/scsi/hpsa.c
··· 3472 3472 dev->sas_address = sa; 3473 3473 } 3474 3474 3475 + static void hpsa_ext_ctrl_present(struct ctlr_info *h, 3476 + struct ReportExtendedLUNdata *physdev) 3477 + { 3478 + u32 nphysicals; 3479 + int i; 3480 + 3481 + if (h->discovery_polling) 3482 + return; 3483 + 3484 + nphysicals = (get_unaligned_be32(physdev->LUNListLength) / 24) + 1; 3485 + 3486 + for (i = 0; i < nphysicals; i++) { 3487 + if (physdev->LUN[i].device_type == 3488 + BMIC_DEVICE_TYPE_CONTROLLER 3489 + && !is_hba_lunid(physdev->LUN[i].lunid)) { 3490 + dev_info(&h->pdev->dev, 3491 + "External controller present, activate discovery polling and disable rld caching\n"); 3492 + hpsa_disable_rld_caching(h); 3493 + h->discovery_polling = 1; 3494 + break; 3495 + } 3496 + } 3497 + } 3498 + 3475 3499 /* Get a device id from inquiry page 0x83 */ 3476 3500 static bool hpsa_vpd_page_supported(struct ctlr_info *h, 3477 3501 unsigned char scsi3addr[], u8 page) ··· 4252 4228 */ 4253 4229 ndevs_to_allocate = nphysicals + nlogicals + MAX_EXT_TARGETS + 1; 4254 4230 4231 + hpsa_ext_ctrl_present(h, physdev_list); 4232 + 4255 4233 /* Allocate the per device structures */ 4256 4234 for (i = 0; i < ndevs_to_allocate; i++) { 4257 4235 if (i >= HPSA_MAX_DEVICES) { ··· 4323 4297 4324 4298 figure_bus_target_lun(h, lunaddrbytes, tmpdevice); 4325 4299 this_device = currentsd[ncurrent]; 4326 - 4327 - /* Turn on discovery_polling if there are ext target devices. 4328 - * Event-based change notification is unreliable for those. 4329 - */ 4330 - if (!h->discovery_polling) { 4331 - if (tmpdevice->external) { 4332 - h->discovery_polling = 1; 4333 - dev_info(&h->pdev->dev, 4334 - "External target, activate discovery polling.\n"); 4335 - } 4336 - } 4337 - 4338 4300 4339 4301 *this_device = *tmpdevice; 4340 4302 this_device->physical_device = physical_device; ··· 8261 8247 if (h->drv_req_rescan || hpsa_offline_devices_ready(h)) { 8262 8248 hpsa_perform_rescan(h); 8263 8249 } else if (h->discovery_polling) { 8264 - hpsa_disable_rld_caching(h); 8265 8250 if (hpsa_luns_changed(h)) { 8266 8251 dev_info(&h->pdev->dev, 8267 8252 "driver discovery polling rescan.\n");
+2
drivers/scsi/hpsa_cmd.h
··· 780 780 u8 phys_bay_in_box; /* phys drv bay this drive resides */ 781 781 __le32 rpm; /* Drive rotational speed in rpm */ 782 782 u8 device_type; /* type of drive */ 783 + #define BMIC_DEVICE_TYPE_CONTROLLER 0x07 784 + 783 785 u8 sata_version; /* only valid when drive_type is SATA */ 784 786 __le64 big_total_block_count; 785 787 __le64 ris_starting_lba;