1. 10 Jun, 2020 12 commits
  2. 08 Jun, 2020 4 commits
  3. 05 Jun, 2020 2 commits
  4. 04 Jun, 2020 2 commits
  5. 03 Jun, 2020 9 commits
  6. 01 Jun, 2020 9 commits
  7. 31 May, 2020 2 commits
    • John Hubbard's avatar
      video: fbdev: convert get_user_pages() --> pin_user_pages() · 84be242d
      John Hubbard authored
      This code was using get_user_pages*(), in a "Case 2" scenario
      (DMA/RDMA), using the categorization from [1]. That means that it's
      time to convert the get_user_pages*() + put_page() calls to
      pin_user_pages*() + unpin_user_pages() calls.
      
      There is some helpful background in [2]: basically, this is a small
      part of fixing a long-standing disconnect between pinning pages, and
      file systems' use of those pages.
      
      [1] Documentation/core-api/pin_user_pages.rst
      
      [2] "Explicit pinning of user-space pages":
          https://lwn.net/Articles/807108/
      
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200522041506.39638-3-jhubbard@nvidia.com
      84be242d
    • John Hubbard's avatar
      video: fbdev: fix error handling for get_user_pages_fast() · e2e1c7bd
      John Hubbard authored
      Dealing with the return value of get_user_pages*() variants has a few
      classic pitfalls, and this driver found one of them: the return value
      might be zero, positive, or -errno. And if positive, it might be fewer
      pages than were requested. And if fewer pages than requested, then
      the caller should return (via put_page()) the pages that *were*
      pinned.
      
      This driver was doing that *except* that it had a problem with the
      -errno case, which was being stored in an unsigned int, and which
      would case an interesting mess if it ever happened: nr_pages would be
      interpreted as a spectacularly huge unsigned value, rather than a
      small negative value. Also, it was unnecessarily overriding a
      potentially informative -errno, with -EINVAL, in some cases.
      
      Instead: clamp the nr_pages to zero or positive, so that the error
      handling works. And return the -errno value from get_user_pages*(),
      unchanged, if we get one. And explain this with comments, seeing as
      how it is error-prone.
      
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200522041506.39638-2-jhubbard@nvidia.com
      e2e1c7bd