linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem
@ 2011-05-28  0:33 Kevin Hilman
  2011-05-28  9:01 ` [linux-pm] " Rafael J. Wysocki
  2011-06-12 14:20 ` Rafael J. Wysocki
  0 siblings, 2 replies; 7+ messages in thread
From: Kevin Hilman @ 2011-05-28  0:33 UTC (permalink / raw)
  To: linux-pm; +Cc: linux-omap, Jean Pihet

Some platforms wish to implement their PM core suspend code as
modules.  To do so, these functions need to be exported to modules.

Reported-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
Applies against v2.6.39

 kernel/power/suspend.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 6275970..eca495d 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -44,6 +44,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
 	suspend_ops = ops;
 	mutex_unlock(&pm_mutex);
 }
+EXPORT_SYMBOL(suspend_set_ops);
 
 bool valid_state(suspend_state_t state)
 {
@@ -65,6 +66,7 @@ int suspend_valid_only_mem(suspend_state_t state)
 {
 	return state == PM_SUSPEND_MEM;
 }
+EXPORT_SYMBOL(suspend_valid_only_mem);
 
 static int suspend_test(int level)
 {
-- 
1.7.4


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

* Re: [linux-pm] [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem
  2011-05-28  0:33 [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem Kevin Hilman
@ 2011-05-28  9:01 ` Rafael J. Wysocki
  2011-05-30  7:43   ` Jean Pihet
  2011-06-12 14:20 ` Rafael J. Wysocki
  1 sibling, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2011-05-28  9:01 UTC (permalink / raw)
  To: linux-pm; +Cc: Kevin Hilman, linux-omap, Jean Pihet

On Saturday, May 28, 2011, Kevin Hilman wrote:
> Some platforms wish to implement their PM core suspend code as
> modules.  To do so, these functions need to be exported to modules.

Hmm.  What happens if the module is not loaded and the user attempts to
suspend?

Rafael


> Reported-by: Jean Pihet <j-pihet@ti.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>
> ---
> Applies against v2.6.39
> 
>  kernel/power/suspend.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index 6275970..eca495d 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -44,6 +44,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
>  	suspend_ops = ops;
>  	mutex_unlock(&pm_mutex);
>  }
> +EXPORT_SYMBOL(suspend_set_ops);
>  
>  bool valid_state(suspend_state_t state)
>  {
> @@ -65,6 +66,7 @@ int suspend_valid_only_mem(suspend_state_t state)
>  {
>  	return state == PM_SUSPEND_MEM;
>  }
> +EXPORT_SYMBOL(suspend_valid_only_mem);
>  
>  static int suspend_test(int level)
>  {
> 


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

* Re: [linux-pm] [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem
  2011-05-28  9:01 ` [linux-pm] " Rafael J. Wysocki
@ 2011-05-30  7:43   ` Jean Pihet
  2011-05-30 14:00     ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Pihet @ 2011-05-30  7:43 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, Kevin Hilman, linux-omap

Rafael,

On Sat, May 28, 2011 at 11:01 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Saturday, May 28, 2011, Kevin Hilman wrote:
>> Some platforms wish to implement their PM core suspend code as
>> modules.  To do so, these functions need to be exported to modules.
>
> Hmm.  What happens if the module is not loaded and the user attempts to
> suspend?
In that case suspend_ops is NULL and suspending has no effect
(pm_suspend returns -ENODEV).
Note that this also happens after the module unload.

Is that the expected behavior?

>
> Rafael

Regards,
Jean

>
>
>> Reported-by: Jean Pihet <j-pihet@ti.com>
>> Signed-off-by: Kevin Hilman <khilman@ti.com>
>> ---
>> Applies against v2.6.39
>>
>>  kernel/power/suspend.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
>> index 6275970..eca495d 100644
>> --- a/kernel/power/suspend.c
>> +++ b/kernel/power/suspend.c
>> @@ -44,6 +44,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
>>       suspend_ops = ops;
>>       mutex_unlock(&pm_mutex);
>>  }
>> +EXPORT_SYMBOL(suspend_set_ops);
>>
>>  bool valid_state(suspend_state_t state)
>>  {
>> @@ -65,6 +66,7 @@ int suspend_valid_only_mem(suspend_state_t state)
>>  {
>>       return state == PM_SUSPEND_MEM;
>>  }
>> +EXPORT_SYMBOL(suspend_valid_only_mem);
>>
>>  static int suspend_test(int level)
>>  {
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [linux-pm] [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem
  2011-05-30  7:43   ` Jean Pihet
@ 2011-05-30 14:00     ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2011-05-30 14:00 UTC (permalink / raw)
  To: Jean Pihet; +Cc: linux-pm, Kevin Hilman, linux-omap

On Monday, May 30, 2011, Jean Pihet wrote:
> Rafael,

Hi,

> On Sat, May 28, 2011 at 11:01 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Saturday, May 28, 2011, Kevin Hilman wrote:
> >> Some platforms wish to implement their PM core suspend code as
> >> modules.  To do so, these functions need to be exported to modules.
> >
> > Hmm.  What happens if the module is not loaded and the user attempts to
> > suspend?
> In that case suspend_ops is NULL and suspending has no effect
> (pm_suspend returns -ENODEV).
> Note that this also happens after the module unload.
> 
> Is that the expected behavior?

Yes, kind of, thanks.

Take care,
Rafael

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

* Re: [linux-pm] [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem
  2011-05-28  0:33 [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem Kevin Hilman
  2011-05-28  9:01 ` [linux-pm] " Rafael J. Wysocki
@ 2011-06-12 14:20 ` Rafael J. Wysocki
  2011-06-26 11:08   ` Pavel Machek
  1 sibling, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2011-06-12 14:20 UTC (permalink / raw)
  To: linux-pm; +Cc: Kevin Hilman, linux-omap, Jean Pihet

On Saturday, May 28, 2011, Kevin Hilman wrote:
> Some platforms wish to implement their PM core suspend code as
> modules.  To do so, these functions need to be exported to modules.
> 
> Reported-by: Jean Pihet <j-pihet@ti.com>
> Signed-off-by: Kevin Hilman <khilman@ti.com>

Applied to suspend-2.6/linux-next.

Thanks,
Rafael


> ---
> Applies against v2.6.39
> 
>  kernel/power/suspend.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index 6275970..eca495d 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -44,6 +44,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
>  	suspend_ops = ops;
>  	mutex_unlock(&pm_mutex);
>  }
> +EXPORT_SYMBOL(suspend_set_ops);
>  
>  bool valid_state(suspend_state_t state)
>  {
> @@ -65,6 +66,7 @@ int suspend_valid_only_mem(suspend_state_t state)
>  {
>  	return state == PM_SUSPEND_MEM;
>  }
> +EXPORT_SYMBOL(suspend_valid_only_mem);
>  
>  static int suspend_test(int level)
>  {
> 


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

* Re: [linux-pm] [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem
  2011-06-12 14:20 ` Rafael J. Wysocki
@ 2011-06-26 11:08   ` Pavel Machek
  2011-06-26 12:22     ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2011-06-26 11:08 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, linux-omap, Jean Pihet

On Sun 2011-06-12 16:20:20, Rafael J. Wysocki wrote:
> On Saturday, May 28, 2011, Kevin Hilman wrote:
> > Some platforms wish to implement their PM core suspend code as
> > modules.  To do so, these functions need to be exported to modules.
> > 
> > Reported-by: Jean Pihet <j-pihet@ti.com>
> > Signed-off-by: Kevin Hilman <khilman@ti.com>
> 
> Applied to suspend-2.6/linux-next.

I'd do export_symbol_gpl on those; it is really tightly coupled...

       			    	      pavel

> > @@ -44,6 +44,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
> >  	suspend_ops = ops;
> >  	mutex_unlock(&pm_mutex);
> >  }
> > +EXPORT_SYMBOL(suspend_set_ops);
> >  
> >  bool valid_state(suspend_state_t state)
> >  {

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem
  2011-06-26 11:08   ` Pavel Machek
@ 2011-06-26 12:22     ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2011-06-26 12:22 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-pm, linux-omap

On Sunday, June 26, 2011, Pavel Machek wrote:
> On Sun 2011-06-12 16:20:20, Rafael J. Wysocki wrote:
> > On Saturday, May 28, 2011, Kevin Hilman wrote:
> > > Some platforms wish to implement their PM core suspend code as
> > > modules.  To do so, these functions need to be exported to modules.
> > > 
> > > Reported-by: Jean Pihet <j-pihet@ti.com>
> > > Signed-off-by: Kevin Hilman <khilman@ti.com>
> > 
> > Applied to suspend-2.6/linux-next.
> 
> I'd do export_symbol_gpl on those; it is really tightly coupled...

Good point, thanks, I'll fix this up.

Rafael

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

end of thread, other threads:[~2011-06-26 12:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-28  0:33 [PATCH] PM: export suspend_set_ops, suspend_valid_only_mem Kevin Hilman
2011-05-28  9:01 ` [linux-pm] " Rafael J. Wysocki
2011-05-30  7:43   ` Jean Pihet
2011-05-30 14:00     ` Rafael J. Wysocki
2011-06-12 14:20 ` Rafael J. Wysocki
2011-06-26 11:08   ` Pavel Machek
2011-06-26 12:22     ` Rafael J. Wysocki

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).