Skip to contentSkip to conversation

platform: intel_turbo_max_3: make it explicitly non-modular

PATCH In review Paul Gortmaker 3 participants 5 messages Feb 14, 2017 – Feb 21, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform: intel_turbo_max_3: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_TURBO_MAX_3
drivers/platform/x86/Kconfig: bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

We do uncover some implicit includes during build coverage that were hidden behind the module.h which pulls in a lot of dependants.

Cc Darren Hart <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Srinivas Pandruvada <[email protected]>
---
 drivers/platform/x86/intel_turbo_max_3.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/platform/x86/intel_turbo_max_3.c +5 -6
index 0103f5b32e34..4f60d8e32a0a 100644
@@ -3,6 +3,8 @@
  * Copyright (c) 2017, Intel Corporation.
  * All rights reserved.
  *
+ * Author: Srinivas Pandruvada <[email protected]>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -16,7 +18,9 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/topology.h>
+#include <linux/workqueue.h>
 #include <linux/cpuhotplug.h>
 #include <linux/cpufeature.h>
 #include <asm/cpu_device_id.h>
@@ -123,7 +127,6 @@ static const struct x86_cpu_id itmt_legacy_cpu_ids[] = {
 	ICPU(INTEL_FAM6_BROADWELL_X),
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, itmt_legacy_cpu_ids);
 
 static int __init itmt_legacy_init(void)
 {
@@ -146,7 +149,3 @@ static int __init itmt_legacy_init(void)
 	return 0;
 }
 late_initcall(itmt_legacy_init)
-
-MODULE_DESCRIPTION("Intel Turbo Boost Max 3.0 enumeration driver");
-MODULE_AUTHOR("Srinivas Pandruvada <[email protected]>");
-MODULE_LICENSE("GPL v2");
Signature · 1 line
2.11.0
#1 lore raw
Quoted 10 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_TURBO_MAX_3
drivers/platform/x86/Kconfig: bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

Quoted 8 lines

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

We do uncover some implicit includes during build coverage that were hidden behind the module.h which pulls in a lot of dependants.

Paul, this all looks so very familiar... have we been through this before? Maybe for another driver...

Quoted 3 lines
Cc Darren Hart <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Srinivas Pandruvada <[email protected]>

Srinivas, any objections?

Quoted 50 lines
---
 drivers/platform/x86/intel_turbo_max_3.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/platform/x86/intel_turbo_max_3.c +5 -6
index 0103f5b32e34..4f60d8e32a0a 100644
@@ -3,6 +3,8 @@
  * Copyright (c) 2017, Intel Corporation.
  * All rights reserved.
  *
+ * Author: Srinivas Pandruvada <[email protected]>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -16,7 +18,9 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/topology.h>
+#include <linux/workqueue.h>
 #include <linux/cpuhotplug.h>
 #include <linux/cpufeature.h>
 #include <asm/cpu_device_id.h>
@@ -123,7 +127,6 @@ static const struct x86_cpu_id itmt_legacy_cpu_ids[] = {
 	ICPU(INTEL_FAM6_BROADWELL_X),
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, itmt_legacy_cpu_ids);
 
 static int __init itmt_legacy_init(void)
 {
@@ -146,7 +149,3 @@ static int __init itmt_legacy_init(void)
 	return 0;
 }
 late_initcall(itmt_legacy_init)
-
-MODULE_DESCRIPTION("Intel Turbo Boost Max 3.0 enumeration driver");
-MODULE_AUTHOR("Srinivas Pandruvada <[email protected]>");
-MODULE_LICENSE("GPL v2");
Signature · 1 line
2.11.0
Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#2 lore raw
Quoted 16 lines · [Re: [PATCH] platform: intel_turbo_max_3: make it explicitly non-modular] On…
Quoted 15 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_TURBO_MAX_3
drivers/platform/x86/Kconfig: bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.

Quoted 6 lines
Quoted 3 lines

We do uncover some implicit includes during build coverage that were hidden behind the module.h which pulls in a lot of dependants.

Paul, this all looks so very familiar... have we been through this before? Maybe for another driver...

Can't imagine why you'd say that.... :)

$ git log --oneline --author=Gortmaker drivers/platform
da43bf0c21e5 intel_pmic_gpio: Make explicitly non-modular
f48d1496b853 platform/olpc: Make ec explicitly non-modular
f52ab44fb748 platform/x86: Make intel_scu_ipc explicitly non-modular
1dda2b42db1b drivers/platform: Convert non-modular pdev_bus to use builtin_platform_driver

P.
--

Quoted 61 lines
Quoted 4 lines
Cc Darren Hart <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Srinivas Pandruvada <[email protected]>

Srinivas, any objections?

Quoted 50 lines
---
 drivers/platform/x86/intel_turbo_max_3.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/platform/x86/intel_turbo_max_3.c +5 -6
index 0103f5b32e34..4f60d8e32a0a 100644
@@ -3,6 +3,8 @@
  * Copyright (c) 2017, Intel Corporation.
  * All rights reserved.
  *
+ * Author: Srinivas Pandruvada <[email protected]>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -16,7 +18,9 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/topology.h>
+#include <linux/workqueue.h>
 #include <linux/cpuhotplug.h>
 #include <linux/cpufeature.h>
 #include <asm/cpu_device_id.h>
@@ -123,7 +127,6 @@ static const struct x86_cpu_id itmt_legacy_cpu_ids[] = {
 	ICPU(INTEL_FAM6_BROADWELL_X),
 	{}
 };
-MODULE_DEVICE_TABLE(x86cpu, itmt_legacy_cpu_ids);
 
 static int __init itmt_legacy_init(void)
 {
@@ -146,7 +149,3 @@ static int __init itmt_legacy_init(void)
 	return 0;
 }
 late_initcall(itmt_legacy_init)
-
-MODULE_DESCRIPTION("Intel Turbo Boost Max 3.0 enumeration driver");
-MODULE_AUTHOR("Srinivas Pandruvada <[email protected]>");
-MODULE_LICENSE("GPL v2");
Signature · 1 line
2.11.0
Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#3 lore raw
In reply to Darren Hart
Quoted 28 lines · Darren Hart
Quoted 13 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_TURBO_MAX_3 drivers/platform/x86/Kconfig:   bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

Quoted 9 lines

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

We do uncover some implicit includes during build coverage that were hidden behind the module.h which pulls in a lot of dependants.

Paul, this all looks so very familiar... have we been through this before? Maybe
for another driver...

Quoted 5 lines
Quoted 3 lines
Cc Darren Hart <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Srinivas Pandruvada <[email protected]>

Srinivas, any objections?

This module can be loadable just by adding EXPORT_GPL to two scheduler function. I was hoping that someone will require those functions to be exported.
But any way I have no objections in this case as this driver doesn't have to be loadable at all.

Thanks,
Srinivas

Quoted 60 lines
Quoted 58 lines

---
 drivers/platform/x86/intel_turbo_max_3.c | 11 +++++------

 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/platform/x86/intel_turbo_max_3.c +1 -0
index 0103f5b32e34..4f60d8e32a0a 100644
@@ -3,6 +3,8 @@
   * Copyright (c) 2017, Intel Corporation.
   * All rights reserved.
   *
+ * Author: Srinivas Pandruvada <[email protected]

m>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.

drivers/platform/x86/intel_turbo_max_3.c +0 -0
@@ -16,7 +18,9 @@
  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt


 #include <linux/kernel.h>

drivers/platform/x86/intel_turbo_max_3.c +3 -1
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/topology.h>
+#include <linux/workqueue.h>

 #include <linux/cpuhotplug.h>
 #include <linux/cpufeature.h>
 #include <asm/cpu_device_id.h>

drivers/platform/x86/intel_turbo_max_3.c +0 -1
@@ -123,7 +127,6 @@ static const struct x86_cpu_id
 itmt_legacy_cpu_ids[] = {
  	ICPU(INTEL_FAM6_BROADWELL_X),
  	{}
  };
-MODULE_DEVICE_TABLE(x86cpu, itmt_legacy_cpu_ids);


 static int __init itmt_legacy_init(void)
 {

drivers/platform/x86/intel_turbo_max_3.c +0 -2
@@ -146,7 +149,3 @@ static int __init itmt_legacy_init(void)
  	return 0;
  }
  late_initcall(itmt_legacy_init)
-
-MODULE_DESCRIPTION("Intel Turbo Boost Max 3.0 enumeration

driver");
-MODULE_AUTHOR("Srinivas Pandruvada <[email protected] l.com>");
-MODULE_LICENSE("GPL v2");
--
2.11.0

#4 lore raw
Quoted 33 lines · Srinivas Pandruvada
Quoted 32 lines · Darren Hart
Quoted 13 lines · Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/platform/x86/Kconfig:config INTEL_TURBO_MAX_3 drivers/platform/x86/Kconfig:   bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

Quoted 9 lines

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

We do uncover some implicit includes during build coverage that were hidden behind the module.h which pulls in a lot of dependants.

Paul, this all looks so very familiar... have we been through this before? Maybe
for another driver...

Quoted 3 lines
Cc Darren Hart <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Srinivas Pandruvada <[email protected]>
Quoted 6 lines
Quoted 1 line

Srinivas, any objections?

This module can be loadable just by adding EXPORT_GPL to two scheduler function. I was hoping that someone will require those functions to be exported.
But any way I have no objections in this case as this driver doesn't have to be loadable at all.

OK, merged. We can always make it a module if that becomes an option.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center