1. 05 4月, 2016 1 次提交
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  2. 01 4月, 2016 2 次提交
  3. 28 3月, 2016 3 次提交
  4. 25 3月, 2016 1 次提交
  5. 23 3月, 2016 2 次提交
  6. 17 3月, 2016 1 次提交
  7. 15 3月, 2016 3 次提交
  8. 10 3月, 2016 2 次提交
  9. 09 3月, 2016 3 次提交
  10. 08 3月, 2016 1 次提交
    • L
      Revert "drm/radeon: call hpd_irq_event on resume" · 256faedc
      Linus Torvalds 提交于
      This reverts commit dbb17a21.
      
      It turns out that commit can cause problems for systems with multiple
      GPUs, and causes X to hang on at least a HP Pavilion dv7 with hybrid
      graphics.
      
      This got noticed originally in 4.4.4, where this patch had already
      gotten back-ported, but 4.5-rc7 was verified to have the same problem.
      
      Alexander Deucher says:
       "It looks like you have a muxed system so I suspect what's happening is
        that one of the display is being reported as connected for both the
        IGP and the dGPU and then the desktop environment gets confused or
        there some sort problem in the detect functions since the mux is not
        switched to the dGPU.  I don't see an easy fix unless Dave has any
        ideas.  I'd say just revert for now"
      Reported-by: NJörg-Volker Peetz <jvpeetz@web.de>
      Acked-by: NAlexander Deucher <Alexander.Deucher@amd.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: stable@kernel.org  # wherever dbb17a21 got back-ported
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      256faedc
  11. 06 3月, 2016 1 次提交
    • M
      drm/radeon: Fix error handling in radeon_flip_work_func. · 1e1490a3
      Mario Kleiner 提交于
      This is a port of the patch "drm/amdgpu: Fix error handling in amdgpu_flip_work_func."
      to fix the following problem for radeon as well which was
      reported against amdgpu:
      
      The patch e1d09dc0: "drm/amdgpu: Don't hang in
      amdgpu_flip_work_func on disabled crtc." from Feb 19, 2016, leads to
      the following static checker warning, as reported by Dan Carpenter in
      https://lists.freedesktop.org/archives/dri-devel/2016-February/101987.html
      
      drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:127 amdgpu_flip_work_func()     warn: should this be 'repcnt == -1'
      drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:136 amdgpu_flip_work_func() error: double unlock 'spin_lock:&crtc->dev->event_lock'
      drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:136 amdgpu_flip_work_func() error: double unlock 'irqsave:flags'
      
      This patch fixes both reported problems:
      
      Change post-decrement of repcnt to pre-decrement, so
      it can't underflow anymore, but still performs up to
      three repetitions - three is the maximum one could
      expect in practice.
      
      Move the spin_unlock_irqrestore to where it actually
      belongs.
      Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Cc: <stable@vger.kernel.org> # 4.4+
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      1e1490a3
  12. 03 3月, 2016 1 次提交
  13. 28 2月, 2016 2 次提交
    • O
      drm/radeon: Return -EPROBE_DEFER when amdkfd not loaded · 412c8f7d
      Oded Gabbay 提交于
      radeon must load only after amdkfd's loading has been completed. If that
      is not enforced, then radeon's call into amdkfd's functions will cause a
      kernel BUG.
      
      When radeon and amdkfd are built as kernel modules, that rule is
      enforced by the kernel's modules loading mechanism. When radeon and
      amdkfd are built inside the kernel image, that rule is enforced by
      ordering in the drm Makefile (amdkfd before radeon).
      
      Instead of using drm Makefile ordering, we can now use deferred
      loading as amdkfd now returns -EPROBE_DEFER in kgd2kfd_init() when it is
      not yet loaded.
      
      This patch defers radeon loading by propagating -EPROBE_DEFER to the
      kernel's drivers loading infrastructure. That will put radeon into the
      pending drivers list (see description in dd.c). Once amdkfd is loaded,
      a call to kgd2kfd_init() will return successfully and radeon will be
      able to load.
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      412c8f7d
    • O
      drm/amdkfd: Track when module's init is complete · c68f4528
      Oded Gabbay 提交于
      Current dependencies between amdkfd and radeon/amdgpu force the loading
      of amdkfd _before_ radeon and/or amdgpu are loaded. When all these kernel
      drivers are built as modules, this ordering is enforced by the kernel
      built-in mechanism of loading dependent modules.
      
      However, there is no such mechanism in case where all these drivers are
      compiled inside the kernel image (not as modules). The current way to
      enforce loading of amdkfd before radeon/amdgpu, is to put amdkfd before
      radeon/amdgpu in the drm Makefile, but that method is way too fragile.
      
      In addition, there is no kernel mechanism to check whether a kernel
      driver that is built inside the kernel image, has already been loaded.
      
      To solve this, this patch adds to kfd_module.c a new static variable,
      amdkfd_init_completed, that is set to 1 only when amdkfd's
      module initialization function has been completed (successfully).
      
      kgd2kfd_init(), which is the initialization function of the
      kgd-->kfd interface, and which is the first function in amdkfd called by
      radeon/amdgpu, will return successfully only if amdkfd_init_completed is
      equal 1.
      
      If amdkfd_init_completed is not equal to 1, kgd2kfd_init() will
      return -EPROBE_DEFER to signal radeon/amdgpu they need to defer
      their loading until amdkfd is loaded.
      Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      c68f4528
  14. 27 2月, 2016 1 次提交
  15. 23 2月, 2016 1 次提交
  16. 20 2月, 2016 1 次提交
    • M
      drm/radeon: Don't hang in radeon_flip_work_func on disabled crtc. (v2) · 2b8341b3
      Mario Kleiner 提交于
      This fixes a regression introduced in Linux 4.4.
      
      Limit the amount of time radeon_flip_work_func can
      delay programming a page flip, by both limiting the
      maximum amount of time per wait cycle and the maximum
      number of wait cycles. Continue the flip if the limit
      is exceeded, even if that may result in a visual or
      timing glitch.
      
      This is to prevent a hang of page flips, as reported
      in fdo bug #93746: Disconnecting a DisplayPort display
      in parallel to a kms pageflip getting queued can cause
      the following hang of page flips and thereby an unusable
      desktop:
      
      1. kms pageflip ioctl() queues pageflip -> queues execution
         of radeon_flip_work_func.
      
      2. Hotunplug of display causes the driver to DPMS OFF
         the unplugged display. Display engine shuts down,
         scanout no longer moves, but stays at its resting
         position at start line of vblank.
      
      3. radeon_flip_work_func executes while crtc is off, and
         due to the non-moving scanout position, the new flip
         delay code introduced into Linux 4.4 by
         commit 5b5561b3 ("drm/radeon: Fixup hw vblank counter/ts..")
         enters an infinite wait loop.
      
      4. After reconnecting the display, the pageflip continues
         to hang in 3. and the display doesn't update its view
         of the desktop.
      
      This patch fixes the Linux 4.4 regression from fdo bug #93746
      
      <https://bugs.freedesktop.org/show_bug.cgi?id=93746>
      
      v2: Skip wait immediately if !radeon_crtc->enabled, as
          suggested by Michel.
      Reported-by: NBernd Steinhauser <linux@bernd-steinhauser.de>
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Tested-by: NBernd Steinhauser <linux@bernd-steinhauser.de>
      
      Cc: <stable@vger.kernel.org> # 4.4+
      Cc: Michel Dänzer <michel.daenzer@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      2b8341b3
  17. 17 2月, 2016 1 次提交
  18. 16 2月, 2016 3 次提交
  19. 13 2月, 2016 1 次提交
    • L
      drm/radeon: Fix WARN_ON if DRM_DP_AUX_CHARDEV is enabled · 477d9f0e
      Lukas Wunner 提交于
      Rafael Antognolli's new DRM_DP_AUX_CHARDEV feature causes a WARN_ON
      if drm_dp_aux->dev == drm_connector->kdev and drm_dp_aux_unregister()
      is called after drm_connector_unregister(). radeon is the only driver
      affected by this besides i915. (amdgpu calls drm_dp_aux_unregister()
      before drm_connector_unregister().)
      
      Cc: Rafael Antognolli <rafael.antognolli@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      477d9f0e
  20. 11 2月, 2016 2 次提交
    • M
      drm/radeon: Avoid double gpu reset by adding a timeout on IB ring tests. · 04db4caf
      Matthew Dawson 提交于
      When the radeon driver resets a gpu, it attempts to test whether all the
      rings can successfully handle an IB.  If these rings fail to respond, the
      process will wait forever.  Another gpu reset can't happen at this point,
      as the current reset holds a lock required to do so.  Instead, make all
      the IB tests run with a timeout, so the system can attempt to recover
      in this case.
      
      While this doesn't fix the underlying issue with card resets failing, it
      gives the system a higher chance of recovering.  These timeouts have been
      confirmed to help both a Tathi and Hawaii card recover after a gpu reset.
      
      This also adds a new function, radeon_fence_wait_timeout, that behaves like
      fence_wait_timeout.  It is used instead of fence_wait_timeout as it continues
      to work during a reset.  radeon_fence_wait is changed to be implemented
      using this function.
      
      V2:
       - Changed the timeout to 1s, as the default 10s from radeon_wait_timeout was
      too long.  A timeout of 100ms was tested and found to be too short.
       - Changed radeon_fence_wait_timeout to behave more like fence_wait_timeout.
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NMatthew Dawson <matthew@mjdsystems.ca>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      04db4caf
    • N
      drm/radeon: hold reference to fences in radeon_sa_bo_new · f6ff4f67
      Nicolai Hähnle 提交于
      An arbitrary amount of time can pass between spin_unlock and
      radeon_fence_wait_any, so we need to ensure that nobody frees the
      fences from under us.
      
      Based on the analogous fix for amdgpu.
      Signed-off-by: NNicolai Hähnle <nicolai.haehnle@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Cc: stable@vger.kernel.org
      f6ff4f67
  21. 09 2月, 2016 3 次提交
  22. 06 2月, 2016 1 次提交
    • B
      PCI: Remove includes of asm/pci-bridge.h · 952bbcb0
      Bjorn Helgaas 提交于
      Drivers should include asm/pci-bridge.h only when they need the arch-
      specific things provided there.  Outside of the arch/ directories, the only
      drivers that actually need things provided by asm/pci-bridge.h are the
      powerpc RPA hotplug drivers in drivers/pci/hotplug/rpa*.
      
      Remove the includes of asm/pci-bridge.h from the other drivers, adding an
      include of linux/pci.h if necessary.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      952bbcb0
  23. 02 2月, 2016 1 次提交
  24. 28 1月, 2016 2 次提交