History

Merge tag 'acpi-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki: "These fix two recent issues in the ACPI memory mappings management code and tighten up error handling in the ACPI driver for AMD SoCs (APD). Specifics: - Avoid redundant rounding to the page size in acpi_os_map_iomem() to address a recently introduced issue with the EFI memory map permission check on ARM64 (Ard Biesheuvel). - Fix acpi_release_memory() to wait until the memory mappings released by it have been really unmapped (Rafael Wysocki). - Make the ACPI driver for AMD SoCs (APD) check the return value of acpi_dev_get_property() to avoid failures in the cases when the device property under inspection is missing (Furquan Shaikh)" * tag 'acpi-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: OSL: Prevent acpi_release_memory() from returning too early ACPI: ioremap: avoid redundant rounding to OS page size ACPI: SoC: APD: Check return value of acpi_dev_get_property()

Linus Torvalds committed 6 years ago

Commit 0b2f18e2 parents 326e311 4f31d532 files · +21 −6Browse files

Unified · Split

2 files
  1. drivers/acpi/acpi_apd.c +2 −2
  2. drivers/acpi/osl.c +19 −4
drivers/acpi/acpi_apd.c+2−2
@@ -99,8 +99,8 @@ static int fch_misc_setup(struct apd_private_data *pdata) · 98 unmodified lines
9999 if (ret < 0)
100100 return -ENOENT;
101101
102− acpi_dev_get_property(adev, "is-rv", ACPI_TYPE_INTEGER, &obj);
103− clk_data->is_rv = obj->integer.value;
102+ if (!acpi_dev_get_property(adev, "is-rv", ACPI_TYPE_INTEGER, &obj))
103+ clk_data->is_rv = obj->integer.value;
104104
105105 list_for_each_entry(rentry, &resource_list, node) {
106106 clk_data->base = devm_ioremap(&adev->dev, rentry->res->start,
drivers/acpi/osl.c+19−4
@@ -350,7 +350,7 @@ void __iomem __ref · 349 unmodified lines
350350
351351 pg_off = round_down(phys, PAGE_SIZE);
352352 pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off;
353− virt = acpi_map(pg_off, pg_sz);
353+ virt = acpi_map(phys, size);
354354 if (!virt) {
355355 mutex_unlock(&acpi_ioremap_lock);
356356 kfree(map);
@@ -358,7 +358,7 @@ void __iomem __ref · 1 unmodified line
358358 }
359359
360360 INIT_LIST_HEAD(&map->list);
361− map->virt = virt;
361+ map->virt = (void __iomem __force *)((unsigned long)virt & PAGE_MASK);
362362 map->phys = pg_off;
363363 map->size = pg_sz;
364364 map->track.refcount = 1;
@@ -1575,11 +1575,26 @@ static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level, · 1210 unmodified lines
15751575 acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
15761576 u32 level)
15771577 {
1578+ acpi_status status;
1579+
15781580 if (!(res->flags & IORESOURCE_MEM))
15791581 return AE_TYPE;
15801582
1581− return acpi_walk_namespace(ACPI_TYPE_REGION, handle, level,
1582− acpi_deactivate_mem_region, NULL, res, NULL);
1583+ status = acpi_walk_namespace(ACPI_TYPE_REGION, handle, level,
1584+ acpi_deactivate_mem_region, NULL,
1585+ res, NULL);
1586+ if (ACPI_FAILURE(status))
1587+ return status;
1588+
1589+ /*
1590+ * Wait for all of the mappings queued up for removal by
1591+ * acpi_deactivate_mem_region() to actually go away.
1592+ */
1593+ synchronize_rcu();
1594+ rcu_barrier();
1595+ flush_scheduled_work();
1596+
1597+ return AE_OK;
15831598 }
15841599 EXPORT_SYMBOL_GPL(acpi_release_memory);
15851600

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t