Commit 5f487cd8 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'x86-platform-2024-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 platform updates from Ingo Molnar:

 - Improve the DeviceTree (OF) NUMA enumeration code to address
   kernel warnings & mis-mappings on DeviceTree platforms

 - Migrate x86 platform drivers to the .remove_new callback API

 - Misc cleanups & fixes

* tag 'x86-platform-2024-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/platform/olpc-xo1-sci: Convert to platform remove callback returning void
  x86/platform/olpc-x01-pm: Convert to platform remove callback returning void
  x86/platform/iris: Convert to platform remove callback returning void
  x86/of: Change x86_dtb_parse_smp_config() to static
  x86/of: Map NUMA node to CPUs as per DeviceTree
  x86/of: Set the parse_smp_cfg for all the DeviceTree platforms by default
  x86/hyperv/vtl: Correct x86_init.mpparse.parse_smp_cfg assignment
parents e76f69b9 801549ed
...@@ -34,7 +34,6 @@ void __init hv_vtl_init_platform(void) ...@@ -34,7 +34,6 @@ void __init hv_vtl_init_platform(void)
/* Avoid searching for BIOS MP tables */ /* Avoid searching for BIOS MP tables */
x86_init.mpparse.find_mptable = x86_init_noop; x86_init.mpparse.find_mptable = x86_init_noop;
x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;
x86_init.mpparse.parse_smp_cfg = x86_init_noop;
x86_platform.get_wallclock = get_rtc_noop; x86_platform.get_wallclock = get_rtc_noop;
x86_platform.set_wallclock = set_rtc_noop; x86_platform.set_wallclock = set_rtc_noop;
......
...@@ -23,19 +23,14 @@ extern int of_ioapic; ...@@ -23,19 +23,14 @@ extern int of_ioapic;
extern u64 initial_dtb; extern u64 initial_dtb;
extern void add_dtb(u64 data); extern void add_dtb(u64 data);
void x86_of_pci_init(void); void x86_of_pci_init(void);
void x86_dtb_parse_smp_config(void); void x86_flattree_get_config(void);
#else #else
static inline void add_dtb(u64 data) { } static inline void add_dtb(u64 data) { }
static inline void x86_of_pci_init(void) { } static inline void x86_of_pci_init(void) { }
static inline void x86_dtb_parse_smp_config(void) { } static inline void x86_flattree_get_config(void) { }
#define of_ioapic 0 #define of_ioapic 0
#endif #endif
#ifdef CONFIG_OF_EARLY_FLATTREE
void x86_flattree_get_config(void);
#else
static inline void x86_flattree_get_config(void) { }
#endif
extern char cmd_line[COMMAND_LINE_SIZE]; extern char cmd_line[COMMAND_LINE_SIZE];
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/pci_x86.h> #include <asm/pci_x86.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/i8259.h> #include <asm/i8259.h>
#include <asm/numa.h>
#include <asm/prom.h> #include <asm/prom.h>
__initdata u64 initial_dtb; __initdata u64 initial_dtb;
...@@ -137,6 +138,7 @@ static void __init dtb_cpu_setup(void) ...@@ -137,6 +138,7 @@ static void __init dtb_cpu_setup(void)
continue; continue;
} }
topology_register_apic(apic_id, CPU_ACPIID_INVALID, true); topology_register_apic(apic_id, CPU_ACPIID_INVALID, true);
set_apicid_to_node(apic_id, of_node_to_nid(dn));
} }
} }
...@@ -277,9 +279,18 @@ static void __init dtb_apic_setup(void) ...@@ -277,9 +279,18 @@ static void __init dtb_apic_setup(void)
dtb_ioapic_setup(); dtb_ioapic_setup();
} }
#ifdef CONFIG_OF_EARLY_FLATTREE static void __init x86_dtb_parse_smp_config(void)
{
if (!of_have_populated_dt())
return;
dtb_setup_hpet();
dtb_apic_setup();
}
void __init x86_flattree_get_config(void) void __init x86_flattree_get_config(void)
{ {
#ifdef CONFIG_OF_EARLY_FLATTREE
u32 size, map_len; u32 size, map_len;
void *dt; void *dt;
...@@ -301,14 +312,7 @@ void __init x86_flattree_get_config(void) ...@@ -301,14 +312,7 @@ void __init x86_flattree_get_config(void)
if (initial_dtb) if (initial_dtb)
early_memunmap(dt, map_len); early_memunmap(dt, map_len);
}
#endif #endif
if (of_have_populated_dt())
void __init x86_dtb_parse_smp_config(void) x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
{
if (!of_have_populated_dt())
return;
dtb_setup_hpet();
dtb_apic_setup();
} }
...@@ -139,7 +139,6 @@ void __init x86_ce4100_early_setup(void) ...@@ -139,7 +139,6 @@ void __init x86_ce4100_early_setup(void)
x86_init.resources.probe_roms = x86_init_noop; x86_init.resources.probe_roms = x86_init_noop;
x86_init.mpparse.find_mptable = x86_init_noop; x86_init.mpparse.find_mptable = x86_init_noop;
x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;
x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
x86_init.pci.init = ce4100_pci_init; x86_init.pci.init = ce4100_pci_init;
x86_init.pci.init_irq = sdv_pci_init; x86_init.pci.init_irq = sdv_pci_init;
......
...@@ -62,11 +62,10 @@ static int iris_probe(struct platform_device *pdev) ...@@ -62,11 +62,10 @@ static int iris_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int iris_remove(struct platform_device *pdev) static void iris_remove(struct platform_device *pdev)
{ {
pm_power_off = old_pm_power_off; pm_power_off = old_pm_power_off;
printk(KERN_INFO "Iris power_off handler uninstalled.\n"); printk(KERN_INFO "Iris power_off handler uninstalled.\n");
return 0;
} }
static struct platform_driver iris_driver = { static struct platform_driver iris_driver = {
...@@ -74,7 +73,7 @@ static struct platform_driver iris_driver = { ...@@ -74,7 +73,7 @@ static struct platform_driver iris_driver = {
.name = "iris", .name = "iris",
}, },
.probe = iris_probe, .probe = iris_probe,
.remove = iris_remove, .remove_new = iris_remove,
}; };
static struct resource iris_resources[] = { static struct resource iris_resources[] = {
......
...@@ -144,7 +144,7 @@ static int xo1_pm_probe(struct platform_device *pdev) ...@@ -144,7 +144,7 @@ static int xo1_pm_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int xo1_pm_remove(struct platform_device *pdev) static void xo1_pm_remove(struct platform_device *pdev)
{ {
if (strcmp(pdev->name, "cs5535-pms") == 0) if (strcmp(pdev->name, "cs5535-pms") == 0)
pms_base = 0; pms_base = 0;
...@@ -152,7 +152,6 @@ static int xo1_pm_remove(struct platform_device *pdev) ...@@ -152,7 +152,6 @@ static int xo1_pm_remove(struct platform_device *pdev)
acpi_base = 0; acpi_base = 0;
pm_power_off = NULL; pm_power_off = NULL;
return 0;
} }
static struct platform_driver cs5535_pms_driver = { static struct platform_driver cs5535_pms_driver = {
...@@ -160,7 +159,7 @@ static struct platform_driver cs5535_pms_driver = { ...@@ -160,7 +159,7 @@ static struct platform_driver cs5535_pms_driver = {
.name = "cs5535-pms", .name = "cs5535-pms",
}, },
.probe = xo1_pm_probe, .probe = xo1_pm_probe,
.remove = xo1_pm_remove, .remove_new = xo1_pm_remove,
}; };
static struct platform_driver cs5535_acpi_driver = { static struct platform_driver cs5535_acpi_driver = {
...@@ -168,7 +167,7 @@ static struct platform_driver cs5535_acpi_driver = { ...@@ -168,7 +167,7 @@ static struct platform_driver cs5535_acpi_driver = {
.name = "olpc-xo1-pm-acpi", .name = "olpc-xo1-pm-acpi",
}, },
.probe = xo1_pm_probe, .probe = xo1_pm_probe,
.remove = xo1_pm_remove, .remove_new = xo1_pm_remove,
}; };
static int __init xo1_pm_init(void) static int __init xo1_pm_init(void)
......
...@@ -598,7 +598,7 @@ static int xo1_sci_probe(struct platform_device *pdev) ...@@ -598,7 +598,7 @@ static int xo1_sci_probe(struct platform_device *pdev)
return r; return r;
} }
static int xo1_sci_remove(struct platform_device *pdev) static void xo1_sci_remove(struct platform_device *pdev)
{ {
free_irq(sci_irq, pdev); free_irq(sci_irq, pdev);
cancel_work_sync(&sci_work); cancel_work_sync(&sci_work);
...@@ -608,7 +608,6 @@ static int xo1_sci_remove(struct platform_device *pdev) ...@@ -608,7 +608,6 @@ static int xo1_sci_remove(struct platform_device *pdev)
free_ebook_switch(); free_ebook_switch();
free_power_button(); free_power_button();
acpi_base = 0; acpi_base = 0;
return 0;
} }
static struct platform_driver xo1_sci_driver = { static struct platform_driver xo1_sci_driver = {
...@@ -617,7 +616,7 @@ static struct platform_driver xo1_sci_driver = { ...@@ -617,7 +616,7 @@ static struct platform_driver xo1_sci_driver = {
.dev_groups = lid_groups, .dev_groups = lid_groups,
}, },
.probe = xo1_sci_probe, .probe = xo1_sci_probe,
.remove = xo1_sci_remove, .remove_new = xo1_sci_remove,
.suspend = xo1_sci_suspend, .suspend = xo1_sci_suspend,
.resume = xo1_sci_resume, .resume = xo1_sci_resume,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment