提交 3f8deab6 编写于 作者: R Rafael J. Wysocki

Merge branches 'acpi-scan', 'acpi-resource', 'acpi-apei', 'acpi-extlog' and 'acpi-docs'

Merge assorted ACPI fixes for 6.1-rc2:

 - 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).

* acpi-scan:
  ACPI: scan: Fix DMA range assignment

* acpi-resource:
  ACPI: resource: note more about IRQ override
  ACPI: resource: do IRQ override on LENOVO IdeaPad

* acpi-apei:
  ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init()

* acpi-extlog:
  ACPI: extlog: Handle multiple records

* acpi-docs:
  Documentation: ACPI: Prune DSDT override documentation from index
...@@ -9,7 +9,6 @@ the Linux ACPI support. ...@@ -9,7 +9,6 @@ the Linux ACPI support.
:maxdepth: 1 :maxdepth: 1
initrd_table_override initrd_table_override
dsdt-override
ssdt-overlays ssdt-overlays
cppc_sysfs cppc_sysfs
fan_performance_states fan_performance_states
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
#include <linux/edac.h> #include <linux/edac.h>
#include <linux/ras.h> #include <linux/ras.h>
#include <acpi/ghes.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/mce.h> #include <asm/mce.h>
...@@ -138,8 +139,8 @@ static int extlog_print(struct notifier_block *nb, unsigned long val, ...@@ -138,8 +139,8 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
int cpu = mce->extcpu; int cpu = mce->extcpu;
struct acpi_hest_generic_status *estatus, *tmp; struct acpi_hest_generic_status *estatus, *tmp;
struct acpi_hest_generic_data *gdata; struct acpi_hest_generic_data *gdata;
const guid_t *fru_id = &guid_null; const guid_t *fru_id;
char *fru_text = ""; char *fru_text;
guid_t *sec_type; guid_t *sec_type;
static u32 err_seq; static u32 err_seq;
...@@ -160,17 +161,23 @@ static int extlog_print(struct notifier_block *nb, unsigned long val, ...@@ -160,17 +161,23 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
/* log event via trace */ /* log event via trace */
err_seq++; err_seq++;
gdata = (struct acpi_hest_generic_data *)(tmp + 1); apei_estatus_for_each_section(tmp, gdata) {
if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID) if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID)
fru_id = (guid_t *)gdata->fru_id; fru_id = (guid_t *)gdata->fru_id;
if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT) else
fru_text = gdata->fru_text; fru_id = &guid_null;
sec_type = (guid_t *)gdata->section_type; if (gdata->validation_bits & CPER_SEC_VALID_FRU_TEXT)
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) { fru_text = gdata->fru_text;
struct cper_sec_mem_err *mem = (void *)(gdata + 1); else
if (gdata->error_data_length >= sizeof(*mem)) fru_text = "";
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text, sec_type = (guid_t *)gdata->section_type;
(u8)gdata->error_severity); if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
struct cper_sec_mem_err *mem = (void *)(gdata + 1);
if (gdata->error_data_length >= sizeof(*mem))
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
(u8)gdata->error_severity);
}
} }
out: out:
......
...@@ -163,7 +163,7 @@ static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx) ...@@ -163,7 +163,7 @@ static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx)
clear_fixmap(fixmap_idx); clear_fixmap(fixmap_idx);
} }
int ghes_estatus_pool_init(int num_ghes) int ghes_estatus_pool_init(unsigned int num_ghes)
{ {
unsigned long addr, len; unsigned long addr, len;
int rc; int rc;
......
...@@ -428,17 +428,31 @@ static const struct dmi_system_id asus_laptop[] = { ...@@ -428,17 +428,31 @@ static const struct dmi_system_id asus_laptop[] = {
{ } { }
}; };
static const struct dmi_system_id lenovo_82ra[] = {
{
.ident = "LENOVO IdeaPad Flex 5 16ALC7",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
},
},
{ }
};
struct irq_override_cmp { struct irq_override_cmp {
const struct dmi_system_id *system; const struct dmi_system_id *system;
unsigned char irq; unsigned char irq;
unsigned char triggering; unsigned char triggering;
unsigned char polarity; unsigned char polarity;
unsigned char shareable; unsigned char shareable;
bool override;
}; };
static const struct irq_override_cmp skip_override_table[] = { static const struct irq_override_cmp override_table[] = {
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 }, { medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 }, { asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
{ lenovo_82ra, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
{ lenovo_82ra, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
}; };
static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity, static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
...@@ -446,6 +460,17 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity, ...@@ -446,6 +460,17 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
{ {
int i; int i;
for (i = 0; i < ARRAY_SIZE(override_table); i++) {
const struct irq_override_cmp *entry = &override_table[i];
if (dmi_check_system(entry->system) &&
entry->irq == gsi &&
entry->triggering == triggering &&
entry->polarity == polarity &&
entry->shareable == shareable)
return entry->override;
}
#ifdef CONFIG_X86 #ifdef CONFIG_X86
/* /*
* IRQ override isn't needed on modern AMD Zen systems and * 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, ...@@ -456,17 +481,6 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
return false; return false;
#endif #endif
for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) {
const struct irq_override_cmp *entry = &skip_override_table[i];
if (dmi_check_system(entry->system) &&
entry->irq == gsi &&
entry->triggering == triggering &&
entry->polarity == polarity &&
entry->shareable == shareable)
return false;
}
return true; return true;
} }
...@@ -498,8 +512,11 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, ...@@ -498,8 +512,11 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
u8 pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH; u8 pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
if (triggering != trig || polarity != pol) { if (triggering != trig || polarity != pol) {
pr_warn("ACPI: IRQ %d override to %s, %s\n", gsi, pr_warn("ACPI: IRQ %d override to %s%s, %s%s\n", gsi,
t ? "level" : "edge", p ? "low" : "high"); t ? "level" : "edge",
trig == triggering ? "" : "(!)",
p ? "low" : "high",
pol == polarity ? "" : "(!)");
triggering = trig; triggering = trig;
polarity = pol; polarity = pol;
} }
......
...@@ -1509,9 +1509,12 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map) ...@@ -1509,9 +1509,12 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map)
goto out; goto out;
} }
*map = r;
list_for_each_entry(rentry, &list, node) { list_for_each_entry(rentry, &list, node) {
if (rentry->res->start >= rentry->res->end) { if (rentry->res->start >= rentry->res->end) {
kfree(r); kfree(*map);
*map = NULL;
ret = -EINVAL; ret = -EINVAL;
dev_dbg(dma_dev, "Invalid DMA regions configuration\n"); dev_dbg(dma_dev, "Invalid DMA regions configuration\n");
goto out; goto out;
...@@ -1523,8 +1526,6 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map) ...@@ -1523,8 +1526,6 @@ int acpi_dma_get_range(struct device *dev, const struct bus_dma_region **map)
r->offset = rentry->offset; r->offset = rentry->offset;
r++; r++;
} }
*map = r;
} }
out: out:
acpi_dev_free_resource_list(&list); acpi_dev_free_resource_list(&list);
......
...@@ -71,7 +71,7 @@ int ghes_register_vendor_record_notifier(struct notifier_block *nb); ...@@ -71,7 +71,7 @@ int ghes_register_vendor_record_notifier(struct notifier_block *nb);
void ghes_unregister_vendor_record_notifier(struct notifier_block *nb); void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
#endif #endif
int ghes_estatus_pool_init(int num_ghes); int ghes_estatus_pool_init(unsigned int num_ghes);
/* From drivers/edac/ghes_edac.c */ /* From drivers/edac/ghes_edac.c */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册