drm/mgag200: Protect concurrent access to I/O registers with lock
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 2 May 2022 14:25:14 +0000 (16:25 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 5 May 2022 07:18:54 +0000 (09:18 +0200)
commit931e3f3a0e997c41eafbc88e4fc07ba9fef28f29
tree435c7eafdc66bc24e65a3f5bb84ca5a9cc07de59
parentf870231fdd6ce2c6c040a3584a2eac97ae473780
drm/mgag200: Protect concurrent access to I/O registers with lock

Add a mutex lock to protect concurrent access to I/O registers
against each other. This happens between invocation of commit-
tail functions and get-mode operations. Both with use the CRTC
index registers MGA1064_GEN_IO_DATA and MGA1064_GEN_IO_CTL.
Concurrent access can lead to failed mode-setting operations.

v2:
* fix typo in commit description (Jocelyn)
* add comment to explain rmmio_lock

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-4-tzimmermann@suse.de
drivers/gpu/drm/mgag200/mgag200_drv.c
drivers/gpu/drm/mgag200/mgag200_drv.h
drivers/gpu/drm/mgag200/mgag200_mode.c