All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Support reboot power-off driver as module
@ 2019-11-08 19:32 Elliot Berman
  2019-11-08 19:32 ` [PATCH 1/2] reboot: Export reboot_mode Elliot Berman
  2019-11-08 19:32 ` [PATCH 2/2] power: reset: Enable tristate on restart power-off driver Elliot Berman
  0 siblings, 2 replies; 5+ messages in thread
From: Elliot Berman @ 2019-11-08 19:32 UTC (permalink / raw)
  To: sre, tkjos
  Cc: tsoni, rananta, bjorn.andersson, linux-kernel, linux-pm, Elliot Berman

This series supports reboot power-off driver as a module by exporting
reboot_mode symbol.

Elliot Berman (2):
  reboot: Export reboot_mode
  power: reset: Enable tristate on restart power-off driver

 drivers/power/reset/Kconfig | 2 +-
 kernel/reboot.c             | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH 1/2] reboot: Export reboot_mode
  2019-11-08 19:32 [PATCH 0/2] Support reboot power-off driver as module Elliot Berman
@ 2019-11-08 19:32 ` Elliot Berman
  2019-11-08 19:39   ` Greg KH
  2019-11-08 19:32 ` [PATCH 2/2] power: reset: Enable tristate on restart power-off driver Elliot Berman
  1 sibling, 1 reply; 5+ messages in thread
From: Elliot Berman @ 2019-11-08 19:32 UTC (permalink / raw)
  To: sre, tkjos
  Cc: tsoni, rananta, bjorn.andersson, linux-kernel, linux-pm, Elliot Berman

Export reboot_mode to support DLKMs wishing to modify reboot_mode.

Signed-off-by: Elliot Berman <eberman@codeaurora.org>
---
 kernel/reboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/reboot.c b/kernel/reboot.c
index c4d472b..6518370 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -32,7 +32,9 @@ EXPORT_SYMBOL(cad_pid);
 #define DEFAULT_REBOOT_MODE
 #endif
 enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE;
+EXPORT_SYMBOL(reboot_mode);
 enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED;
+EXPORT_SYMBOL(panic_reboot_mode);
 
 /*
  * This variable is used privately to keep track of whether or not
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH 2/2] power: reset: Enable tristate on restart power-off driver
  2019-11-08 19:32 [PATCH 0/2] Support reboot power-off driver as module Elliot Berman
  2019-11-08 19:32 ` [PATCH 1/2] reboot: Export reboot_mode Elliot Berman
@ 2019-11-08 19:32 ` Elliot Berman
  1 sibling, 0 replies; 5+ messages in thread
From: Elliot Berman @ 2019-11-08 19:32 UTC (permalink / raw)
  To: sre, tkjos
  Cc: tsoni, rananta, bjorn.andersson, linux-kernel, linux-pm, Elliot Berman

Since reboot_mode is an exported symbol, restart power-off driver can be
compiled as module.

Signed-off-by: Elliot Berman <eberman@codeaurora.org>
---
 drivers/power/reset/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index a564237..8db1d9d 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -150,7 +150,7 @@ config POWER_RESET_QNAP
 	  Say Y if you have a QNAP NAS.
 
 config POWER_RESET_RESTART
-	bool "Restart power-off driver"
+	tristate "Restart power-off driver"
 	help
 	  Some boards don't actually have the ability to power off.
 	  Instead they restart, and u-boot holds the SoC until the
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: [PATCH 1/2] reboot: Export reboot_mode
  2019-11-08 19:32 ` [PATCH 1/2] reboot: Export reboot_mode Elliot Berman
@ 2019-11-08 19:39   ` Greg KH
  2019-11-11 16:17     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-11-08 19:39 UTC (permalink / raw)
  To: Elliot Berman
  Cc: sre, tkjos, tsoni, rananta, bjorn.andersson, linux-kernel, linux-pm

On Fri, Nov 08, 2019 at 11:32:11AM -0800, Elliot Berman wrote:
> Export reboot_mode to support DLKMs wishing to modify reboot_mode.

"DLKMs"?  What's that?

A kernel module?

> 
> Signed-off-by: Elliot Berman <eberman@codeaurora.org>
> ---
>  kernel/reboot.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index c4d472b..6518370 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -32,7 +32,9 @@ EXPORT_SYMBOL(cad_pid);
>  #define DEFAULT_REBOOT_MODE
>  #endif
>  enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE;
> +EXPORT_SYMBOL(reboot_mode);
>  enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED;
> +EXPORT_SYMBOL(panic_reboot_mode);

EXPORT_SYMBOL_GPL() perhaps?

thanks,

greg k-h

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

* Re: [PATCH 1/2] reboot: Export reboot_mode
  2019-11-08 19:39   ` Greg KH
@ 2019-11-11 16:17     ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2019-11-11 16:17 UTC (permalink / raw)
  To: Greg KH
  Cc: Elliot Berman, sre, tkjos, tsoni, rananta, bjorn.andersson,
	linux-kernel, linux-pm

On Fri, Nov 08, 2019 at 08:39:58PM +0100, Greg KH wrote:
> > diff --git a/kernel/reboot.c b/kernel/reboot.c
> > index c4d472b..6518370 100644
> > --- a/kernel/reboot.c
> > +++ b/kernel/reboot.c
> > @@ -32,7 +32,9 @@ EXPORT_SYMBOL(cad_pid);
> >  #define DEFAULT_REBOOT_MODE
> >  #endif
> >  enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE;
> > +EXPORT_SYMBOL(reboot_mode);
> >  enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED;
> > +EXPORT_SYMBOL(panic_reboot_mode);
> 
> EXPORT_SYMBOL_GPL() perhaps?

Absolutely.  But then again drivers/power/reset/reboot-mode.c, which
he wants to make modular in patch 2 is just a trivial abstraction
that avoids drivers directly poking into these values.  I really don't
see a point to make that modular to start with.

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

end of thread, other threads:[~2019-11-11 16:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 19:32 [PATCH 0/2] Support reboot power-off driver as module Elliot Berman
2019-11-08 19:32 ` [PATCH 1/2] reboot: Export reboot_mode Elliot Berman
2019-11-08 19:39   ` Greg KH
2019-11-11 16:17     ` Christoph Hellwig
2019-11-08 19:32 ` [PATCH 2/2] power: reset: Enable tristate on restart power-off driver Elliot Berman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.