dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Inki Dae <inki.dae@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/exynos: avoid race condition when adding a drm component
Date: Fri, 21 Nov 2014 10:50:15 -0200	[thread overview]
Message-ID: <20141121125015.GB3123@joana> (raw)
In-Reply-To: <546ED6A5.90207@samsung.com>

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

> On 2014년 11월 21일 08:54, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > 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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-11-21 12:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20 23:54 [PATCH 1/3] drm/exynos: free DP if probe fails to find a panel or bridge Gustavo Padovan
2014-11-20 23:54 ` [PATCH 2/3] drm/exynos: avoid race condition when adding a drm component Gustavo Padovan
2014-11-21  6:07   ` Inki Dae
2014-11-21 12:50     ` Gustavo Padovan [this message]
2014-11-20 23:54 ` [PATCH 3/3] drm/exynos: avoid leak if exynos_dpi_probe() fails Gustavo Padovan
2014-11-21 17:40 ` [PATCH 1/3] drm/exynos: free DP if probe fails to find a panel or bridge Ajay kumar
2014-11-23  9:22   ` Jingoo Han
2014-11-22 14:56 ` Inki Dae
2014-11-24 13:02   ` Gustavo Padovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141121125015.GB3123@joana \
    --to=gustavo@padovan.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox