aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 17:55:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 17:55:46 -0400
commit467a9e1633043810259a7f5368fbcc1e84746137 (patch)
treec8a5bfd2a65455d7f6a59b312e348e069375bd9b /drivers/scsi
parentb8780c363d808a726a34793caa900923d32b6b80 (diff)
parenta0e247a8059223593f9c5c3d5c1fd50eedf415c0 (diff)
Merge tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull CPU hotplug notifiers registration fixes from Rafael Wysocki: "The purpose of this single series of commits from Srivatsa S Bhat (with a small piece from Gautham R Shenoy) touching multiple subsystems that use CPU hotplug notifiers is to provide a way to register them that will not lead to deadlocks with CPU online/offline operations as described in the changelog of commit 93ae4f978ca7f ("CPU hotplug: Provide lockless versions of callback registration functions"). The first three commits in the series introduce the API and document it and the rest simply goes through the users of CPU hotplug notifiers and converts them to using the new method" * tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits) net/iucv/iucv.c: Fix CPU hotplug callback registration net/core/flow.c: Fix CPU hotplug callback registration mm, zswap: Fix CPU hotplug callback registration mm, vmstat: Fix CPU hotplug callback registration profile: Fix CPU hotplug callback registration trace, ring-buffer: Fix CPU hotplug callback registration xen, balloon: Fix CPU hotplug callback registration hwmon, via-cputemp: Fix CPU hotplug callback registration hwmon, coretemp: Fix CPU hotplug callback registration thermal, x86-pkg-temp: Fix CPU hotplug callback registration octeon, watchdog: Fix CPU hotplug callback registration oprofile, nmi-timer: Fix CPU hotplug callback registration intel-idle: Fix CPU hotplug callback registration clocksource, dummy-timer: Fix CPU hotplug callback registration drivers/base/topology.c: Fix CPU hotplug callback registration acpi-cpufreq: Fix CPU hotplug callback registration zsmalloc: Fix CPU hotplug callback registration scsi, fcoe: Fix CPU hotplug callback registration scsi, bnx2fc: Fix CPU hotplug callback registration scsi, bnx2i: Fix CPU hotplug callback registration ...
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c12
-rw-r--r--drivers/scsi/bnx2i/bnx2i_init.c12
-rw-r--r--drivers/scsi/fcoe/fcoe.c15
3 files changed, 33 insertions, 6 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 6287f6a8b79d..1d41f4b9114f 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2592,12 +2592,16 @@ static int __init bnx2fc_mod_init(void)
2592 spin_lock_init(&p->fp_work_lock); 2592 spin_lock_init(&p->fp_work_lock);
2593 } 2593 }
2594 2594
2595 cpu_notifier_register_begin();
2596
2595 for_each_online_cpu(cpu) { 2597 for_each_online_cpu(cpu) {
2596 bnx2fc_percpu_thread_create(cpu); 2598 bnx2fc_percpu_thread_create(cpu);
2597 } 2599 }
2598 2600
2599 /* Initialize per CPU interrupt thread */ 2601 /* Initialize per CPU interrupt thread */
2600 register_hotcpu_notifier(&bnx2fc_cpu_notifier); 2602 __register_hotcpu_notifier(&bnx2fc_cpu_notifier);
2603
2604 cpu_notifier_register_done();
2601 2605
2602 cnic_register_driver(CNIC_ULP_FCOE, &bnx2fc_cnic_cb); 2606 cnic_register_driver(CNIC_ULP_FCOE, &bnx2fc_cnic_cb);
2603 2607
@@ -2662,13 +2666,17 @@ static void __exit bnx2fc_mod_exit(void)
2662 if (l2_thread) 2666 if (l2_thread)
2663 kthread_stop(l2_thread); 2667 kthread_stop(l2_thread);
2664 2668
2665 unregister_hotcpu_notifier(&bnx2fc_cpu_notifier); 2669 cpu_notifier_register_begin();
2666 2670
2667 /* Destroy per cpu threads */ 2671 /* Destroy per cpu threads */
2668 for_each_online_cpu(cpu) { 2672 for_each_online_cpu(cpu) {
2669 bnx2fc_percpu_thread_destroy(cpu); 2673 bnx2fc_percpu_thread_destroy(cpu);
2670 } 2674 }
2671 2675
2676 __unregister_hotcpu_notifier(&bnx2fc_cpu_notifier);
2677
2678 cpu_notifier_register_done();
2679
2672 destroy_workqueue(bnx2fc_wq); 2680 destroy_workqueue(bnx2fc_wq);
2673 /* 2681 /*
2674 * detach from scsi transport 2682 * detach from scsi transport
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c
index 34c294b42c84..80c03b452d61 100644
--- a/drivers/scsi/bnx2i/bnx2i_init.c
+++ b/drivers/scsi/bnx2i/bnx2i_init.c
@@ -537,11 +537,15 @@ static int __init bnx2i_mod_init(void)
537 p->iothread = NULL; 537 p->iothread = NULL;
538 } 538 }
539 539
540 cpu_notifier_register_begin();
541
540 for_each_online_cpu(cpu) 542 for_each_online_cpu(cpu)
541 bnx2i_percpu_thread_create(cpu); 543 bnx2i_percpu_thread_create(cpu);
542 544
543 /* Initialize per CPU interrupt thread */ 545 /* Initialize per CPU interrupt thread */
544 register_hotcpu_notifier(&bnx2i_cpu_notifier); 546 __register_hotcpu_notifier(&bnx2i_cpu_notifier);
547
548 cpu_notifier_register_done();
545 549
546 return 0; 550 return 0;
547 551
@@ -581,11 +585,15 @@ static void __exit bnx2i_mod_exit(void)
581 } 585 }
582 mutex_unlock(&bnx2i_dev_lock); 586 mutex_unlock(&bnx2i_dev_lock);
583 587
584 unregister_hotcpu_notifier(&bnx2i_cpu_notifier); 588 cpu_notifier_register_begin();
585 589
586 for_each_online_cpu(cpu) 590 for_each_online_cpu(cpu)
587 bnx2i_percpu_thread_destroy(cpu); 591 bnx2i_percpu_thread_destroy(cpu);
588 592
593 __unregister_hotcpu_notifier(&bnx2i_cpu_notifier);
594
595 cpu_notifier_register_done();
596
589 iscsi_unregister_transport(&bnx2i_iscsi_transport); 597 iscsi_unregister_transport(&bnx2i_iscsi_transport);
590 cnic_unregister_driver(CNIC_ULP_ISCSI); 598 cnic_unregister_driver(CNIC_ULP_ISCSI);
591} 599}
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index f3170008ae71..d5e105b173f0 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -2633,14 +2633,18 @@ static int __init fcoe_init(void)
2633 skb_queue_head_init(&p->fcoe_rx_list); 2633 skb_queue_head_init(&p->fcoe_rx_list);
2634 } 2634 }
2635 2635
2636 cpu_notifier_register_begin();
2637
2636 for_each_online_cpu(cpu) 2638 for_each_online_cpu(cpu)
2637 fcoe_percpu_thread_create(cpu); 2639 fcoe_percpu_thread_create(cpu);
2638 2640
2639 /* Initialize per CPU interrupt thread */ 2641 /* Initialize per CPU interrupt thread */
2640 rc = register_hotcpu_notifier(&fcoe_cpu_notifier); 2642 rc = __register_hotcpu_notifier(&fcoe_cpu_notifier);
2641 if (rc) 2643 if (rc)
2642 goto out_free; 2644 goto out_free;
2643 2645
2646 cpu_notifier_register_done();
2647
2644 /* Setup link change notification */ 2648 /* Setup link change notification */
2645 fcoe_dev_setup(); 2649 fcoe_dev_setup();
2646 2650
@@ -2655,6 +2659,9 @@ out_free:
2655 for_each_online_cpu(cpu) { 2659 for_each_online_cpu(cpu) {
2656 fcoe_percpu_thread_destroy(cpu); 2660 fcoe_percpu_thread_destroy(cpu);
2657 } 2661 }
2662
2663 cpu_notifier_register_done();
2664
2658 mutex_unlock(&fcoe_config_mutex); 2665 mutex_unlock(&fcoe_config_mutex);
2659 destroy_workqueue(fcoe_wq); 2666 destroy_workqueue(fcoe_wq);
2660 return rc; 2667 return rc;
@@ -2687,11 +2694,15 @@ static void __exit fcoe_exit(void)
2687 } 2694 }
2688 rtnl_unlock(); 2695 rtnl_unlock();
2689 2696
2690 unregister_hotcpu_notifier(&fcoe_cpu_notifier); 2697 cpu_notifier_register_begin();
2691 2698
2692 for_each_online_cpu(cpu) 2699 for_each_online_cpu(cpu)
2693 fcoe_percpu_thread_destroy(cpu); 2700 fcoe_percpu_thread_destroy(cpu);
2694 2701
2702 __unregister_hotcpu_notifier(&fcoe_cpu_notifier);
2703
2704 cpu_notifier_register_done();
2705
2695 mutex_unlock(&fcoe_config_mutex); 2706 mutex_unlock(&fcoe_config_mutex);
2696 2707
2697 /* 2708 /*