alistair23-linux/drivers/gpu/drm
Imre Deak dab9a2663f drm/i915: Fix system resume if PCI device remained enabled
During system resume we depended on pci_enable_device() also putting the
device into PCI D0 state. This won't work if the PCI device was already
enabled but still in D3 state. This is because pci_enable_device() is
refcounted and will not change the HW state if called with a non-zero
refcount. Leaving the device in D3 will make all subsequent device
accesses fail.

This didn't cause a problem most of the time, since we resumed with an
enable refcount of 0. But it fails at least after module reload because
after that we also happen to leak a PCI device enable reference: During
probing we call drm_get_pci_dev() which will enable the PCI device, but
during device removal drm_put_dev() won't disable it. This is a bug of
its own in DRM core, but without much harm as it only leaves the PCI
device enabled. Fixing it is also a bit more involved, due to DRM
mid-layering and because it affects non-i915 drivers too. The fix in
this patch is valid regardless of the problem in DRM core.

v2:
- Add a code comment about the relation of this fix to the freeze/thaw
  vs. the suspend/resume phases. (Ville)
- Add a code comment about the inconsistent ordering of set power state
  and device enable calls. (Chris)

CC: Ville Syrjälä <ville.syrjala@linux.intel.com>
CC: Chris Wilson <chris@chris-wilson.co.uk>
CC: stable@vger.kernel.org
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1460979954-14503-1-git-send-email-imre.deak@intel.com
(cherry picked from commit 44410cd0bf)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-04-27 10:37:54 +03:00
..
amd amdgpu/uvd: add uvd fw version for amdgpu 2016-04-21 20:03:47 -04:00
arm drm: ARM HDLCD - fix an error code 2016-04-04 10:11:33 +01:00
armada mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
ast Merge tag 'topic/drm-misc-2016-03-14' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-03-16 11:09:26 +10:00
atmel-hlcdc drm/atmel-hlcdc: use helper to get crtc state 2016-03-15 14:09:48 +01:00
bochs Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-21 13:48:00 -07:00
bridge
cirrus Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-21 13:48:00 -07:00
etnaviv Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-21 13:48:00 -07:00
exynos drm/exynos: Use VIDEO_SAMSUNG_S5P_G2D=n as G2D Kconfig dependency 2016-04-13 00:23:49 +09:00
fsl-dcu drm/fsl-dcu: removed optional dummy crtc mode_fixup function. 2016-03-04 18:16:45 +01:00
gma500 gma500: remove annoying deprecation warning 2016-04-04 12:38:46 -07:00
i2c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
i810
i915 drm/i915: Fix system resume if PCI device remained enabled 2016-04-27 10:37:54 +03:00
imx drm/imx: Don't set a gamma table size 2016-03-31 11:24:37 +02:00
mga
mgag200 drm/mgag200: removed optional dummy crtc mode_fixup function. 2016-03-04 17:54:17 +01:00
msm drm/msm: fix typo in the !COMMON_CLK case 2016-03-23 18:15:49 -04:00
nouveau Merge branch 'linux-4.6' of git://github.com/skeggsb/linux into drm-fixes 2016-04-22 10:09:33 +10:00
omapdrm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-25 08:48:31 -07:00
panel drm/panel: Changes for v4.6-rc1 2016-03-17 08:09:44 +10:00
qxl drm/qxl: fix cursor position with non-zero hotspot 2016-03-31 11:09:33 +03:00
r128
radeon drm/radeon: forbid mapping of userptr bo through radeon device file 2016-04-21 20:03:46 -04:00
rcar-du drm/rcar-du: removed optional dummy crtc mode_fixup function. 2016-03-04 17:58:47 +01:00
rockchip drm/rockchip: dw_hdmi: Don't call platform_set_drvdata() 2016-03-28 14:48:32 +08:00
savage
shmobile drm/shmobile: removed optional dummy crtc mode_fixup function. 2016-03-04 17:59:44 +01:00
sis
sti Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-21 13:48:00 -07:00
tdfx
tegra Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-21 13:48:00 -07:00
tilcdc
ttm mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
udl drm/udl: Use unlocked gem unreferencing 2016-04-01 13:22:33 +10:00
vc4 Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-21 13:48:00 -07:00
vgem
via mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
virtio drm/virtio: removed optional dummy crtc mode_fixup function. 2016-03-04 18:15:38 +01:00
vmwgfx Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-03-21 13:48:00 -07:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic.c Merge tag 'topic/drm-misc-2016-03-22' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-03-24 08:41:59 +10:00
drm_atomic_helper.c Merge tag 'topic/drm-misc-2016-03-22' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-03-24 08:41:59 +10:00
drm_auth.c
drm_bridge.c
drm_bufs.c
drm_cache.c
drm_context.c
drm_crtc.c Merge tag 'topic/drm-misc-2016-03-14' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-03-16 11:09:26 +10:00
drm_crtc_helper.c drm: introduce pipe color correction properties 2016-03-08 13:57:32 +01:00
drm_crtc_internal.h
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c
drm_dp_helper.c drm/dp: move hw_mutex up the call stack 2016-04-01 13:17:36 +10:00
drm_dp_mst_topology.c drm/dp/mst: Validate port in drm_dp_payload_send_msg() 2016-04-22 09:53:17 +10:00
drm_drv.c
drm_edid.c drm/edid: Fix DMT 1024x768@43Hz (interlaced) timings 2016-04-05 12:49:31 +03:00
drm_edid_load.c drm/edid: convert to use match_string() helper 2016-03-17 15:09:34 -07:00
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c
drm_flip_work.c
drm_fops.c
drm_gem.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
drm_gem_cma_helper.c dma, mm/pat: Rename dma_*_writecombine() to dma_*_wc() 2016-03-09 14:57:51 +01:00
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c Merge drm-fixes into drm-next. 2016-03-14 09:46:02 +10:00
drm_kms_helper_common.c
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c
drm_mm.c
drm_modes.c
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_pci.c
drm_plane_helper.c
drm_platform.c
drm_prime.c
drm_probe_helper.c
drm_rect.c
drm_scatter.c
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vm.c
drm_vma_manager.c
Kconfig
Makefile