* [bug report] scsi: smartpqi: Update device removal management
@ 2021-12-10 14:18 Dan Carpenter
[not found] ` <SN6PR11MB28480A37EF56FEABD76481CAE1719@SN6PR11MB2848.namprd11.prod.outlook.com>
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-12-10 14:18 UTC (permalink / raw)
To: don.brace; +Cc: linux-scsi
Hello Don Brace,
The patch 819225b03dc7: "scsi: smartpqi: Update device removal
management" from Sep 28, 2021, leads to the following Smatch static
checker warning:
drivers/scsi/scsi_sysfs.c:1463 __scsi_remove_device()
warn: sleeping in atomic context
drivers/scsi/smartpqi/smartpqi_init.c
2510 static void pqi_remove_all_scsi_devices(struct pqi_ctrl_info *ctrl_info)
2511 {
2512 unsigned long flags;
2513 struct pqi_scsi_dev *device;
2514 struct pqi_scsi_dev *next;
2515
2516 spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags);
^^^^^^^^^^^^^^^^^^
Takes a spinlock
2517
2518 list_for_each_entry_safe(device, next, &ctrl_info->scsi_device_list,
2519 scsi_device_list_entry) {
2520 if (pqi_is_device_added(device))
2521 pqi_remove_device(ctrl_info, device);
^^^^^^^^^^^^^^^^^^
This calls scsi_remove_device() which takes a mutex so it can sleep.
2522 list_del(&device->scsi_device_list_entry);
2523 pqi_free_device(device);
2524 }
2525
2526 spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
2527 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread[parent not found: <SN6PR11MB28480A37EF56FEABD76481CAE1719@SN6PR11MB2848.namprd11.prod.outlook.com>]
* Re: [bug report] scsi: smartpqi: Update device removal management [not found] ` <SN6PR11MB28480A37EF56FEABD76481CAE1719@SN6PR11MB2848.namprd11.prod.outlook.com> @ 2022-01-19 11:02 ` Dan Carpenter 0 siblings, 0 replies; 2+ messages in thread From: Dan Carpenter @ 2022-01-19 11:02 UTC (permalink / raw) To: Don.Brace; +Cc: linux-scsi Whatever happened with this? regards, dan carpenter On Fri, Dec 10, 2021 at 03:09:37PM +0000, Don.Brace@microchip.com wrote: > > > ________________________________ > From: Dan Carpenter <dan.carpenter@oracle.com> > > > > Hello Don Brace, > > The patch 819225b03dc7: "scsi: smartpqi: Update device removal > management" from Sep 28, 2021, leads to the following Smatch static > checker warning: > > drivers/scsi/scsi_sysfs.c:1463 __scsi_remove_device() > warn: sleeping in atomic context > ---- > Dan, > Thanks for checking this. > I have a patch to correct this. I'll be sending it up soon. > > I am waiting for 1 more internal review. > > Don Brace > > > drivers/scsi/smartpqi/smartpqi_init.c > 2510 static void pqi_remove_all_scsi_devices(struct pqi_ctrl_info *ctrl_info) > 2511 { > 2512 unsigned long flags; > 2513 struct pqi_scsi_dev *device; > 2514 struct pqi_scsi_dev *next; > 2515 > 2516 spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags); > ^^^^^^^^^^^^^^^^^^ > Takes a spinlock > > 2517 > 2518 list_for_each_entry_safe(device, next, &ctrl_info->scsi_device_list, > 2519 scsi_device_list_entry) { > 2520 if (pqi_is_device_added(device)) > 2521 pqi_remove_device(ctrl_info, device); > ^^^^^^^^^^^^^^^^^^ > This calls scsi_remove_device() which takes a mutex so it can sleep. > > 2522 list_del(&device->scsi_device_list_entry); > 2523 pqi_free_device(device); > 2524 } > 2525 > 2526 spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); > 2527 } > > regards, > dan carpenter ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-19 11:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-10 14:18 [bug report] scsi: smartpqi: Update device removal management Dan Carpenter
[not found] ` <SN6PR11MB28480A37EF56FEABD76481CAE1719@SN6PR11MB2848.namprd11.prod.outlook.com>
2022-01-19 11:02 ` Dan Carpenter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).