linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Export __spin_yield
       [not found] <1424477465-9199-2-git-send-email-warrier@linux.vnet.ibm.com>
@ 2015-02-24  0:10 ` Suresh E. Warrier
  2015-02-24  3:38   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Suresh E. Warrier @ 2015-02-24  0:10 UTC (permalink / raw)
  To: linuxppc-dev

Export __spin_yield so that the arch_spin_unlock() function
can be invoked from a module.

Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
---
 arch/powerpc/lib/locks.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c
index bb7cfec..d100de8 100644
--- a/arch/powerpc/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -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(__spin_yield);

 /*
  * Waiting for a read lock or a write lock on a rwlock...
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] powerpc: Export __spin_yield
  2015-02-24  0:10 ` Suresh E. Warrier
@ 2015-02-24  3:38   ` Benjamin Herrenschmidt
  2015-02-24 16:37     ` Suresh E. Warrier
  0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2015-02-24  3:38 UTC (permalink / raw)
  To: Suresh E. Warrier; +Cc: linuxppc-dev

On Mon, 2015-02-23 at 18:10 -0600, Suresh E. Warrier wrote:
> Export __spin_yield so that the arch_spin_unlock() function
> can be invoked from a module.

Make it EXPORT_SYMBOL_GPL. Also explain why a module might need it

> Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
> ---
>  arch/powerpc/lib/locks.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c
> index bb7cfec..d100de8 100644
> --- a/arch/powerpc/lib/locks.c
> +++ b/arch/powerpc/lib/locks.c
> @@ -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(__spin_yield);
> 
>  /*
>   * Waiting for a read lock or a write lock on a rwlock...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] powerpc: Export __spin_yield
  2015-02-24  3:38   ` Benjamin Herrenschmidt
@ 2015-02-24 16:37     ` Suresh E. Warrier
  2015-02-24 21:11       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Suresh E. Warrier @ 2015-02-24 16:37 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

On 02/23/2015 09:38 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2015-02-23 at 18:10 -0600, Suresh E. Warrier wrote:
>> Export __spin_yield so that the arch_spin_unlock() function
>> can be invoked from a module.
> 
> Make it EXPORT_SYMBOL_GPL. Also explain why a module might need it
> 

Sure, I will change that to EXPORT_SYMBOL_GPL. Just curious, though, 
there is another symbol arch_spin_unlock_wait that is exported from
the file without the _GPL prefix. Any idea why?

I have mentioned that this needs to be exported to call the 
arch_spin_unlock() function from a module. What additional information
do you think will be useful here ? Are you looking at something
that explains why a module might need to call arch_spin_unlock()?

Thanks.
-suresh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] powerpc: Export __spin_yield
  2015-02-24 16:37     ` Suresh E. Warrier
@ 2015-02-24 21:11       ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2015-02-24 21:11 UTC (permalink / raw)
  To: Suresh E. Warrier; +Cc: linuxppc-dev

On Tue, 2015-02-24 at 10:37 -0600, Suresh E. Warrier wrote:
> On 02/23/2015 09:38 PM, Benjamin Herrenschmidt wrote:
> > On Mon, 2015-02-23 at 18:10 -0600, Suresh E. Warrier wrote:
> >> Export __spin_yield so that the arch_spin_unlock() function
> >> can be invoked from a module.
> > 
> > Make it EXPORT_SYMBOL_GPL. Also explain why a module might need it
> > 
> 
> Sure, I will change that to EXPORT_SYMBOL_GPL. Just curious, though, 
> there is another symbol arch_spin_unlock_wait that is exported from
> the file without the _GPL prefix. Any idea why?

Nope. Not sure how come we did that.

> I have mentioned that this needs to be exported to call the 
> arch_spin_unlock() function from a module. What additional information
> do you think will be useful here ? Are you looking at something
> that explains why a module might need to call arch_spin_unlock()?

What kind of module might need it...

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] powerpc: Export __spin_yield
@ 2015-02-25 23:23 Suresh E. Warrier
  2015-03-19 23:08 ` Paul Mackerras
  0 siblings, 1 reply; 8+ messages in thread
From: Suresh E. Warrier @ 2015-02-25 23:23 UTC (permalink / raw)
  To: linuxppc-dev

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.

Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
---
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(+)

diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c
index bb7cfec..f31bcee 100644
--- a/arch/powerpc/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -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...
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] powerpc: Export __spin_yield
  2015-02-25 23:23 [PATCH] powerpc: Export __spin_yield Suresh E. Warrier
@ 2015-03-19 23:08 ` Paul Mackerras
  2015-03-30 10:17   ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Mackerras @ 2015-03-19 23:08 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Suresh E. Warrier

On Wed, Feb 25, 2015 at 05:23:53PM -0600, Suresh E. Warrier wrote:
> 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.
> 
> Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>

Acked-by: Paul Mackerras <paulus@samba.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] powerpc: Export __spin_yield
  2015-03-19 23:08 ` Paul Mackerras
@ 2015-03-30 10:17   ` Geert Uytterhoeven
  2015-03-30 10:57     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2015-03-30 10:17 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Suresh E. Warrier, Linuxppc-dev, Paul Mackerras

Hi Ben,

On Fri, Mar 20, 2015 at 12:08 AM, Paul Mackerras <paulus@samba.org> wrote:
> On Wed, Feb 25, 2015 at 05:23:53PM -0600, Suresh E. Warrier wrote:
>> 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.
>>
>> Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
>
> Acked-by: Paul Mackerras <paulus@samba.org>

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

commit 1f8c82ab1b0bc7e24601c0fca411fd27b9c883ef
Author: Geert Uytterhoeven <geert+renesas@glider.be>
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: <54EE5989.7010800@linux.vnet.ibm.com>
    To: linuxppc-dev@ozlabs.org
    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.

    Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
    Acked-by: Paul Mackerras <paulus@samba.org>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] powerpc: Export __spin_yield
  2015-03-30 10:17   ` Geert Uytterhoeven
@ 2015-03-30 10:57     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2015-03-30 10:57 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Suresh E. Warrier, Linuxppc-dev, Paul Mackerras

On Mon, 2015-03-30 at 12:17 +0200, Geert Uytterhoeven wrote:
> Hi Ben,
> 
> On Fri, Mar 20, 2015 at 12:08 AM, Paul Mackerras <paulus@samba.org> wrote:
> > On Wed, Feb 25, 2015 at 05:23:53PM -0600, Suresh E. Warrier wrote:
> >> 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.
> >>
> >> Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
> >
> > Acked-by: Paul Mackerras <paulus@samba.org>
> 
> 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.

> commit 1f8c82ab1b0bc7e24601c0fca411fd27b9c883ef
> Author: Geert Uytterhoeven <geert+renesas@glider.be>
> 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: <54EE5989.7010800@linux.vnet.ibm.com>
>     To: linuxppc-dev@ozlabs.org
>     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.
> 
>     Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
>     Acked-by: Paul Mackerras <paulus@samba.org>
>     Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-30 10:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 23:23 [PATCH] powerpc: Export __spin_yield Suresh E. Warrier
2015-03-19 23:08 ` Paul Mackerras
2015-03-30 10:17   ` Geert Uytterhoeven
2015-03-30 10:57     ` Benjamin Herrenschmidt
     [not found] <1424477465-9199-2-git-send-email-warrier@linux.vnet.ibm.com>
2015-02-24  0:10 ` Suresh E. Warrier
2015-02-24  3:38   ` Benjamin Herrenschmidt
2015-02-24 16:37     ` Suresh E. Warrier
2015-02-24 21:11       ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).