Skip to content

Commit 9d6e681

Browse files
committed
Merge tag 'acpi-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These fix issues introduced during this merge window (ACPI/PCI, device enumeration and documentation) and some other ones found recently. Specifics: - Add missing device reference counting to acpi_get_pci_dev() after changing it recently (Rafael Wysocki) - Fix resource list walk in acpi_dma_get_range() (Robin Murphy) - Add IRQ override quirk for LENOVO IdeaPad and extend the IRQ override warning message (Jiri Slaby) - Fix integer overflow in ghes_estatus_pool_init() (Ashish Kalra) - Fix multiple error records handling in one of the ACPI extlog driver code paths (Tony Luck) - Prune DSDT override documentation from index after dropping it (Bagas Sanjaya)" * tag 'acpi-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: scan: Fix DMA range assignment ACPI: PCI: Fix device reference counting in acpi_get_pci_dev() ACPI: resource: note more about IRQ override ACPI: resource: do IRQ override on LENOVO IdeaPad ACPI: extlog: Handle multiple records ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() Documentation: ACPI: Prune DSDT override documentation from index
2 parents ec4cf5d + 3f8deab commit 9d6e681

File tree

7 files changed

+60
-35
lines changed

7 files changed

+60
-35
lines changed

Documentation/admin-guide/acpi/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ the Linux ACPI support.
99
:maxdepth: 1
1010

1111
initrd_table_override
12-
dsdt-override
1312
ssdt-overlays
1413
cppc_sysfs
1514
fan_performance_states

drivers/acpi/acpi_extlog.c

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/ratelimit.h>
1313
#include <linux/edac.h>
1414
#include <linux/ras.h>
15+
#include <acpi/ghes.h>
1516
#include <asm/cpu.h>
1617
#include <asm/mce.h>
1718

@@ -138,8 +139,8 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
138139
int cpu = mce->extcpu;
139140
struct acpi_hest_generic_status *estatus, *tmp;
140141
struct acpi_hest_generic_data *gdata;
141-
const guid_t *fru_id = &guid_null;
142-
char *fru_text = "";
142+
const guid_t *fru_id;
143+
char *fru_text;
143144
guid_t *sec_type;
144145
static u32 err_seq;
145146

@@ -160,17 +161,23 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
160161

161162
/* log event via trace */
162163
err_seq++;
163-
gdata = (struct acpi_hest_generic_data *)(tmp + 1);
164-
if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
165-
fru_id = (guid_t *)gdata->fru_id;
166-
if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
167-
fru_text = gdata->fru_text;
168-
sec_type = (guid_t *)gdata->section_type;
169-
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
170-
struct cper_sec_mem_err *mem = (void *)(gdata + 1);
171-
if (gdata->error_data_length >= sizeof(*mem))
172-
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
173-
(u8)gdata->error_severity);
164+
apei_estatus_for_each_section(tmp, gdata) {
165+
if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
166+
fru_id = (guid_t *)gdata->fru_id;
167+
else
168+
fru_id = &guid_null;
169+
if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
170+
fru_text = gdata->fru_text;
171+
else
172+
fru_text = "";
173+
sec_type = (guid_t *)gdata->section_type;
174+
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
175+
struct cper_sec_mem_err *mem = (void *)(gdata + 1);
176+
177+
if (gdata->error_data_length >= sizeof(*mem))
178+
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
179+
(u8)gdata->error_severity);
180+
}
174181
}
175182

176183
out:

drivers/acpi/apei/ghes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx)
163163
clear_fixmap(fixmap_idx);
164164
}
165165

166-
int ghes_estatus_pool_init(int num_ghes)
166+
int ghes_estatus_pool_init(unsigned int num_ghes)
167167
{
168168
unsigned long addr, len;
169169
int rc;

drivers/acpi/pci_root.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
323323

324324
list_for_each_entry(pn, &adev->physical_node_list, node) {
325325
if (dev_is_pci(pn->dev)) {
326+
get_device(pn->dev);
326327
pci_dev = to_pci_dev(pn->dev);
327328
break;
328329
}

drivers/acpi/resource.c

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -428,24 +428,49 @@ static const struct dmi_system_id asus_laptop[] = {
428428
{ }
429429
};
430430

431+
static const struct dmi_system_id lenovo_82ra[] = {
432+
{
433+
.ident = "LENOVO IdeaPad Flex 5 16ALC7",
434+
.matches = {
435+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
436+
DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
437+
},
438+
},
439+
{ }
440+
};
441+
431442
struct irq_override_cmp {
432443
const struct dmi_system_id *system;
433444
unsigned char irq;
434445
unsigned char triggering;
435446
unsigned char polarity;
436447
unsigned char shareable;
448+
bool override;
437449
};
438450

439-
static const struct irq_override_cmp skip_override_table[] = {
440-
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
441-
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
451+
static const struct irq_override_cmp override_table[] = {
452+
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
453+
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
454+
{ lenovo_82ra, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
455+
{ lenovo_82ra, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
442456
};
443457

444458
static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
445459
u8 shareable)
446460
{
447461
int i;
448462

463+
for (i = 0; i < ARRAY_SIZE(override_table); i++) {
464+
const struct irq_override_cmp *entry = &override_table[i];
465+
466+
if (dmi_check_system(entry->system) &&
467+
entry->irq == gsi &&
468+
entry->triggering == triggering &&
469+
entry->polarity == polarity &&
470+
entry->shareable == shareable)
471+
return entry->override;
472+
}
473+
449474
#ifdef CONFIG_X86
450475
/*
451476
* IRQ override isn't needed on modern AMD Zen systems and
@@ -456,17 +481,6 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
456481
return false;
457482
#endif
458483

459-
for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) {
460-
const struct irq_override_cmp *entry = &skip_override_table[i];
461-
462-
if (dmi_check_system(entry->system) &&
463-
entry->irq == gsi &&
464-
entry->triggering == triggering &&
465-
entry->polarity == polarity &&
466-
entry->shareable == shareable)
467-
return false;
468-
}
469-
470484
return true;
471485
}
472486

@@ -498,8 +512,11 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
498512
u8 pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
499513

500514
if (triggering != trig || polarity != pol) {
501-
pr_warn("ACPI: IRQ %d override to %s, %s\n", gsi,
502-
t ? "level" : "edge", p ? "low" : "high");
515+
pr_warn("ACPI: IRQ %d override to %s%s, %s%s\n", gsi,
516+
t ? "level" : "edge",
517+
trig == triggering ? "" : "(!)",
518+
p ? "low" : "high",
519+
pol == polarity ? "" : "(!)");
503520
triggering = trig;
504521
polarity = pol;
505522
}

drivers/acpi/scan.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,9 +1509,12 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map)
15091509
goto out;
15101510
}
15111511

1512+
*map = r;
1513+
15121514
list_for_each_entry(rentry, &list, node) {
15131515
if (rentry->res->start >= rentry->res->end) {
1514-
kfree(r);
1516+
kfree(*map);
1517+
*map = NULL;
15151518
ret = -EINVAL;
15161519
dev_dbg(dma_dev, "Invalid DMA regions configuration\n");
15171520
goto out;
@@ -1523,8 +1526,6 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map)
15231526
r->offset = rentry->offset;
15241527
r++;
15251528
}
1526-
1527-
*map = r;
15281529
}
15291530
out:
15301531
acpi_dev_free_resource_list(&list);

include/acpi/ghes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int ghes_register_vendor_record_notifier(struct notifier_block *nb);
7171
void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
7272
#endif
7373

74-
int ghes_estatus_pool_init(int num_ghes);
74+
int ghes_estatus_pool_init(unsigned int num_ghes);
7575

7676
/* From drivers/edac/ghes_edac.c */
7777

0 commit comments

Comments
 (0)