Skip to contentSkip to conversation

ACPI: x86: Move x86 stuff into dedicated folder

PATCH In review Andy Shevchenko 2 participants 10 messages Apr 4, 2024 – Apr 5, 2024 ACPI

lore
Share & tools
lore
#0 lore raw

v2 cover ACPI: x86: Move x86 stuff into dedicated folder

Move x86 related modules (which are solely for x86) to the dedicated folder.
Note, there are more modules, but they are related to tables and potentially might be used for other architectures in the future. Hence touched only non-table related code.

In v2:
- fixed acpi_lpss_init() stub visibility (LKP)

Andy Shevchenko (4):
ACPI: x86: Introduce a Makefile
ACPI: x86: Move acpi_cmos_rtc to x86 folder
ACPI: x86: Move blacklist to x86 folder
ACPI: x86: Move LPSS to x86 folder

 drivers/acpi/Makefile                            | 7 +------
 drivers/acpi/internal.h                          | 3 ++-
 drivers/acpi/x86/Makefile                        | 8 ++++++++
 drivers/acpi/{ => x86}/blacklist.c               | 2 +-
 drivers/acpi/{acpi_cmos_rtc.c => x86/cmos_rtc.c} | 2 +-
 drivers/acpi/{acpi_lpss.c => x86/lpss.c}         | 2 +-
 6 files changed, 14 insertions(+), 10 deletions(-)
 create mode 100644 drivers/acpi/x86/Makefile
 rename drivers/acpi/{ => x86}/blacklist.c (99%)
 rename drivers/acpi/{acpi_cmos_rtc.c => x86/cmos_rtc.c} (98%)
 rename drivers/acpi/{acpi_lpss.c => x86/lpss.c} (99%)
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#1 lore raw

PATCH v2 1/4 ACPI: x86: Introduce a Makefile

There will be more modules coming here, so, introduce a separate Makefile and include it in parent one via obj-$(CONFIG_X86).

---
 drivers/acpi/Makefile     | 4 +---
 drivers/acpi/x86/Makefile | 4 ++++
 2 files changed, 5 insertions(+), 3 deletions(-)
 create mode 100644 drivers/acpi/x86/Makefile
drivers/acpi/Makefile +1 -3
index d69d5444acdb..0db88aab309f 100644
@@ -56,9 +56,6 @@ acpi-y				+= evged.o
 acpi-y				+= sysfs.o
 acpi-y				+= property.o
 acpi-$(CONFIG_X86)		+= acpi_cmos_rtc.o
-acpi-$(CONFIG_X86)		+= x86/apple.o
-acpi-$(CONFIG_X86)		+= x86/utils.o
-acpi-$(CONFIG_X86)		+= x86/s2idle.o
 acpi-$(CONFIG_DEBUG_FS)		+= debugfs.o
 acpi-y				+= acpi_lpat.o
 acpi-$(CONFIG_ACPI_FPDT)	+= acpi_fpdt.o
@@ -133,3 +130,4 @@ obj-$(CONFIG_ARM64)		+= arm64/
 obj-$(CONFIG_ACPI_VIOT)		+= viot.o
 
 obj-$(CONFIG_RISCV)		+= riscv/
+obj-$(CONFIG_X86)		+= x86/
drivers/acpi/x86/Makefile new file +4 -0
new file mode 100644
index 000000000000..bd17dd2c2c5b
@@ -0,0 +1,4 @@
+obj-$(CONFIG_ACPI)	+= acpi-x86.o
+acpi-x86-y		+= apple.o
+acpi-x86-y		+= s2idle.o
+acpi-x86-y		+= utils.o
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#2 lore raw

PATCH v2 2/4 ACPI: x86: Move acpi_cmos_rtc to x86 folder

In reply to Andy Shevchenko

acpi_cmos_rtc is built solely for x86, move it to the respective folder.

---
 drivers/acpi/Makefile                            | 1 -
 drivers/acpi/x86/Makefile                        | 1 +
 drivers/acpi/{acpi_cmos_rtc.c => x86/cmos_rtc.c} | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename drivers/acpi/{acpi_cmos_rtc.c => x86/cmos_rtc.c} (98%)
drivers/acpi/Makefile +0 -1
index 0db88aab309f..413c18e2bf61 100644
@@ -55,7 +55,6 @@ acpi-y				+= event.o
 acpi-y				+= evged.o
 acpi-y				+= sysfs.o
 acpi-y				+= property.o
-acpi-$(CONFIG_X86)		+= acpi_cmos_rtc.o
 acpi-$(CONFIG_DEBUG_FS)		+= debugfs.o
 acpi-y				+= acpi_lpat.o
 acpi-$(CONFIG_ACPI_FPDT)	+= acpi_fpdt.o
drivers/acpi/x86/Makefile +1 -0
index bd17dd2c2c5b..b97b1bcf8404 100644
@@ -1,4 +1,5 @@
 obj-$(CONFIG_ACPI)	+= acpi-x86.o
 acpi-x86-y		+= apple.o
+acpi-x86-y		+= cmos_rtc.o
 acpi-x86-y		+= s2idle.o
 acpi-x86-y		+= utils.o
drivers/acpi/x86/cmos_rtc.c renamed from drivers/acpi/acpi_cmos_rtc.c +1 -1
similarity index 98%
rename from drivers/acpi/acpi_cmos_rtc.c
rename to drivers/acpi/x86/cmos_rtc.c
index 9b55d1593d16..51643ff6fe5f 100644
@@ -15,7 +15,7 @@
 #include <linux/module.h>
 #include <linux/mc146818rtc.h>
 
-#include "internal.h"
+#include "../internal.h"
 
 static const struct acpi_device_id acpi_cmos_rtc_ids[] = {
 	{ "PNP0B00" },
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#3 lore raw

PATCH v2 3/4 ACPI: x86: Move blacklist to x86 folder

In reply to Andy Shevchenko

blacklist is built solely for x86, move it to the respective folder.

---
 drivers/acpi/Makefile              | 1 -
 drivers/acpi/x86/Makefile          | 2 ++
 drivers/acpi/{ => x86}/blacklist.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
 rename drivers/acpi/{ => x86}/blacklist.c (99%)
drivers/acpi/Makefile +0 -1
index 413c18e2bf61..6f4187a34f41 100644
@@ -14,7 +14,6 @@ tables.o: $(src)/../../include/$(CONFIG_ACPI_CUSTOM_DSDT_FILE) ;
 endif
 
 obj-$(CONFIG_ACPI)		+= tables.o
-obj-$(CONFIG_X86)		+= blacklist.o
 
 #
 # ACPI Core Subsystem (Interpreter)
drivers/acpi/x86/Makefile +2 -0
index b97b1bcf8404..1f3c5fa84f9e 100644
@@ -3,3 +3,5 @@ acpi-x86-y		+= apple.o
 acpi-x86-y		+= cmos_rtc.o
 acpi-x86-y		+= s2idle.o
 acpi-x86-y		+= utils.o
+
+obj-$(CONFIG_X86)	+= blacklist.o
drivers/acpi/x86/blacklist.c renamed from drivers/acpi/blacklist.c +1 -1
similarity index 99%
rename from drivers/acpi/blacklist.c
rename to drivers/acpi/x86/blacklist.c
index a558d24fb788..55214d0a12b1 100644
@@ -17,7 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/dmi.h>
 
-#include "internal.h"
+#include "../internal.h"
 
 #ifdef CONFIG_DMI
 static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#4 lore raw

Re: [PATCH v2 3/4] ACPI: x86: Move blacklist to x86 folder

Quoted 1 line · Andy Shevchenko

blacklist is built solely for x86, move it to the respective folder.

Don't you need #ifdef CONFIG_X86 for acpi_blacklisted() in include/linux/acpi.h

Quoted 46 lines
---
 drivers/acpi/Makefile              | 1 -
 drivers/acpi/x86/Makefile          | 2 ++
 drivers/acpi/{ => x86}/blacklist.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
 rename drivers/acpi/{ => x86}/blacklist.c (99%)
drivers/acpi/Makefile +0 -1
index 413c18e2bf61..6f4187a34f41 100644
@@ -14,7 +14,6 @@ tables.o: $(src)/../../include/$(CONFIG_ACPI_CUSTOM_DSDT_FILE) ;
 endif
 
 obj-$(CONFIG_ACPI)		+= tables.o
-obj-$(CONFIG_X86)		+= blacklist.o
 
 #
 # ACPI Core Subsystem (Interpreter)
drivers/acpi/x86/Makefile +2 -0
index b97b1bcf8404..1f3c5fa84f9e 100644
@@ -3,3 +3,5 @@ acpi-x86-y		+= apple.o
 acpi-x86-y		+= cmos_rtc.o
 acpi-x86-y		+= s2idle.o
 acpi-x86-y		+= utils.o
+
+obj-$(CONFIG_X86)	+= blacklist.o
drivers/acpi/x86/blacklist.c renamed from drivers/acpi/blacklist.c +1 -1
similarity index 99%
rename from drivers/acpi/blacklist.c
rename to drivers/acpi/x86/blacklist.c
index a558d24fb788..55214d0a12b1 100644
@@ -17,7 +17,7 @@
 #include <linux/acpi.h>
 #include <linux/dmi.h>
 
-#include "internal.h"
+#include "../internal.h"
 
 #ifdef CONFIG_DMI
 static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
Signature · 2 lines
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
#5 lore raw

Re: [PATCH v2 3/4] ACPI: x86: Move blacklist to x86 folder

Quoted 6 lines · Kuppuswamy Sathyanarayanan
Quoted 1 line · Andy Shevchenko

blacklist is built solely for x86, move it to the respective folder.

Don't you need #ifdef CONFIG_X86 for acpi_blacklisted() in include/linux/acpi.h

It's unrelated to this series.
It was like that before and this series doesn't change this aspect.

AFAICS the API is called from x86 only, that's why it's not a problem, but strictly speaking you are right. Feel free to submit a patch.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

Re: [PATCH v2 3/4] ACPI: x86: Move blacklist to x86 folder

Quoted 11 lines · Andy Shevchenko
Quoted 4 lines · Kuppuswamy Sathyanarayanan
Quoted 1 line · Andy Shevchenko

blacklist is built solely for x86, move it to the respective folder.

Don't you need #ifdef CONFIG_X86 for acpi_blacklisted() in include/linux/acpi.h

It's unrelated to this series.
It was like that before and this series doesn't change this aspect.

AFAICS the API is called from x86 only, that's why it's not a problem, but strictly speaking you are right. Feel free to submit a patch.

Agree.

Signature · 2 lines
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
#7 lore raw

PATCH v2 4/4 ACPI: x86: Move LPSS to x86 folder

In reply to Andy Shevchenko

LPSS is built solely for x86, move it to the respective folder.

---
 drivers/acpi/Makefile                    | 1 -
 drivers/acpi/internal.h                  | 3 ++-
 drivers/acpi/x86/Makefile                | 1 +
 drivers/acpi/{acpi_lpss.c => x86/lpss.c} | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)
 rename drivers/acpi/{acpi_lpss.c => x86/lpss.c} (99%)
drivers/acpi/Makefile +0 -1
index 6f4187a34f41..39ea5cfa8326 100644
@@ -45,7 +45,6 @@ acpi-y				+= ec.o
 acpi-$(CONFIG_ACPI_DOCK)	+= dock.o
 acpi-$(CONFIG_PCI)		+= pci_root.o pci_link.o pci_irq.o
 obj-$(CONFIG_ACPI_MCFG)		+= pci_mcfg.o
-acpi-$(CONFIG_PCI)		+= acpi_lpss.o
 acpi-y				+= acpi_apd.o
 acpi-y				+= acpi_platform.o
 acpi-y				+= acpi_pnp.o
drivers/acpi/internal.h +2 -1
index ca72a0dc5715..60c483836756 100644
@@ -69,7 +69,8 @@ void acpi_debugfs_init(void);
 #else
 static inline void acpi_debugfs_init(void) { return; }
 #endif
-#ifdef CONFIG_PCI
+
+#if defined(CONFIG_X86) && defined(CONFIG_PCI)
 void acpi_lpss_init(void);
 #else
 static inline void acpi_lpss_init(void) {}
drivers/acpi/x86/Makefile +1 -0
index 1f3c5fa84f9e..63c99509ed9d 100644
@@ -1,6 +1,7 @@
 obj-$(CONFIG_ACPI)	+= acpi-x86.o
 acpi-x86-y		+= apple.o
 acpi-x86-y		+= cmos_rtc.o
+acpi-x86-$(CONFIG_PCI)	+= lpss.o
 acpi-x86-y		+= s2idle.o
 acpi-x86-y		+= utils.o
 
drivers/acpi/x86/lpss.c renamed from drivers/acpi/acpi_lpss.c +1 -1
similarity index 99%
rename from drivers/acpi/acpi_lpss.c
rename to drivers/acpi/x86/lpss.c
index a3d2d94be5c0..148e29c2c526 100644
@@ -25,7 +25,7 @@
 #include <linux/suspend.h>
 #include <linux/delay.h>
 
-#include "internal.h"
+#include "../internal.h"
 
 #ifdef CONFIG_X86_INTEL_LPSS
 
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
Reviewed-by on the v2 series
#8 lore raw
In reply to Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

Move x86 related modules (which are solely for x86) to the dedicated folder.
Note, there are more modules, but they are related to tables and potentially might be used for other architectures in the future. Hence touched only non-table related code.

Except the blacklisted patch Nit, rest looks good to me.

Quoted 22 lines

In v2:
- fixed acpi_lpss_init() stub visibility (LKP)

Andy Shevchenko (4):
ACPI: x86: Introduce a Makefile
ACPI: x86: Move acpi_cmos_rtc to x86 folder
ACPI: x86: Move blacklist to x86 folder
ACPI: x86: Move LPSS to x86 folder

 drivers/acpi/Makefile                            | 7 +------
 drivers/acpi/internal.h                          | 3 ++-
 drivers/acpi/x86/Makefile                        | 8 ++++++++
 drivers/acpi/{ => x86}/blacklist.c               | 2 +-
 drivers/acpi/{acpi_cmos_rtc.c => x86/cmos_rtc.c} | 2 +-
 drivers/acpi/{acpi_lpss.c => x86/lpss.c}         | 2 +-
 6 files changed, 14 insertions(+), 10 deletions(-)
 create mode 100644 drivers/acpi/x86/Makefile
 rename drivers/acpi/{ => x86}/blacklist.c (99%)
 rename drivers/acpi/{acpi_cmos_rtc.c => x86/cmos_rtc.c} (98%)
 rename drivers/acpi/{acpi_lpss.c => x86/lpss.c} (99%)
Signature · 2 lines
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
#9 lore raw
Quoted 9 lines · Kuppuswamy Sathyanarayanan
Quoted 5 lines · Andy Shevchenko

Move x86 related modules (which are solely for x86) to the dedicated folder.
Note, there are more modules, but they are related to tables and potentially might be used for other architectures in the future. Hence touched only non-table related code.

Except the blacklisted patch Nit, rest looks good to me.

Not sure how that related (see my reply).

Quoted 1 line

Thank you!

Signature · 2 lines
With Best Regards,
Andy Shevchenko