[PATCH 3/3] drm/tilcdc: Add mutex to protect crtc enable and disable routines

Jyri Sarha jsarha at ti.com
Tue Sep 6 12:09:01 UTC 2016


On 09/06/16 12:30, Tomi Valkeinen wrote:
> On 06/09/16 11:19, Jyri Sarha wrote:
>> Add mutex to protect crtc enable and disable routines. The
>> tilcdc_crtc_disable() function waits for frame done interrupt, the
>> internal data will get out of sync, should another enable arrive while
>> waiting for the interrupt.
> 
> Why doesn't the per-crtc modeset lock work for this?
> 

I am not worried about DRM enabling and disabling the crtc, it should
take the locks it needs on its own, and AFAIU the driver should not try
take the same locks again.

The purpose of these locks is to protect underneath workings the LCDC
driver reacting to something happening outside the DRM, like CPU
frequency change or module unloading.

I considered dropping this patch already last night (it was my first
attempt to fix the race, and it worked too), but then decided to put it
under review just for the sake of argument ;).

All in all it should be enough to take all the necessary DRM locks when
fiddling with lcdc hw and not to implement any extra layers of locking.

I'll drop this patch.

BR,
Jyri


More information about the dri-devel mailing list