Commit 8c39ed48 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by David S. Miller

net/iucv: Replace deprecated CPU-hotplug functions.

The functions get_online_cpus() and put_online_cpus() have been
deprecated during the CPU hotplug rework. They map directly to
cpus_read_lock() and cpus_read_unlock().

Replace deprecated CPU-hotplug functions with the official version.
The behavior remains unchanged.

Cc: Julian Wiedmann <jwi@linux.ibm.com>
Cc: Karsten Graul <kgraul@linux.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: linux-s390@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 50348fac
...@@ -502,14 +502,14 @@ static void iucv_setmask_mp(void) ...@@ -502,14 +502,14 @@ static void iucv_setmask_mp(void)
{ {
int cpu; int cpu;
get_online_cpus(); cpus_read_lock();
for_each_online_cpu(cpu) for_each_online_cpu(cpu)
/* Enable all cpus with a declared buffer. */ /* Enable all cpus with a declared buffer. */
if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask) && if (cpumask_test_cpu(cpu, &iucv_buffer_cpumask) &&
!cpumask_test_cpu(cpu, &iucv_irq_cpumask)) !cpumask_test_cpu(cpu, &iucv_irq_cpumask))
smp_call_function_single(cpu, iucv_allow_cpu, smp_call_function_single(cpu, iucv_allow_cpu,
NULL, 1); NULL, 1);
put_online_cpus(); cpus_read_unlock();
} }
/** /**
...@@ -542,7 +542,7 @@ static int iucv_enable(void) ...@@ -542,7 +542,7 @@ static int iucv_enable(void)
size_t alloc_size; size_t alloc_size;
int cpu, rc; int cpu, rc;
get_online_cpus(); cpus_read_lock();
rc = -ENOMEM; rc = -ENOMEM;
alloc_size = iucv_max_pathid * sizeof(struct iucv_path); alloc_size = iucv_max_pathid * sizeof(struct iucv_path);
iucv_path_table = kzalloc(alloc_size, GFP_KERNEL); iucv_path_table = kzalloc(alloc_size, GFP_KERNEL);
...@@ -555,12 +555,12 @@ static int iucv_enable(void) ...@@ -555,12 +555,12 @@ static int iucv_enable(void)
if (cpumask_empty(&iucv_buffer_cpumask)) if (cpumask_empty(&iucv_buffer_cpumask))
/* No cpu could declare an iucv buffer. */ /* No cpu could declare an iucv buffer. */
goto out; goto out;
put_online_cpus(); cpus_read_unlock();
return 0; return 0;
out: out:
kfree(iucv_path_table); kfree(iucv_path_table);
iucv_path_table = NULL; iucv_path_table = NULL;
put_online_cpus(); cpus_read_unlock();
return rc; return rc;
} }
...@@ -573,11 +573,11 @@ static int iucv_enable(void) ...@@ -573,11 +573,11 @@ static int iucv_enable(void)
*/ */
static void iucv_disable(void) static void iucv_disable(void)
{ {
get_online_cpus(); cpus_read_lock();
on_each_cpu(iucv_retrieve_cpu, NULL, 1); on_each_cpu(iucv_retrieve_cpu, NULL, 1);
kfree(iucv_path_table); kfree(iucv_path_table);
iucv_path_table = NULL; iucv_path_table = NULL;
put_online_cpus(); cpus_read_unlock();
} }
static int iucv_cpu_dead(unsigned int cpu) static int iucv_cpu_dead(unsigned int cpu)
...@@ -786,7 +786,7 @@ static int iucv_reboot_event(struct notifier_block *this, ...@@ -786,7 +786,7 @@ static int iucv_reboot_event(struct notifier_block *this,
if (cpumask_empty(&iucv_irq_cpumask)) if (cpumask_empty(&iucv_irq_cpumask))
return NOTIFY_DONE; return NOTIFY_DONE;
get_online_cpus(); cpus_read_lock();
on_each_cpu_mask(&iucv_irq_cpumask, iucv_block_cpu, NULL, 1); on_each_cpu_mask(&iucv_irq_cpumask, iucv_block_cpu, NULL, 1);
preempt_disable(); preempt_disable();
for (i = 0; i < iucv_max_pathid; i++) { for (i = 0; i < iucv_max_pathid; i++) {
...@@ -794,7 +794,7 @@ static int iucv_reboot_event(struct notifier_block *this, ...@@ -794,7 +794,7 @@ static int iucv_reboot_event(struct notifier_block *this,
iucv_sever_pathid(i, NULL); iucv_sever_pathid(i, NULL);
} }
preempt_enable(); preempt_enable();
put_online_cpus(); cpus_read_unlock();
iucv_disable(); iucv_disable();
return NOTIFY_DONE; return NOTIFY_DONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment