alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Shuah Khan <shuahkh@osg.samsung.com>,
	laurent.pinchart@ideasonboard.com, mchehab@osg.samsung.com,
	perex@perex.cz, tiwai@suse.com, hans.verkuil@cisco.com,
	chehabrafael@gmail.com, javier@osg.samsung.com,
	jh1009.sung@samsung.com
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	alsa-devel@alsa-project.org
Subject: Re: [RFC PATCH 1/4] media: Add Media Device Allocator API
Date: Sat, 26 Mar 2016 05:50:22 -0700	[thread overview]
Message-ID: <1458996622.23450.4.camel@perches.com> (raw)
In-Reply-To: <41d017ef76e3206780c018399ec60b63d865f65c.1458966594.git.shuahkh@osg.samsung.com>

On Fri, 2016-03-25 at 22:38 -0600, Shuah Khan wrote:
> Add Media Device Allocator API to manage Media Device life time problems.
> There are known problems with media device life time management. When media
> device is released while an media ioctl is in progress, ioctls fail with
> use-after-free errors and kernel hangs in some cases.

Seems reasonable, thanks.

trivial:

> diff --git a/drivers/media/media-dev-allocator.c b/drivers/media/media-dev-allocator.c
[]
> +static struct media_device *__media_device_get(struct device *dev,
> +					       bool alloc, bool kref)
> +{
[]
> +	pr_info("%s: mdev=%p\n", __func__, &mdi->mdev);

All of the pr_info uses here seem like debugging
and should likely be pr_debug instead.
> +struct media_device *media_device_find(struct device *dev)
> +{
> +	pr_info("%s\n", __func__);

These seem like function tracing and maybe could/should
use ftrace instead.
+/* don't allocate - increment kref if one is found */
> +struct media_device *media_device_get_ref(struct device *dev)
> +{
> +	pr_info("%s\n", __func__);

  reply	other threads:[~2016-03-26 12:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-26  4:38 [RFC PATCH 0/4] Media Device Allocator API Shuah Khan
2016-03-26  4:38 ` [RFC PATCH 1/4] media: Add " Shuah Khan
2016-03-26 12:50   ` Joe Perches [this message]
2016-03-28 13:45     ` Shuah Khan
2016-03-28 18:28   ` Mauro Carvalho Chehab
2016-03-28 21:34     ` Shuah Khan
2016-04-05 16:19       ` Mauro Carvalho Chehab
2016-03-26  4:38 ` [RFC PATCH 2/4] media: Add Media Device Allocator API documentation Shuah Khan
2016-03-28 18:28   ` Mauro Carvalho Chehab
2016-03-28 21:14     ` Shuah Khan
2016-03-26  4:38 ` [RFC PATCH 3/4] media: Add refcount to keep track of media device registrations Shuah Khan
2016-03-28 18:28   ` Mauro Carvalho Chehab
2016-03-28 21:37     ` Shuah Khan
2016-04-05 16:23       ` Mauro Carvalho Chehab
2016-03-26  4:38 ` [RFC PATCH 4/4] drivers: change au0828, uvcvideo, snd-usb-audio to use Media Device Allocator Shuah Khan
2016-03-28 18:28   ` Mauro Carvalho Chehab

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=1458996622.23450.4.camel@perches.com \
    --to=joe@perches.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=chehabrafael@gmail.com \
    --cc=hans.verkuil@cisco.com \
    --cc=javier@osg.samsung.com \
    --cc=jh1009.sung@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=perex@perex.cz \
    --cc=shuahkh@osg.samsung.com \
    --cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).