]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon: Make sure CS mutex is held across GPU reset.
authorMichel Dänzer <michel.daenzer@amd.com>
Thu, 10 Nov 2011 17:57:26 +0000 (18:57 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 11 Nov 2011 11:02:10 +0000 (11:02 +0000)
commit2dab5e9733d9a783a763e8073af1aa69071b6579
treec70a08db8ab123d51a622c062958786901473bdf
parent94fe1350a25d2e97f53a197c08415bed2543e99d
drm/radeon: Make sure CS mutex is held across GPU reset.

This was only the case if the GPU reset was triggered from the CS ioctl,
otherwise other processes could happily enter the CS ioctl and wreak havoc
during the GPU reset.

This is a little complicated because the GPU reset can be triggered from the
CS ioctl, in which case we're already holding the mutex, or from other call
paths, in which case we need to lock the mutex. AFAICT the mutex API doesn't
allow recursive locking or finding out the mutex owner, so we need to handle
this with helper functions which allow recursive locking from the same
process.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_device.c