- preempt_disable();
- if (smp_processor_id() == 0)
- iucv_declare_buffer_cpu0(&b2f0_result);
- else
- smp_call_function(iucv_declare_buffer_cpu0, &b2f0_result, 0, 1);
- preempt_enable();
- iucv_debug(1, "Address of EIB = %p", iucv_external_int_buffer);
- if (b2f0_result == 0x0deadbeef)
- b2f0_result = 0xaa;
+ b2f0_result = -ENODEV;
+ spin_lock_irqsave (&iucv_lock, flags);
+ if (iucv_cpuid == -1) {
+ /* Reserve any cpu for use by iucv. */
+ iucv_cpuid = smp_get_cpu(CPU_MASK_ALL);
+ spin_unlock_irqrestore (&iucv_lock, flags);
+ smp_call_function_on(iucv_declare_buffer_cpuid,
+ &b2f0_result, 0, 1, iucv_cpuid);
+ if (b2f0_result) {
+ smp_put_cpu(iucv_cpuid);
+ iucv_cpuid = -1;
+ }
+ iucv_debug(1, "Address of EIB = %p", iucv_external_int_buffer);
+ } else {
+ spin_unlock_irqrestore (&iucv_lock, flags);
+ b2f0_result = 0;
+ }