NVMe: Fix hot cpu notification dead lock

There is a potential dead lock if a cpu event occurs during nvme probe
since it registered with hot cpu notification. This fixes the race by
having the module register with notification outside of probe rather
than have each device register.

The actual work is done in a scheduled work queue instead of in the
notifier since assigning IO queues has the potential to block if the
driver creates additional queues.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
This commit is contained in:
Keith Busch
2014-06-11 11:51:35 -06:00
committed by Matthew Wilcox
parent bd67608a61
commit f3db22feb5
2 changed files with 26 additions and 11 deletions

View File

@@ -90,7 +90,7 @@ struct nvme_dev {
struct miscdevice miscdev;
work_func_t reset_workfn;
struct work_struct reset_work;
struct notifier_block nb;
struct work_struct cpu_work;
char name[12];
char serial[20];
char model[40];