Skip to content

Commit ca86ab5

Browse files
committed
Merge branches 'acpi-resource', 'acpi-property' and 'acpi-numa'
Make ACPI resource management quirks, a documentation update related to the ACPI handling of device properties and ACPI NUMA handling changes for 6.10: - Add ACPI IRQ override quirks for Asus Vivobook Pro N6506MV, TongFang GXxHRXx and GMxHGxx, and XMG APEX 17 M23 (Guenter Schafranek, Tamim Khan, Christoffer Sandberg). - Add reference to UEFI DSD Guide to the documentation related to the ACPI handling of device properties (Sakari Ailus). - Fix SRAT lookup of CFMWS ranges with numa_fill_memblks(), remove lefover architecture-dependent code from the ACPI NUMA handling code and simplify it on top of that (Robert Richter). * acpi-resource: ACPI: resource: Skip IRQ override on Asus Vivobook Pro N6506MV ACPI: resource: Do IRQ override on TongFang GXxHRXx and GMxHGxx ACPI: resource: Do IRQ override on GMxBGxx (XMG APEX 17 M23) * acpi-property: ACPI: property: Add reference to UEFI DSD Guide * acpi-numa: ACPI/NUMA: Squash acpi_numa_memory_affinity_init() into acpi_parse_memory_affinity() ACPI/NUMA: Squash acpi_numa_slit_init() into acpi_parse_slit() ACPI/NUMA: Remove architecture dependent remainings x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks()
4 parents 784cf44 + 7c52c70 + 49c192d + 57ba79e commit ca86ab5

File tree

7 files changed

+68
-68
lines changed

7 files changed

+68
-68
lines changed

arch/x86/include/asm/sparsemem.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ extern int phys_to_target_node(phys_addr_t start);
3737
#define phys_to_target_node phys_to_target_node
3838
extern int memory_add_physaddr_to_nid(u64 start);
3939
#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
40-
extern int numa_fill_memblks(u64 start, u64 end);
41-
#define numa_fill_memblks numa_fill_memblks
4240
#endif
4341
#endif /* __ASSEMBLY__ */
4442

arch/x86/mm/numa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ int memory_add_physaddr_to_nid(u64 start)
929929
}
930930
EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
931931

932+
#endif
933+
932934
static int __init cmp_memblk(const void *a, const void *b)
933935
{
934936
const struct numa_memblk *ma = *(const struct numa_memblk **)a;
@@ -1001,5 +1003,3 @@ int __init numa_fill_memblks(u64 start, u64 end)
10011003
}
10021004
return 0;
10031005
}
1004-
1005-
#endif

drivers/acpi/numa/srat.c

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,26 @@ int __init srat_disabled(void)
208208
return acpi_numa < 0;
209209
}
210210

211-
#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
211+
__weak int __init numa_fill_memblks(u64 start, u64 end)
212+
{
213+
return NUMA_NO_MEMBLK;
214+
}
215+
212216
/*
213217
* Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for
214218
* I/O localities since SRAT does not list them. I/O localities are
215219
* not supported at this point.
216220
*/
217-
void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
221+
static int __init acpi_parse_slit(struct acpi_table_header *table)
218222
{
223+
struct acpi_table_slit *slit = (struct acpi_table_slit *)table;
219224
int i, j;
220225

226+
if (!slit_valid(slit)) {
227+
pr_info("SLIT table looks invalid. Not used.\n");
228+
return -EINVAL;
229+
}
230+
221231
for (i = 0; i < slit->locality_count; i++) {
222232
const int from_node = pxm_to_node(i);
223233

@@ -234,28 +244,34 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
234244
slit->entry[slit->locality_count * i + j]);
235245
}
236246
}
247+
248+
return 0;
237249
}
238250

239-
/*
240-
* Default callback for parsing of the Proximity Domain <-> Memory
241-
* Area mappings
242-
*/
243-
int __init
244-
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
251+
static int parsed_numa_memblks __initdata;
252+
253+
static int __init
254+
acpi_parse_memory_affinity(union acpi_subtable_headers *header,
255+
const unsigned long table_end)
245256
{
257+
struct acpi_srat_mem_affinity *ma;
246258
u64 start, end;
247259
u32 hotpluggable;
248260
int node, pxm;
249261

262+
ma = (struct acpi_srat_mem_affinity *)header;
263+
264+
acpi_table_print_srat_entry(&header->common);
265+
250266
if (srat_disabled())
251-
goto out_err;
267+
return 0;
252268
if (ma->header.length < sizeof(struct acpi_srat_mem_affinity)) {
253269
pr_err("SRAT: Unexpected header length: %d\n",
254270
ma->header.length);
255271
goto out_err_bad_srat;
256272
}
257273
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
258-
goto out_err;
274+
return 0;
259275
hotpluggable = IS_ENABLED(CONFIG_MEMORY_HOTPLUG) &&
260276
(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE);
261277

@@ -293,11 +309,15 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
293309

294310
max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1));
295311

312+
parsed_numa_memblks++;
313+
296314
return 0;
315+
297316
out_err_bad_srat:
317+
/* Just disable SRAT, but do not fail and ignore errors. */
298318
bad_srat();
299-
out_err:
300-
return -EINVAL;
319+
320+
return 0;
301321
}
302322

303323
static int __init acpi_parse_cfmws(union acpi_subtable_headers *header,
@@ -340,26 +360,6 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header,
340360
(*fake_pxm)++;
341361
return 0;
342362
}
343-
#else
344-
static int __init acpi_parse_cfmws(union acpi_subtable_headers *header,
345-
void *arg, const unsigned long table_end)
346-
{
347-
return 0;
348-
}
349-
#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */
350-
351-
static int __init acpi_parse_slit(struct acpi_table_header *table)
352-
{
353-
struct acpi_table_slit *slit = (struct acpi_table_slit *)table;
354-
355-
if (!slit_valid(slit)) {
356-
pr_info("SLIT table looks invalid. Not used.\n");
357-
return -EINVAL;
358-
}
359-
acpi_numa_slit_init(slit);
360-
361-
return 0;
362-
}
363363

364364
void __init __weak
365365
acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
@@ -450,24 +450,6 @@ acpi_parse_gi_affinity(union acpi_subtable_headers *header,
450450
}
451451
#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */
452452

453-
static int __initdata parsed_numa_memblks;
454-
455-
static int __init
456-
acpi_parse_memory_affinity(union acpi_subtable_headers * header,
457-
const unsigned long end)
458-
{
459-
struct acpi_srat_mem_affinity *memory_affinity;
460-
461-
memory_affinity = (struct acpi_srat_mem_affinity *)header;
462-
463-
acpi_table_print_srat_entry(&header->common);
464-
465-
/* let architecture-dependent part to do it */
466-
if (!acpi_numa_memory_affinity_init(memory_affinity))
467-
parsed_numa_memblks++;
468-
return 0;
469-
}
470-
471453
static int __init acpi_parse_srat(struct acpi_table_header *table)
472454
{
473455
struct acpi_table_srat *srat = (struct acpi_table_srat *)table;

drivers/acpi/property.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ static int acpi_data_get_property_array(const struct acpi_device_data *data,
3131
* not defined without a warning. For instance if any of the properties
3232
* from different GUID appear in a property list of another, it will be
3333
* accepted by the kernel. Firmware validation tools should catch these.
34+
*
35+
* References:
36+
*
37+
* [1] UEFI DSD Guide.
38+
* https://github.com/UEFI/DSD-Guide/blob/main/src/dsd-guide.adoc
3439
*/
3540
static const guid_t prp_guids[] = {
36-
/* ACPI _DSD device properties GUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */
41+
/* ACPI _DSD device properties GUID [1]: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */
3742
GUID_INIT(0xdaffd814, 0x6eba, 0x4d8c,
3843
0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01),
3944
/* Hotplug in D3 GUID: 6211e2c0-58a3-4af3-90e1-927a4e0c55a4 */
@@ -53,12 +58,12 @@ static const guid_t prp_guids[] = {
5358
0xa5, 0x61, 0x99, 0xa5, 0x18, 0x97, 0x62, 0xd0),
5459
};
5560

56-
/* ACPI _DSD data subnodes GUID: dbb8e3e6-5886-4ba6-8795-1319f52a966b */
61+
/* ACPI _DSD data subnodes GUID [1]: dbb8e3e6-5886-4ba6-8795-1319f52a966b */
5762
static const guid_t ads_guid =
5863
GUID_INIT(0xdbb8e3e6, 0x5886, 0x4ba6,
5964
0x87, 0x95, 0x13, 0x19, 0xf5, 0x2a, 0x96, 0x6b);
6065

61-
/* ACPI _DSD data buffer GUID: edb12dd0-363d-4085-a3d2-49522ca160c4 */
66+
/* ACPI _DSD data buffer GUID [1]: edb12dd0-363d-4085-a3d2-49522ca160c4 */
6267
static const guid_t buffer_prop_guid =
6368
GUID_INIT(0xedb12dd0, 0x363d, 0x4085,
6469
0xa3, 0xd2, 0x49, 0x52, 0x2c, 0xa1, 0x60, 0xc4);

drivers/acpi/resource.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
517517
DMI_MATCH(DMI_BOARD_NAME, "E1504GAB"),
518518
},
519519
},
520+
{
521+
/* Asus Vivobook Pro N6506MV */
522+
.matches = {
523+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
524+
DMI_MATCH(DMI_BOARD_NAME, "N6506MV"),
525+
},
526+
},
520527
{
521528
/* LG Electronics 17U70P */
522529
.matches = {
@@ -533,6 +540,12 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
533540
* to have a working keyboard.
534541
*/
535542
static const struct dmi_system_id irq1_edge_low_force_override[] = {
543+
{
544+
/* XMG APEX 17 (M23) */
545+
.matches = {
546+
DMI_MATCH(DMI_BOARD_NAME, "GMxBGxx"),
547+
},
548+
},
536549
{
537550
/* TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD */
538551
.matches = {
@@ -630,6 +643,18 @@ static const struct dmi_system_id irq1_edge_low_force_override[] = {
630643
DMI_MATCH(DMI_BOARD_NAME, "X565"),
631644
},
632645
},
646+
{
647+
/* TongFang GXxHRXx/TUXEDO InfinityBook Pro Gen9 AMD */
648+
.matches = {
649+
DMI_MATCH(DMI_BOARD_NAME, "GXxHRXx"),
650+
},
651+
},
652+
{
653+
/* TongFang GMxHGxx/TUXEDO Stellaris Slim Gen1 AMD */
654+
.matches = {
655+
DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"),
656+
},
657+
},
633658
{ }
634659
};
635660

include/linux/acpi.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ static inline bool acpi_gicc_is_usable(struct acpi_madt_generic_interrupt *gicc)
242242
return gicc->flags & ACPI_MADT_ENABLED;
243243
}
244244

245-
/* the following numa functions are architecture-dependent */
246-
void acpi_numa_slit_init (struct acpi_table_slit *slit);
247-
248245
#if defined(CONFIG_X86) || defined(CONFIG_LOONGARCH)
249246
void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
250247
#else
@@ -267,8 +264,6 @@ static inline void
267264
acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { }
268265
#endif
269266

270-
int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
271-
272267
#ifndef PHYS_CPUID_INVALID
273268
typedef u32 phys_cpuid_t;
274269
#define PHYS_CPUID_INVALID (phys_cpuid_t)(-1)

include/linux/numa.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ int memory_add_physaddr_to_nid(u64 start);
3636
int phys_to_target_node(u64 start);
3737
#endif
3838

39-
#ifndef numa_fill_memblks
40-
static inline int __init numa_fill_memblks(u64 start, u64 end)
41-
{
42-
return NUMA_NO_MEMBLK;
43-
}
44-
#endif
39+
int numa_fill_memblks(u64 start, u64 end);
4540

4641
#else /* !CONFIG_NUMA */
4742
static inline int numa_nearest_node(int node, unsigned int state)

0 commit comments

Comments
 (0)