linux/drivers/gpu/drm
Mario Kleiner 90e94b160c drm/amdgpu: Fix error handling in amdgpu_flip_work_func.
The patch e1d09dc0cc: "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: Michel Dänzer <michel.daenzer@amd.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mario 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: Alex Deucher <alexander.deucher@amd.com>
2016-03-05 12:31:45 -05:00
..
amd drm/amdgpu: Fix error handling in amdgpu_flip_work_func. 2016-03-05 12:31:45 -05:00
armada Merge branch 'drm-armada-devel' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into drm-next 2015-12-23 09:19:58 +10:00
ast drm/ast: Fix incorrect register check for DRAM width 2016-03-02 17:50:17 +10:00
atmel-hlcdc drm: use dev_name as default unique name in drm_dev_alloc() 2015-12-15 13:56:06 +01:00
bochs drm/bochs: Constify function pointer structs 2015-12-15 13:42:36 +01:00
bridge Merge tag 'topic/drm-misc-2016-01-17' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-01-18 07:01:16 +10:00
cirrus drm/cirrus: Constify function pointer structs 2015-12-15 13:43:59 +01:00
etnaviv drm/etnaviv: call correct function when trying to vmap a DMABUF 2016-01-26 18:54:01 +01:00
exynos drm/exynos/decon: fix disable clocks order 2016-02-15 23:25:23 +09:00
fsl-dcu drm: use dev_name as default unique name in drm_dev_alloc() 2015-12-15 13:56:06 +01:00
gma500 Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-01-17 13:40:25 -08:00
i2c drm: adv7511: it's HPD, not HDP 2016-02-02 15:37:55 +01:00
i810
i915 drm/i915: Balance assert_rpm_wakelock_held() for !IS_ENABLED(CONFIG_PM) 2016-03-01 12:36:47 +10:00
imx dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
mga
mgag200 asm-generic changes for 4.5 2016-01-20 17:30:20 -08:00
msm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-01-17 13:40:25 -08:00
nouveau drm/nouveau/disp/dp: ensure sink is powered up before attempting link training 2016-02-25 13:15:43 +10:00
omapdrm fbdev changes for 4.5 2016-01-18 11:58:31 -08:00
panel drm/panel: simple: Add QiaoDian qd43003c0-40 2015-12-16 18:15:26 +01:00
qxl drm/qxl: fix erroneous return value 2016-02-17 15:39:35 +10:00
r128
radeon drm/radeon/pm: update current crtc info after setting the powerstate 2016-03-02 11:01:21 -05:00
rcar-du dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
rockchip drm/rockchip: respect CONFIG_DRM_FBDEV_EMULATION 2016-01-22 08:45:31 +08:00
savage
shmobile dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
sis
sti dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
tdfx
tegra Merge tag 'topic/drm-misc-2016-01-17' of git://anongit.freedesktop.org/drm-intel into drm-next 2016-01-18 07:01:16 +10:00
tilcdc dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
ttm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2016-01-17 13:40:25 -08:00
udl drm/udl: Constify function pointer structs 2015-12-15 13:48:54 +01:00
vc4 drm/vc4: Use runtime PM to power cycle the device when the GPU hangs. 2016-02-16 12:21:01 -08:00
vgem
via
virtio virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
vmwgfx drm/vmwgfx: respect 'nomodeset' 2016-01-29 10:03:44 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c drm/atomic: Allow for holes in connector state, v2. 2016-02-19 13:24:03 +10:00
drm_atomic.c drm/atomic: Allow for holes in connector state, v2. 2016-02-19 13:24:03 +10:00
drm_auth.c
drm_bridge.c drm/bridge: Improve kerneldoc 2015-12-08 16:07:53 +01:00
drm_bufs.c
drm_cache.c
drm_context.c
drm_crtc_helper.c drm: Add crtc->name and use it in debug messages 2015-12-11 09:13:48 +01:00
drm_crtc_internal.h
drm_crtc.c drm/atomic: Allow for holes in connector state, v2. 2016-02-19 13:24:03 +10:00
drm_debugfs.c
drm_dma.c
drm_dp_helper.c
drm_dp_mst_topology.c Revert "drm/dp/mst: change MST detection scheme" 2016-02-17 14:07:48 +10:00
drm_drv.c drm: move MODULE_PARM_DESC to other file 2016-01-08 15:32:29 +01:00
drm_edid_load.c
drm_edid.c drm/edid: index CEA/HDMI mode tables using the VIC 2016-01-08 15:30:28 +01:00
drm_encoder_slave.c drm: Constify drm_encoder_slave_funcs 2015-12-15 13:41:17 +01:00
drm_fb_cma_helper.c drm/fb_cma_helper: Remove implicit call to disable_unused_functions 2016-01-15 11:16:15 +01:00
drm_fb_helper.c drm/fb-helper: Use proper plane mask for fb cleanup 2015-12-21 09:54:49 +01:00
drm_flip_work.c
drm_fops.c Linux 4.4-rc4 2015-12-08 11:04:26 +10:00
drm_gem_cma_helper.c drm: Use the driver's gem_object_free function from CMA helpers. 2015-12-15 10:23:44 +01:00
drm_gem.c drm: Remove opencoded drm_gem_object_release_handle() 2016-01-05 16:23:09 +01:00
drm_global.c
drm_hashtab.c tree wide: use kvfree() than conditional kfree()/vfree() 2016-01-22 17:02:18 -08:00
drm_info.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c drm: Fix treatment of drm_vblank_offdelay in drm_vblank_on() (v2) 2016-02-17 14:19:00 +10:00
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c drm/dsi: Add Turn On/Shutdown Peripheral command helpers 2015-11-24 10:25:14 +01:00
drm_mm.c
drm_modes.c drm/doc: Convert to markdown 2015-12-15 10:22:26 +01:00
drm_modeset_lock.c drm/doc: Convert to markdown 2015-12-15 10:22:26 +01:00
drm_of.c
drm_panel.c
drm_pci.c drm: add drm_pcie_get_max_link_width helper (v2) 2015-12-21 16:42:31 -05:00
drm_plane_helper.c drm: Pass 'name' to drm_universal_plane_init() 2015-12-11 09:13:10 +01:00
drm_platform.c
drm_prime.c drm/doc: Convert to markdown 2015-12-15 10:22:26 +01:00
drm_probe_helper.c Merge branch 'for-linus' into for-next 2015-12-23 08:33:34 +01:00
drm_rect.c drm: Add "prefix" parameter to drm_rect_debug_print() 2015-11-24 11:47:46 +01:00
drm_scatter.c
drm_sysfs.c drm/sysfs: use kobj_to_dev() 2016-01-13 16:43:07 +01:00
drm_trace_points.c
drm_trace.h
drm_vm.c
drm_vma_manager.c
Kconfig dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
Makefile Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-01-20 09:45:43 -08:00