All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: "Hans Verkuil" <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, "Arnd Bergmann" <arnd@arndb.de>
Subject: Re: [RFC PATCHES] First version of the V4L2 core locking patches
Date: Tue, 21 Sep 2010 14:14:07 -0300	[thread overview]
Message-ID: <20100921141407.0893f03f@pedra> (raw)
In-Reply-To: <d2ceed8db848d1fbb35e751f5ccada51.squirrel@webmail.xs4all.nl>

Em Tue, 21 Sep 2010 15:50:13 +0200
"Hans Verkuil" <hverkuil@xs4all.nl> escreveu:

> Hi Mauro,
> 
> > Em 20-09-2010 18:37, Hans Verkuil escreveu:
...
> > 	/*
> > 	 * Need to sleep in order to wait for videobufs to complete.
> > 	 * It is not a good idea to sleep while waiting for an event with the dev
> > lock hold,
> > 	 * as it will block any other access to the device. Just unlock it while
> > waiting,
> > 	 * locking it again at the end.
> > 	 */
> >
> >  	is_vdev_locked = (q->vdev_lock && mutex_is_locked(q->vdev_lock)) ? true
> > : false;
> > 	if (is_vdev_locked)
> > 		mutex_unlock(q->vdev_lock);
> > 	if (intr)
> > 		return wait_event_interruptible(vb->done, is_state_active_or_queued(vb,
> > q));
> 
> This obviously needs to save the return value and continue to make sure
> the lock is taken again.

Yeah, it should be:
 rc = wait_event_interruptible(vb->done, is_state_active_or_queued(vb, q));

and return rc at the end.
 
> > 	else
> > 		wait_event(vb->done, is_state_active_or_queued(vb, q));
> > 	if (is_vdev_locked)
> > 		mutex_lock(q->vdev_lock);
> >
> > 	return 0;
> > }
> 
> Agreed. Thanks for reviewing this, it was the one patch that I knew I had
> to look into more closely. I'll incorporate your changes.

Ok, thanks.


-- 

Cheers,
Mauro

  reply	other threads:[~2010-09-21 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20 21:37 [RFC PATCHES] First version of the V4L2 core locking patches Hans Verkuil
2010-09-21 13:40 ` Mauro Carvalho Chehab
2010-09-21 13:50   ` Hans Verkuil
2010-09-21 17:14     ` Mauro Carvalho Chehab [this message]
2010-09-21 19:04       ` Hans Verkuil

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=20100921141407.0893f03f@pedra \
    --to=mchehab@redhat.com \
    --cc=arnd@arndb.de \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.