linux-stable/drivers/scsi/bnx2i
Srivatsa S. Bhat bc0003c93f scsi, bnx2i: Fix CPU hotplug callback registration
Subsystems that want to register CPU hotplug callbacks, as well as perform
initialization for the CPUs that are already online, often do it as shown
below:

	get_online_cpus();

	for_each_online_cpu(cpu)
		init_cpu(cpu);

	register_cpu_notifier(&foobar_cpu_notifier);

	put_online_cpus();

This is wrong, since it is prone to ABBA deadlocks involving the
cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
with CPU hotplug operations).

Instead, the correct and race-free way of performing the callback
registration is:

	cpu_notifier_register_begin();

	for_each_online_cpu(cpu)
		init_cpu(cpu);

	/* Note the use of the double underscored version of the API */
	__register_cpu_notifier(&foobar_cpu_notifier);

	cpu_notifier_register_done();

Fix the bnx2i code in scsi by using this latter form of callback registration.

Cc: Eddie Wai <eddie.wai@broadcom.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-03-20 13:43:44 +01:00
..
57xx_iscsi_constants.h [SCSI] bnx2i: Update version and copyright year 2013 2013-08-23 13:04:29 -04:00
57xx_iscsi_hsi.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-09-05 14:54:29 -07:00
bnx2i.h bnx2x, cnic, bnx2i, bnx2fc: Fix bnx2i and bnx2fc regressions. 2013-09-18 12:24:32 -04:00
bnx2i_hwi.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
bnx2i_init.c scsi, bnx2i: Fix CPU hotplug callback registration 2014-03-20 13:43:44 +01:00
bnx2i_iscsi.c treewide: Fix common typo in "identify" 2013-10-14 15:31:06 +02:00
bnx2i_sysfs.c [SCSI] bnx2i: Update version and copyright year 2013 2013-08-23 13:04:29 -04:00
Kconfig cnic: Fix select dependencies in bnx2fc/bnx2i Kconfig. 2011-08-12 03:00:47 -07:00
Makefile