Re: [PATCH 2/3] drm/exynos: avoid race condition when adding a drm component

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2014-11-21 Inki Dae <inki.dae@xxxxxxxxxxx>:

> On 2014년 11월 21일 08:54, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx>
> > 
> > exynos_drm_component_add() correctly checks if a component is present on
> > drm_component_list however it release the lock right after the check
> > and before we add the new component to the list. That just creates room
> > to add the same component more than once to the list.
> 
> A little bit strange. drm_component_list is protected from race
> condition with mutex_lock. How the same component can be added to the
> drm_component_list again? And a new cdev object cannot be same cdev
> object already added to the drm_component_list because the new cdev
> object is allocated by kzalloc(). And the only case the same kms driver
> can request to add a new cdev to drm_component_list again is when the
> probe of the driver failed. However, in this case, the driver will call
> exynos_drm_component_del function to remove previous cdev. So the same
> cdev cannot be added to the drm_component_list even in such case.

Hmm, right. I haven't payed attention that each one of them is called just
once. I did this patch in my first days working with this code so I ignored
what exynos_drm_component_add() was really doing.

	Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux