2019-11-08 19:33:24

by Elliot Berman

[permalink] [raw]
Subject: [PATCH 1/2] reboot: Export reboot_mode

Export reboot_mode to support DLKMs wishing to modify reboot_mode.

Signed-off-by: Elliot Berman <[email protected]>
---
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


2019-11-08 19:41:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/2] reboot: Export reboot_mode

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 <[email protected]>
> ---
> 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

2019-11-11 16:20:27

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 1/2] reboot: Export reboot_mode

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.