linux/drivers/gpu/drm
Tomi Valkeinen f79cc6a2b8 drm/omap: fix memory barrier bug in DMM driver
[ Upstream commit 538f66ba20 ]

A DMM timeout "timed out waiting for done" has been observed on DRA7
devices. The timeout happens rarely, and only when the system is under
heavy load.

Debugging showed that the timeout can be made to happen much more
frequently by optimizing the DMM driver, so that there's almost no code
between writing the last DMM descriptors to RAM, and writing to DMM
register which starts the DMM transaction.

The current theory is that a wmb() does not properly ensure that the
data written to RAM is observable by all the components in the system.

This DMM timeout has caused interesting (and rare) bugs as the error
handling was not functioning properly (the error handling has been fixed
in previous commits):

 * If a DMM timeout happened when a GEM buffer was being pinned for
   display on the screen, a timeout error would be shown, but the driver
   would continue programming DSS HW with broken buffer, leading to
   SYNCLOST floods and possible crashes.

 * If a DMM timeout happened when other user (say, video decoder) was
   pinning a GEM buffer, a timeout would be shown but if the user
   handled the error properly, no other issues followed.

 * If a DMM timeout happened when a GEM buffer was being released, the
   driver does not even notice the error, leading to crashes or hang
   later.

This patch adds wmb() and readl() calls after the last bit is written to
RAM, which should ensure that the execution proceeds only after the data
is actually in RAM, and thus observable by DMM.

The read-back should not be needed. Further study is required to understand
if DMM is somehow special case and read-back is ok, or if DRA7's memory
barriers do not work correctly.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21 09:27:38 +01:00
..
amd drm/amdgpu: Fix SDMA HQD destroy error on gfx_v7 2018-10-20 09:52:33 +02:00
armada drm/armada: fix colorkey mode property 2018-08-24 13:26:58 +02:00
ast drm/drivers: add support for using the arch wc mapping API. 2018-09-09 20:04:36 +02:00
atmel-hlcdc drm: atmel-hlcdc: Fix vertical scaling 2016-09-24 10:07:42 +02:00
bochs
bridge drm/panel: Changes for v4.4-rc1 2015-11-05 11:07:13 +10:00
cirrus drm/drivers: add support for using the arch wc mapping API. 2018-09-09 20:04:36 +02:00
exynos drm/exynos: decon5433: Fix WINCONx reset value 2018-08-24 13:26:57 +02:00
fsl-dcu drm: Stop using drm_vblank_count() as the hw frame counter 2015-10-07 16:13:52 +02:00
gma500 drm/gma500: fix psb_intel_lvds_mode_valid()'s return type 2018-08-06 16:24:38 +02:00
i2c drm/bridge: adv7511: Reset registers on hotplug 2018-09-05 09:18:34 +02:00
i810
i915 drm/i915/userptr: reject zero user_size 2018-09-09 20:04:32 +02:00
imx drm/imx: imx-ldb: check if channel is enabled before printing warning 2018-09-05 09:18:34 +02:00
mga drm/irq: Use unsigned int pipe in public API 2015-10-06 12:57:47 +02:00
mgag200 drm/drivers: add support for using the arch wc mapping API. 2018-09-09 20:04:36 +02:00
msm drm/msm: fix leak in failed get_pages 2018-03-24 10:58:46 +01:00
nouveau drm/nouveau/fbcon: fix oops without fbdev emulation 2018-11-10 07:41:37 -08:00
omapdrm drm/omap: fix memory barrier bug in DMM driver 2018-11-21 09:27:38 +01:00
panel drm/panel: type promotion bug in s6e8aa0_read_mtp_id() 2018-09-26 08:35:10 +02:00
qxl drm: qxl: Don't alloc fbdev if emulation is not supported 2018-03-22 09:23:19 +01:00
r128 drm/irq: Use unsigned int pipe in public API 2015-10-06 12:57:47 +02:00
radeon drm/drivers: add support for using the arch wc mapping API. 2018-09-09 20:04:36 +02:00
rcar-du drm: rcar-du: Fix race condition when disabling planes at CRTC stop 2018-02-16 20:09:37 +01:00
rockchip drm/rockchip: Respect page offset for PRIME mmap calls 2018-05-30 07:49:16 +02:00
savage
shmobile drm: Stop using drm_vblank_count() as the hw frame counter 2015-10-07 16:13:52 +02:00
sis include/uapi/drm/sis_drm.h: move sis_file_private to drivers/gpu/drm/sis/sis_drv.h 2015-10-16 11:27:46 +10:00
sti drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache 2017-11-21 09:21:19 +01:00
tdfx
tegra Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2015-11-10 09:33:06 -08:00
tilcdc drm: Stop using drm_vblank_count() as the hw frame counter 2015-10-07 16:13:52 +02:00
ttm drm/ttm: check the return value of kzalloc 2018-03-03 10:19:44 +01:00
udl udl-kms: fix crash due to uninitialized memory 2018-09-05 09:18:39 +02:00
vc4 drm/vc4: Make sure that planes aren't scaled. 2015-11-17 12:27:03 -08:00
vgem drm/vgem: Drop vgem_drm_gem_mmap 2015-10-19 11:00:44 +02:00
via via_drm.h: move struct via_file_private definition to drivers/gpu/drm/via/via_drv.h 2015-10-16 11:27:49 +10:00
virtio virtio-gpu: fix ioctl and expose the fixed status to userspace. 2018-05-30 07:49:02 +02:00
vmwgfx drm/vmwgfx: Fix a buffer object leak 2018-05-16 10:06:48 +02:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c drm/atomic: fix an error code in mode_fixup() 2017-03-15 09:57:15 +08:00
drm_atomic.c drm/atomic: Handling the case when setting old crtc for plane 2018-08-06 16:24:37 +02:00
drm_auth.c
drm_bridge.c
drm_bufs.c
drm_cache.c drm: Restore double clflush on the last partial cacheline 2016-08-20 18:09:23 +02:00
drm_context.c
drm_crtc_helper.c
drm_crtc_internal.h
drm_crtc.c drm: Reject page_flip for !DRIVER_MODESET 2016-09-15 08:27:51 +02:00
drm_debugfs.c
drm_dma.c
drm_dp_helper.c drm/dp: move hw_mutex up the call stack 2016-04-20 15:41:55 +09:00
drm_dp_mst_topology.c drm/dp/mst: save vcpi with payloads 2017-10-21 17:09:01 +02:00
drm_drv.c drm: drm_minor_register(): Clean up debugfs on failure 2017-11-15 17:13:09 +01:00
drm_edid_load.c
drm_edid.c drm/edid: set ELD connector type in drm_edid_to_eld() 2018-03-22 09:23:27 +01:00
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c drm/fb_helper: Fix references to dev->mode_config.num_connector 2016-06-07 18:14:36 -07:00
drm_flip_work.c
drm_fops.c drm: set FMODE_UNSIGNED_OFFSET for drm files 2018-06-13 16:15:27 +02:00
drm_gem_cma_helper.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2015-11-10 09:33:06 -08:00
drm_gem.c drm: Release driver tracking before making the object available again 2017-08-30 10:19:23 +02:00
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h
drm_ioc32.c drm: Only use compat ioctl for addfb2 on X86/IA64 2016-09-24 10:07:43 +02:00
drm_ioctl.c drm: Enforce unlocked ioctl operation for kms driver ioctls 2015-10-16 15:50:54 +02:00
drm_irq.c drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off) 2018-03-22 09:23:20 +01:00
drm_legacy.h
drm_lock.c signals: kill block_all_signals() and unblock_all_signals() 2015-11-06 17:50:42 -08:00
drm_memory.c
drm_mipi_dsi.c
drm_mm.c drm: Apply range restriction after color adjustment when allocation 2017-11-30 08:37:27 +00:00
drm_modes.c drm: Fix broken VT switch with video=1366x768 option 2017-02-01 08:30:52 +01:00
drm_modeset_lock.c drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all 2018-02-25 11:03:35 +01:00
drm_of.c drm: Introduce generic probe function for component based masters. 2015-10-20 12:01:29 +02:00
drm_panel.c
drm_pci.c
drm_plane_helper.c
drm_platform.c
drm_prime.c drm/prime: Pass the right module owner through to dma_buf_export() 2016-10-31 04:13:57 -06:00
drm_probe_helper.c drm: Allow determining if current task is output poll worker 2018-03-18 11:17:48 +01:00
drm_rect.c drm: Use DRM_ROTATE_MASK and DRM_REFLECT_MASK 2015-10-05 15:32:51 +02:00
drm_scatter.c
drm_sysfs.c Merge commit '06d1ee32a4d25356a710b49d5e95dbdd68bdf505' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2015-10-16 10:25:28 +10:00
drm_trace_points.c
drm_trace.h
drm_vm.c
drm_vma_manager.c drm/gem: Use kref_get_unless_zero for the weak mmap references 2015-10-19 11:00:44 +02:00
Kconfig drm/vc4: Add KMS support for Raspberry Pi. 2015-10-21 10:33:12 +01:00
Makefile Merge tag 'drm-vc4-next-2015-10-21' of http://github.com/anholt/linux into drm-next 2015-10-22 10:31:17 +10:00