Skip to content

Commit

Permalink
x86, kexec, nvdimm: Use walk_iomem_res_desc() for iomem search
Browse files Browse the repository at this point in the history
Change the callers of walk_iomem_res() scanning for the
following resources by name to use walk_iomem_res_desc()
instead.

 "ACPI Tables"
 "ACPI Non-volatile Storage"
 "Persistent Memory (legacy)"
 "Crash kernel"

Note, the caller of walk_iomem_res() with "GART" will be removed
in a later patch.

Signed-off-by: Toshi Kani <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Dave Young <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Chun-Yi <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Lee, Chun-Yi <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Luis R. Rodriguez <[email protected]>
Cc: Minfei Huang <[email protected]>
Cc: Peter Zijlstra (Intel) <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Takao Indoh <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Toshi Kani <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: linux-mm <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
toshikani authored and Ingo Molnar committed Jan 30, 2016
1 parent 3f33647 commit f0f4711
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,12 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
/* Add ACPI tables */
cmd.type = E820_ACPI;
flags = IORESOURCE_MEM | IORESOURCE_BUSY;
walk_iomem_res("ACPI Tables", flags, 0, -1, &cmd,
walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1, &cmd,
memmap_entry_callback);

/* Add ACPI Non-volatile Storage */
cmd.type = E820_NVS;
walk_iomem_res("ACPI Non-volatile Storage", flags, 0, -1, &cmd,
walk_iomem_res_desc(IORES_DESC_ACPI_NV_STORAGE, flags, 0, -1, &cmd,
memmap_entry_callback);

/* Add crashk_low_res region */
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/pmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ static int found(u64 start, u64 end, void *data)

static __init int register_e820_pmem(void)
{
char *pmem = "Persistent Memory (legacy)";
struct platform_device *pdev;
int rc;

rc = walk_iomem_res(pmem, IORESOURCE_MEM, 0, -1, NULL, found);
rc = walk_iomem_res_desc(IORES_DESC_PERSISTENT_MEMORY_LEGACY,
IORESOURCE_MEM, 0, -1, NULL, found);
if (rc <= 0)
return 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/nvdimm/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static int e820_pmem_probe(struct platform_device *pdev)
for (p = iomem_resource.child; p ; p = p->sibling) {
struct nd_region_desc ndr_desc;

if (strncmp(p->name, "Persistent Memory (legacy)", 26) != 0)
if (p->desc != IORES_DESC_PERSISTENT_MEMORY_LEGACY)
continue;

memset(&ndr_desc, 0, sizeof(ndr_desc));
Expand Down
8 changes: 4 additions & 4 deletions kernel/kexec_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,10 @@ int kexec_add_buffer(struct kimage *image, char *buffer, unsigned long bufsz,

/* Walk the RAM ranges and allocate a suitable range for the buffer */
if (image->type == KEXEC_TYPE_CRASH)
ret = walk_iomem_res("Crash kernel",
IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
crashk_res.start, crashk_res.end, kbuf,
locate_mem_hole_callback);
ret = walk_iomem_res_desc(crashk_res.desc,
IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
crashk_res.start, crashk_res.end, kbuf,
locate_mem_hole_callback);
else
ret = walk_system_ram_res(0, -1, kbuf,
locate_mem_hole_callback);
Expand Down

0 comments on commit f0f4711

Please sign in to comment.