Skip to contentSkip to conversation

powerpc: Export __spin_yield

PATCH In review Suresh E. Warrier 4 participants 4 messages Feb 25, 2015 – Mar 30, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Export __spin_yield

Export __spin_yield so that the arch_spin_unlock() function can be invoked from a module. This will be required for modules where we want to take a lock that is also is acquired in hypervisor real mode. Because we want to avoid running any lockdep code (which may not be safe in real mode), this lock needs to be an arch_spinlock_t instead of a normal spinlock.

---
Replaced export to EXPORT_SYMBOL_GPL
Updated commit log to explain what kind of modules will need to use the arch_spin_unlock() function

 arch/powerpc/lib/locks.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/lib/locks.c +1 -0
index bb7cfec..f31bcee 100644
@@ -41,6 +41,7 @@ void __spin_yield(arch_spinlock_t *lock)
 	plpar_hcall_norets(H_CONFER,
 		get_hard_smp_processor_id(holder_cpu), yield_count);
 }
+EXPORT_SYMBOL_GPL(__spin_yield);
 
 /*
  * Waiting for a read lock or a write lock on a rwlock...
Signature · 1 line
1.8.3.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Suresh E. Warrier

Export __spin_yield so that the arch_spin_unlock() function can be invoked from a module. This will be required for modules where we want to take a lock that is also is acquired in hypervisor real mode. Because we want to avoid running any lockdep code (which may not be safe in real mode), this lock needs to be an arch_spinlock_t instead of a normal spinlock.

Acked-by Paul Mackerras
#2 lore raw

Hi Ben,

Quoted 11 lines · Paul Mackerras
Quoted 8 lines · Suresh E. Warrier

Export __spin_yield so that the arch_spin_unlock() function can be invoked from a module. This will be required for modules where we want to take a lock that is also is acquired in hypervisor real mode. Because we want to avoid running any lockdep code (which may not be safe in real mode), this lock needs to be an arch_spinlock_t instead of a normal spinlock.

Something went wrong when applying this, as it ended up as:

commit 1f8c82ab1b0bc7e24601c0fca411fd27b9c883ef

Author: Geert Uytterhoeven <[email protected]>
Date:   Wed Mar 4 12:56:20 2015 +0100

cpufreq/ppc: Add missing #include <asm/smp.h>

If CONFIG_SMP=n, <linux/smp.h> does not include <asm/smp.h>, causing:

drivers/cpufreq/ppc-corenet-cpufreq.c: In function 'corenet_cpufreq_cpu_init drivers/cpufreq/ppc-corenet-cpufreq.c:173:3: error: implicit declaration of
X-Patchwork-Id: 443703
Message-Id: <[email protected]>
To: [email protected]
Date: Wed, 25 Feb 2015 17:23:53 -0600

Export __spin_yield so that the arch_spin_unlock() function can be invoked from a module. This will be required for modules where we want to take a lock that is also is acquired in hypervisor real mode. Because we want to avoid running any lockdep code (which may not be safe in real mode), this lock needs to be an arch_spinlock_t instead of a normal spinlock.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw
Quoted 11 lines · Geert Uytterhoeven

Hi Ben,

Quoted 8 lines · Paul Mackerras
Quoted 7 lines · Suresh E. Warrier

Export __spin_yield so that the arch_spin_unlock() function can be invoked from a module. This will be required for modules where we want to take a lock that is also is acquired in hypervisor real mode. Because we want to avoid running any lockdep code (which may not be safe in real mode), this lock needs to be an arch_spinlock_t instead of a normal spinlock.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Something went wrong when applying this, as it ended up as:

Ugh, weird. I must have fucked up something when rebasing. I don't want to rebase that branch now that it's out, I know of at least one series based on it. We'll live with it.

Quoted 36 lines

commit 1f8c82ab1b0bc7e24601c0fca411fd27b9c883ef

Author: Geert Uytterhoeven <[email protected]>
Date:   Wed Mar 4 12:56:20 2015 +0100

cpufreq/ppc: Add missing #include <asm/smp.h>

If CONFIG_SMP=n, <linux/smp.h> does not include <asm/smp.h>, causing:

drivers/cpufreq/ppc-corenet-cpufreq.c: In function 'corenet_cpufreq_cpu_init drivers/cpufreq/ppc-corenet-cpufreq.c:173:3: error: implicit declaration of
X-Patchwork-Id: 443703
Message-Id: <[email protected]>
To: [email protected]
Date: Wed, 25 Feb 2015 17:23:53 -0600

Export __spin_yield so that the arch_spin_unlock() function can be invoked from a module. This will be required for modules where we want to take a lock that is also is acquired in hypervisor real mode. Because we want to avoid running any lockdep code (which may not be safe in real mode), this lock needs to be an arch_spinlock_t instead of a normal spinlock.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds