Skip to content

Commit

Permalink
Merge branches 'acpi-apei', 'acpi-processor', 'acpi-tables', 'acpi-pc…
Browse files Browse the repository at this point in the history
…i' and 'acpi-soc'

* acpi-apei:
  ACPI / APEI: Release resources if gen_pool_add() fails
  ACPI / APEI: Get rid of NULL_UUID_LE constant

* acpi-processor:
  ACPI / processor: don't print errors for processorIDs == 0xff

* acpi-tables:
  ACPI: custom_method: fix memory leaks
  HMAT: Skip publishing target info for nodes with no online memory
  HMAT: Register attributes for memory hot add
  HMAT: Register memory-side cache after parsing

* acpi-pci:
  ACPI / PCI: fix acpi_pci_irq_enable() memory leak
  ACPI/PCI: Remove surplus parentheses from a return statement

* acpi-soc:
  ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint
  • Loading branch information
rafaeljw committed Sep 17, 2019
6 parents 522778c + 6abc762 + 2c2b005 + 03d1571 + 29b4995 + 57b3006 commit a781f39
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 42 deletions.
8 changes: 5 additions & 3 deletions drivers/acpi/acpi_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata)
}

static const struct lpss_device_desc lpt_dev_desc = {
.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
| LPSS_SAVE_CTX,
.prv_offset = 0x800,
};

static const struct lpss_device_desc lpt_i2c_dev_desc = {
.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR,
.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR | LPSS_SAVE_CTX,
.prv_offset = 0x800,
};

Expand All @@ -236,7 +237,8 @@ static struct property_entry uart_properties[] = {
};

static const struct lpss_device_desc lpt_uart_dev_desc = {
.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
| LPSS_SAVE_CTX,
.clk_con_id = "baudclk",
.prv_offset = 0x800,
.setup = lpss_uart_setup,
Expand Down
10 changes: 7 additions & 3 deletions drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,13 @@ static int acpi_processor_get_info(struct acpi_device *device)
}

if (acpi_duplicate_processor_id(pr->acpi_id)) {
dev_err(&device->dev,
"Failed to get unique processor _UID (0x%x)\n",
pr->acpi_id);
if (pr->acpi_id == 0xff)
dev_info_once(&device->dev,
"Entry not well-defined, consider updating BIOS\n");
else
dev_err(&device->dev,
"Failed to get unique processor _UID (0x%x)\n",
pr->acpi_id);
return -ENODEV;
}

Expand Down
19 changes: 16 additions & 3 deletions drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx)
int ghes_estatus_pool_init(int num_ghes)
{
unsigned long addr, len;
int rc;

ghes_estatus_pool = gen_pool_create(GHES_ESTATUS_POOL_MIN_ALLOC_ORDER, -1);
if (!ghes_estatus_pool)
Expand All @@ -164,15 +165,27 @@ int ghes_estatus_pool_init(int num_ghes)
ghes_estatus_pool_size_request = PAGE_ALIGN(len);
addr = (unsigned long)vmalloc(PAGE_ALIGN(len));
if (!addr)
return -ENOMEM;
goto err_pool_alloc;

/*
* New allocation must be visible in all pgd before it can be found by
* an NMI allocating from the pool.
*/
vmalloc_sync_all();

return gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
rc = gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
if (rc)
goto err_pool_add;

return 0;

err_pool_add:
vfree((void *)addr);

err_pool_alloc:
gen_pool_destroy(ghes_estatus_pool);

return -ENOMEM;
}

static int map_gen_v2(struct ghes *ghes)
Expand Down Expand Up @@ -483,7 +496,7 @@ static void ghes_do_proc(struct ghes *ghes,
int sev, sec_sev;
struct acpi_hest_generic_data *gdata;
guid_t *sec_type;
guid_t *fru_id = &NULL_UUID_LE;
const guid_t *fru_id = &guid_null;
char *fru_text = "";

sev = ghes_severity(estatus->error_severity);
Expand Down
5 changes: 4 additions & 1 deletion drivers/acpi/custom_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
if ((*ppos > max_size) ||
(*ppos + count > max_size) ||
(*ppos + count < count) ||
(count > uncopied_bytes))
(count > uncopied_bytes)) {
kfree(buf);
return -EINVAL;
}

if (copy_from_user(buf + (*ppos), user_buf, count)) {
kfree(buf);
Expand All @@ -70,6 +72,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
}

kfree(buf);
return count;
}

Expand Down
Loading

0 comments on commit a781f39

Please sign in to comment.