Merge tag ‘drm-fixes-2019-02-22’ of git://anongit.freedesktop.org/drm/drm [Linux 5.0]

Merge tag ‘drm-fixes-2019-02-22’ of git://anongit.freedesktop.org/drm/drm [Linux 5.0]

This Linux kernel change "Merge tag ‘drm-fixes-2019-02-22’ of git://anongit.freedesktop.org/drm/drm" is included in the Linux 5.0 release. This change is authored by Linus Torvalds <torvalds [at] linux-foundation.org> on Fri Feb 22 10:35:06 2019 -0800. The commit for this change in Linux stable tree is 6ee2846 (patch). Other info about this change: Merge: 168bd29 019276ed

Merge tag 'drm-fixes-2019-02-22' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "This contains a single i915 tiled display fix, and a set of
  amdgpu/radeon fixes.

  i915:

   - tiled display fix

  amdgpu/radeon:

   - runtime PM fix

   - bulk moves disable (fix is too large for 5.0)

   - a set of display fixes that are all cc'ed stable so we didn't want
     to leave them until -next"

* tag 'drm-fixes-2019-02-22' of git://anongit.freedesktop.org/drm/drm:
  drm/amdgpu: disable bulk moves for now
  drm/amd/display: set clocks to 0 on suspend on dce80
  drm/amd/display: fix optimize_bandwidth func pointer for dce80
  drm/amd/display: Fix negative cursor pos programming
  drm/i915/fbdev: Actually configure untiled displays
  drm/amd/display: Raise dispclk value for dce11
  drm/amd/display: Fix MST reboot/poweroff sequence
  drm/amdgpu: Update sdma golden setting for vega20
  drm/amdgpu: Set DPM_FLAG_NEVER_SKIP when enabling PM-runtime
  gpu: drm: radeon: Set DPM_FLAG_NEVER_SKIP when enabling PM-runtime

There is no are 0 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 mm/memory_hotplug.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 124e794..1ad2832 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1188,11 +1188,13 @@ static inline int pageblock_free(struct page *page)
    return PageBuddy(page) && page_order(page) >= pageblock_order;
 }

-/* Return the start of the next active pageblock after a given page */
-static struct page *next_active_pageblock(struct page *page)
+/* Return the pfn of the start of the next active pageblock after a given pfn */
+static unsigned long next_active_pageblock(unsigned long pfn)
 {
+   struct page *page = pfn_to_page(pfn);
+
    /* Ensure the starting page is pageblock-aligned */
-   BUG_ON(page_to_pfn(page) & (pageblock_nr_pages - 1));
+   BUG_ON(pfn & (pageblock_nr_pages - 1));

    /* If the entire pageblock is free, move to the end of free page */
    if (pageblock_free(page)) {
@@ -1200,16 +1202,16 @@ static struct page *next_active_pageblock(struct page *page)
        /* be careful. we don't have locks, page_order can be changed.*/
        order = page_order(page);
        if ((order < MAX_ORDER) && (order >= pageblock_order))
-           return page + (1 << order);
+           return pfn + (1 << order);
    }

-   return page + pageblock_nr_pages;
+   return pfn + pageblock_nr_pages;
 }

-static bool is_pageblock_removable_nolock(struct page *page)
+static bool is_pageblock_removable_nolock(unsigned long pfn)
 {
+   struct page *page = pfn_to_page(pfn);
    struct zone *zone;
-   unsigned long pfn;

    /*
     * We have to be careful here because we are iterating over memory
@@ -1232,13 +1234,14 @@ static bool is_pageblock_removable_nolock(struct page *page)
 /* Checks if this range of memory is likely to be hot-removable. */
 bool is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages)
 {
-   struct page *page = pfn_to_page(start_pfn);
-   unsigned long end_pfn = min(start_pfn + nr_pages, zone_end_pfn(page_zone(page)));
-   struct page *end_page = pfn_to_page(end_pfn);
+   unsigned long end_pfn, pfn;
+
+   end_pfn = min(start_pfn + nr_pages,
+           zone_end_pfn(page_zone(pfn_to_page(start_pfn))));

    /* Check the starting page of each pageblock within the range */
-   for (; page < end_page; page = next_active_pageblock(page)) {
-       if (!is_pageblock_removable_nolock(page))
+   for (pfn = start_pfn; pfn < end_pfn; pfn = next_active_pageblock(pfn)) {
+       if (!is_pageblock_removable_nolock(pfn))
            return false;
        cond_resched();
    }

Leave a Reply

Your email address will not be published. Required fields are marked *