Skip to content

Commit 5f487cd

Browse files
committed
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
2 parents e76f69b + 801549e commit 5f487cd

File tree

7 files changed

+23
-29
lines changed

7 files changed

+23
-29
lines changed

arch/x86/hyperv/hv_vtl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ void __init hv_vtl_init_platform(void)
3434
/* Avoid searching for BIOS MP tables */
3535
x86_init.mpparse.find_mptable = x86_init_noop;
3636
x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;
37-
x86_init.mpparse.parse_smp_cfg = x86_init_noop;
3837

3938
x86_platform.get_wallclock = get_rtc_noop;
4039
x86_platform.set_wallclock = set_rtc_noop;

arch/x86/include/asm/prom.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,14 @@ extern int of_ioapic;
2323
extern u64 initial_dtb;
2424
extern void add_dtb(u64 data);
2525
void x86_of_pci_init(void);
26-
void x86_dtb_parse_smp_config(void);
26+
void x86_flattree_get_config(void);
2727
#else
2828
static inline void add_dtb(u64 data) { }
2929
static inline void x86_of_pci_init(void) { }
30-
static inline void x86_dtb_parse_smp_config(void) { }
30+
static inline void x86_flattree_get_config(void) { }
3131
#define of_ioapic 0
3232
#endif
3333

34-
#ifdef CONFIG_OF_EARLY_FLATTREE
35-
void x86_flattree_get_config(void);
36-
#else
37-
static inline void x86_flattree_get_config(void) { }
38-
#endif
3934
extern char cmd_line[COMMAND_LINE_SIZE];
4035

4136
#endif /* __ASSEMBLY__ */

arch/x86/kernel/devicetree.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <asm/pci_x86.h>
2525
#include <asm/setup.h>
2626
#include <asm/i8259.h>
27+
#include <asm/numa.h>
2728
#include <asm/prom.h>
2829

2930
__initdata u64 initial_dtb;
@@ -137,6 +138,7 @@ static void __init dtb_cpu_setup(void)
137138
continue;
138139
}
139140
topology_register_apic(apic_id, CPU_ACPIID_INVALID, true);
141+
set_apicid_to_node(apic_id, of_node_to_nid(dn));
140142
}
141143
}
142144

@@ -277,9 +279,18 @@ static void __init dtb_apic_setup(void)
277279
dtb_ioapic_setup();
278280
}
279281

280-
#ifdef CONFIG_OF_EARLY_FLATTREE
282+
static void __init x86_dtb_parse_smp_config(void)
283+
{
284+
if (!of_have_populated_dt())
285+
return;
286+
287+
dtb_setup_hpet();
288+
dtb_apic_setup();
289+
}
290+
281291
void __init x86_flattree_get_config(void)
282292
{
293+
#ifdef CONFIG_OF_EARLY_FLATTREE
283294
u32 size, map_len;
284295
void *dt;
285296

@@ -301,14 +312,7 @@ void __init x86_flattree_get_config(void)
301312

302313
if (initial_dtb)
303314
early_memunmap(dt, map_len);
304-
}
305315
#endif
306-
307-
void __init x86_dtb_parse_smp_config(void)
308-
{
309-
if (!of_have_populated_dt())
310-
return;
311-
312-
dtb_setup_hpet();
313-
dtb_apic_setup();
316+
if (of_have_populated_dt())
317+
x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
314318
}

arch/x86/platform/ce4100/ce4100.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ void __init x86_ce4100_early_setup(void)
139139
x86_init.resources.probe_roms = x86_init_noop;
140140
x86_init.mpparse.find_mptable = x86_init_noop;
141141
x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;
142-
x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
143142
x86_init.pci.init = ce4100_pci_init;
144143
x86_init.pci.init_irq = sdv_pci_init;
145144

arch/x86/platform/iris/iris.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,18 @@ static int iris_probe(struct platform_device *pdev)
6262
return 0;
6363
}
6464

65-
static int iris_remove(struct platform_device *pdev)
65+
static void iris_remove(struct platform_device *pdev)
6666
{
6767
pm_power_off = old_pm_power_off;
6868
printk(KERN_INFO "Iris power_off handler uninstalled.\n");
69-
return 0;
7069
}
7170

7271
static struct platform_driver iris_driver = {
7372
.driver = {
7473
.name = "iris",
7574
},
7675
.probe = iris_probe,
77-
.remove = iris_remove,
76+
.remove_new = iris_remove,
7877
};
7978

8079
static struct resource iris_resources[] = {

arch/x86/platform/olpc/olpc-xo1-pm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,31 +144,30 @@ static int xo1_pm_probe(struct platform_device *pdev)
144144
return 0;
145145
}
146146

147-
static int xo1_pm_remove(struct platform_device *pdev)
147+
static void xo1_pm_remove(struct platform_device *pdev)
148148
{
149149
if (strcmp(pdev->name, "cs5535-pms") == 0)
150150
pms_base = 0;
151151
else if (strcmp(pdev->name, "olpc-xo1-pm-acpi") == 0)
152152
acpi_base = 0;
153153

154154
pm_power_off = NULL;
155-
return 0;
156155
}
157156

158157
static struct platform_driver cs5535_pms_driver = {
159158
.driver = {
160159
.name = "cs5535-pms",
161160
},
162161
.probe = xo1_pm_probe,
163-
.remove = xo1_pm_remove,
162+
.remove_new = xo1_pm_remove,
164163
};
165164

166165
static struct platform_driver cs5535_acpi_driver = {
167166
.driver = {
168167
.name = "olpc-xo1-pm-acpi",
169168
},
170169
.probe = xo1_pm_probe,
171-
.remove = xo1_pm_remove,
170+
.remove_new = xo1_pm_remove,
172171
};
173172

174173
static int __init xo1_pm_init(void)

arch/x86/platform/olpc/olpc-xo1-sci.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ static int xo1_sci_probe(struct platform_device *pdev)
598598
return r;
599599
}
600600

601-
static int xo1_sci_remove(struct platform_device *pdev)
601+
static void xo1_sci_remove(struct platform_device *pdev)
602602
{
603603
free_irq(sci_irq, pdev);
604604
cancel_work_sync(&sci_work);
@@ -608,7 +608,6 @@ static int xo1_sci_remove(struct platform_device *pdev)
608608
free_ebook_switch();
609609
free_power_button();
610610
acpi_base = 0;
611-
return 0;
612611
}
613612

614613
static struct platform_driver xo1_sci_driver = {
@@ -617,7 +616,7 @@ static struct platform_driver xo1_sci_driver = {
617616
.dev_groups = lid_groups,
618617
},
619618
.probe = xo1_sci_probe,
620-
.remove = xo1_sci_remove,
619+
.remove_new = xo1_sci_remove,
621620
.suspend = xo1_sci_suspend,
622621
.resume = xo1_sci_resume,
623622
};

0 commit comments

Comments
 (0)