diff options
| author | Dave Airlie <airlied@redhat.com> | 2018-09-27 11:06:46 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2018-09-27 11:06:46 +1000 |
| commit | bf78296ab1cb215d0609ac6cff4e43e941e51265 (patch) | |
| tree | a193615b327d9ee538e71ca5f13bbfb4f3db4e6b /drivers/base/memory.c | |
| parent | Merge tag 'drm-hisilicon-next-2018-09-26' of github.com:xin3liang/linux into ... (diff) | |
| parent | Linux 4.19-rc5 (diff) | |
| download | linux-bf78296ab1cb215d0609ac6cff4e43e941e51265.tar.gz linux-bf78296ab1cb215d0609ac6cff4e43e941e51265.zip | |
BackMerge v4.19-rc5 into drm-next
Sean Paul requested an -rc5 backmerge from some sun4i fixes.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/base/memory.c')
| -rw-r--r-- | drivers/base/memory.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index c8a1cb0b6136..817320c7c4c1 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -417,25 +417,23 @@ static ssize_t show_valid_zones(struct device *dev, int nid; /* - * The block contains more than one zone can not be offlined. - * This can happen e.g. for ZONE_DMA and ZONE_DMA32 - */ - if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages, &valid_start_pfn, &valid_end_pfn)) - return sprintf(buf, "none\n"); - - start_pfn = valid_start_pfn; - nr_pages = valid_end_pfn - start_pfn; - - /* * Check the existing zone. Make sure that we do that only on the * online nodes otherwise the page_zone is not reliable */ if (mem->state == MEM_ONLINE) { + /* + * The block contains more than one zone can not be offlined. + * This can happen e.g. for ZONE_DMA and ZONE_DMA32 + */ + if (!test_pages_in_a_zone(start_pfn, start_pfn + nr_pages, + &valid_start_pfn, &valid_end_pfn)) + return sprintf(buf, "none\n"); + start_pfn = valid_start_pfn; strcat(buf, page_zone(pfn_to_page(start_pfn))->name); goto out; } - nid = pfn_to_nid(start_pfn); + nid = mem->nid; default_zone = zone_for_pfn_range(MMOP_ONLINE_KEEP, nid, start_pfn, nr_pages); strcat(buf, default_zone->name); |
