scsi: smartpqi: Fix rmmod stack trace
Prevent "BUG: scheduling while atomic: rmmod" stack trace. Stop setting spin_locks before calling OS functions to remove devices. Link: https://lore.kernel.org/r/164375207296.440833.4996145011193819683.stgit@brunhilda.pdev.net Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Reviewed-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>
This commit is contained in:
parent
d20b3dae63
commit
c4ff687d25
|
@ -2513,17 +2513,15 @@ static void pqi_remove_all_scsi_devices(struct pqi_ctrl_info *ctrl_info)
|
|||
struct pqi_scsi_dev *device;
|
||||
struct pqi_scsi_dev *next;
|
||||
|
||||
spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags);
|
||||
|
||||
list_for_each_entry_safe(device, next, &ctrl_info->scsi_device_list,
|
||||
scsi_device_list_entry) {
|
||||
if (pqi_is_device_added(device))
|
||||
pqi_remove_device(ctrl_info, device);
|
||||
spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags);
|
||||
list_del(&device->scsi_device_list_entry);
|
||||
pqi_free_device(device);
|
||||
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
|
||||
}
|
||||
|
||||
static int pqi_scan_scsi_devices(struct pqi_ctrl_info *ctrl_info)
|
||||
|
|
Loading…
Reference in New Issue