All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 05/11] kernel/acpi: move acpi_video_flags sysctl to its own file
@ 2022-02-20  6:00 tangmeng
  2022-02-21 16:08 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: tangmeng @ 2022-02-20  6:00 UTC (permalink / raw)
  To: mcgrof, keescook, yzaikin, tglx, mingo, bp, dave.hansen, hpa
  Cc: linux-kernel, linux-fsdevel, nizhen, zhanglianjie, nixiaoming,
	linux-pm, linux-acpi, tangmeng

kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
dishes, this makes it very difficult to maintain.

To help with this maintenance let's start by moving sysctls to places
where they actually belong.  The proc sysctl maintainers do not want to
know what sysctl knobs you wish to add for your own piece of code, we
just care about the core logic.

All filesystem syctls now get reviewed by fs folks. This commit
follows the commit of fs, move the acpi_video_flags sysctl to its
own file, arch/x86/kernel/acpi/sleep.c.

Signed-off-by: tangmeng <tangmeng@uniontech.com>
---
 arch/x86/kernel/acpi/sleep.c | 21 ++++++++++++++++++++-
 include/linux/acpi.h         |  1 -
 kernel/sysctl.c              |  9 ---------
 3 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 1e97f944b47d..256f3c065605 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -20,7 +20,26 @@
 #include "../../realmode/rm/wakeup.h"
 #include "sleep.h"
 
-unsigned long acpi_realmode_flags;
+static unsigned long acpi_realmode_flags;
+#ifdef CONFIG_SYSCTL
+static struct ctl_table kern_acpi_table[] = {
+	{
+		.procname       = "acpi_video_flags",
+		.data           = &acpi_realmode_flags,
+		.maxlen         = sizeof(unsigned long),
+		.mode           = 0644,
+		.proc_handler   = proc_doulongvec_minmax,
+	},
+	{ }
+};
+
+static __init int kernel_acpi_sysctls_init(void)
+{
+	register_sysctl_init("kernel", kern_acpi_table);
+	return 0;
+}
+late_initcall(kernel_acpi_sysctls_init);
+#endif /* CONFIG_SYSCTL */
 
 #if defined(CONFIG_SMP) && defined(CONFIG_64BIT)
 static char temp_stack[4096];
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 6274758648e3..4f1d9cf579f5 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -349,7 +349,6 @@ static inline bool acpi_sci_irq_valid(void)
 }
 
 extern int sbf_port;
-extern unsigned long acpi_realmode_flags;
 
 int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index e6d99bbf9a9d..62499e3207aa 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1973,15 +1973,6 @@ static struct ctl_table kern_table[] = {
 		.proc_handler	= proc_dointvec,
 	},
 #endif
-#if	defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
-	{
-		.procname	= "acpi_video_flags",
-		.data		= &acpi_realmode_flags,
-		.maxlen		= sizeof (unsigned long),
-		.mode		= 0644,
-		.proc_handler	= proc_doulongvec_minmax,
-	},
-#endif
 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
 	{
 		.procname	= "ignore-unaligned-usertrap",
-- 
2.20.1




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

* Re: [PATCH 05/11] kernel/acpi: move acpi_video_flags sysctl to its own file
  2022-02-20  6:00 [PATCH 05/11] kernel/acpi: move acpi_video_flags sysctl to its own file tangmeng
@ 2022-02-21 16:08 ` Rafael J. Wysocki
       [not found]   ` <62143e02.1c69fb81.b7ae3.ddfeSMTPIN_ADDED_BROKEN@mx.google.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-02-21 16:08 UTC (permalink / raw)
  To: tangmeng
  Cc: Luis R. Rodriguez, Kees Cook, Iurii Zaikin, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	Linux Kernel Mailing List, linux-fsdevel, nizhen, zhanglianjie,
	nixiaoming, Linux PM, ACPI Devel Maling List

On Sun, Feb 20, 2022 at 7:01 AM tangmeng <tangmeng@uniontech.com> wrote:
>
> kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
> dishes, this makes it very difficult to maintain.
>
> To help with this maintenance let's start by moving sysctls to places
> where they actually belong.  The proc sysctl maintainers do not want to
> know what sysctl knobs you wish to add for your own piece of code, we
> just care about the core logic.
>
> All filesystem syctls now get reviewed by fs folks. This commit
> follows the commit of fs, move the acpi_video_flags sysctl to its
> own file, arch/x86/kernel/acpi/sleep.c.
>
> Signed-off-by: tangmeng <tangmeng@uniontech.com>

Do you want me to take this or does it depend on the rest of the series?

> ---
>  arch/x86/kernel/acpi/sleep.c | 21 ++++++++++++++++++++-
>  include/linux/acpi.h         |  1 -
>  kernel/sysctl.c              |  9 ---------
>  3 files changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
> index 1e97f944b47d..256f3c065605 100644
> --- a/arch/x86/kernel/acpi/sleep.c
> +++ b/arch/x86/kernel/acpi/sleep.c
> @@ -20,7 +20,26 @@
>  #include "../../realmode/rm/wakeup.h"
>  #include "sleep.h"
>
> -unsigned long acpi_realmode_flags;
> +static unsigned long acpi_realmode_flags;
> +#ifdef CONFIG_SYSCTL
> +static struct ctl_table kern_acpi_table[] = {
> +       {
> +               .procname       = "acpi_video_flags",
> +               .data           = &acpi_realmode_flags,
> +               .maxlen         = sizeof(unsigned long),
> +               .mode           = 0644,
> +               .proc_handler   = proc_doulongvec_minmax,
> +       },
> +       { }
> +};
> +
> +static __init int kernel_acpi_sysctls_init(void)
> +{
> +       register_sysctl_init("kernel", kern_acpi_table);
> +       return 0;
> +}
> +late_initcall(kernel_acpi_sysctls_init);
> +#endif /* CONFIG_SYSCTL */
>
>  #if defined(CONFIG_SMP) && defined(CONFIG_64BIT)
>  static char temp_stack[4096];
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 6274758648e3..4f1d9cf579f5 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -349,7 +349,6 @@ static inline bool acpi_sci_irq_valid(void)
>  }
>
>  extern int sbf_port;
> -extern unsigned long acpi_realmode_flags;
>
>  int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
>  int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index e6d99bbf9a9d..62499e3207aa 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1973,15 +1973,6 @@ static struct ctl_table kern_table[] = {
>                 .proc_handler   = proc_dointvec,
>         },
>  #endif
> -#if    defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
> -       {
> -               .procname       = "acpi_video_flags",
> -               .data           = &acpi_realmode_flags,
> -               .maxlen         = sizeof (unsigned long),
> -               .mode           = 0644,
> -               .proc_handler   = proc_doulongvec_minmax,
> -       },
> -#endif
>  #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
>         {
>                 .procname       = "ignore-unaligned-usertrap",
> --
> 2.20.1
>
>
>

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

* Re: [PATCH 05/11] kernel/acpi: move acpi_video_flags sysctl to its own file
       [not found]   ` <62143e02.1c69fb81.b7ae3.ddfeSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2022-02-22 19:26     ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-02-22 19:26 UTC (permalink / raw)
  To: tangmeng
  Cc: Rafael J. Wysocki, Luis R. Rodriguez, Kees Cook, Iurii Zaikin,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, Linux Kernel Mailing List, linux-fsdevel, nizhen,
	zhanglianjie, nixiaoming, Linux PM, ACPI Devel Maling List

On Tue, Feb 22, 2022 at 2:36 AM tangmeng <tangmeng@uniontech.com> wrote:
>
> On 2022/2/22 00:08, Rafael J. Wysocki wrote:
> > On Sun, Feb 20, 2022 at 7:01 AM tangmeng <tangmeng@uniontech.com> wrote:
> >>
> >> kernel/sysctl.c is a kitchen sink where everyone leaves their dirty
> >> dishes, this makes it very difficult to maintain.
> >>
> >> To help with this maintenance let's start by moving sysctls to places
> >> where they actually belong.  The proc sysctl maintainers do not want to
> >> know what sysctl knobs you wish to add for your own piece of code, we
> >> just care about the core logic.
> >>
> >> All filesystem syctls now get reviewed by fs folks. This commit
> >> follows the commit of fs, move the acpi_video_flags sysctl to its
> >> own file, arch/x86/kernel/acpi/sleep.c.
> >>
> >> Signed-off-by: tangmeng <tangmeng@uniontech.com>
> >
> > Do you want me to take this or does it depend on the rest of the series?
> >
>
> All current commits that move sysctl to its own file will be queued on
> to the new sysctl-next, I used that tree for further sysctl changes.
>
> git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git sysctl-next
>
> So, it depend on the rest of the series. And my series of commits need
> to be merged into the sysctl-next branch first together.

OK, so please feel free to add

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

to this patch.

> >> ---
> >>   arch/x86/kernel/acpi/sleep.c | 21 ++++++++++++++++++++-
> >>   include/linux/acpi.h         |  1 -
> >>   kernel/sysctl.c              |  9 ---------
> >>   3 files changed, 20 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
> >> index 1e97f944b47d..256f3c065605 100644
> >> --- a/arch/x86/kernel/acpi/sleep.c
> >> +++ b/arch/x86/kernel/acpi/sleep.c
> >> @@ -20,7 +20,26 @@
> >>   #include "../../realmode/rm/wakeup.h"
> >>   #include "sleep.h"
> >>
> >> -unsigned long acpi_realmode_flags;
> >> +static unsigned long acpi_realmode_flags;
> >> +#ifdef CONFIG_SYSCTL
> >> +static struct ctl_table kern_acpi_table[] = {
> >> +       {
> >> +               .procname       = "acpi_video_flags",
> >> +               .data           = &acpi_realmode_flags,
> >> +               .maxlen         = sizeof(unsigned long),
> >> +               .mode           = 0644,
> >> +               .proc_handler   = proc_doulongvec_minmax,
> >> +       },
> >> +       { }
> >> +};
> >> +
> >> +static __init int kernel_acpi_sysctls_init(void)
> >> +{
> >> +       register_sysctl_init("kernel", kern_acpi_table);
> >> +       return 0;
> >> +}
> >> +late_initcall(kernel_acpi_sysctls_init);
> >> +#endif /* CONFIG_SYSCTL */
> >>
> >>   #if defined(CONFIG_SMP) && defined(CONFIG_64BIT)
> >>   static char temp_stack[4096];
> >> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> >> index 6274758648e3..4f1d9cf579f5 100644
> >> --- a/include/linux/acpi.h
> >> +++ b/include/linux/acpi.h
> >> @@ -349,7 +349,6 @@ static inline bool acpi_sci_irq_valid(void)
> >>   }
> >>
> >>   extern int sbf_port;
> >> -extern unsigned long acpi_realmode_flags;
> >>
> >>   int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
> >>   int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
> >> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> >> index e6d99bbf9a9d..62499e3207aa 100644
> >> --- a/kernel/sysctl.c
> >> +++ b/kernel/sysctl.c
> >> @@ -1973,15 +1973,6 @@ static struct ctl_table kern_table[] = {
> >>                  .proc_handler   = proc_dointvec,
> >>          },
> >>   #endif
> >> -#if    defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
> >> -       {
> >> -               .procname       = "acpi_video_flags",
> >> -               .data           = &acpi_realmode_flags,
> >> -               .maxlen         = sizeof (unsigned long),
> >> -               .mode           = 0644,
> >> -               .proc_handler   = proc_doulongvec_minmax,
> >> -       },
> >> -#endif
> >>   #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
> >>          {
> >>                  .procname       = "ignore-unaligned-usertrap",
> >> --
> >> 2.20.1
> >>
> >>
> >>
> >
>
>

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

end of thread, other threads:[~2022-02-22 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-20  6:00 [PATCH 05/11] kernel/acpi: move acpi_video_flags sysctl to its own file tangmeng
2022-02-21 16:08 ` Rafael J. Wysocki
     [not found]   ` <62143e02.1c69fb81.b7ae3.ddfeSMTPIN_ADDED_BROKEN@mx.google.com>
2022-02-22 19:26     ` Rafael J. Wysocki

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.