All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jeff Mahoney <jeffm@suse.com>
Cc: linux-kernel@vger.kernel.org, kraxel@bytesex.org,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	stable@kernel.org
Subject: Re: [PATCH] saa7134: fix thread shutdown handling
Date: Sat, 23 Jun 2007 09:54:26 -0700	[thread overview]
Message-ID: <20070623095426.6049f883.akpm@linux-foundation.org> (raw)
In-Reply-To: <467AC742.7070007@suse.com>

> On Thu, 21 Jun 2007 14:45:22 -0400 Jeff Mahoney <jeffm@suse.com> wrote:
>  This patch changes the test for the thread pid from >= 0 to > 0.
> 
>  When the saa8134 driver initialization fails after a certain point,
>  it goes through the complete shutdown process for the driver. Part
>  of shutting it down includes tearing down the thread for tv audio.
> 
>  The test for tearing down the thread tests for >= 0. Since the dev
>  structure is kzalloc'd, the test will always be true if we haven't
>  tried to start the thread yet. We end up waiting on pid 0 to complete,
>  which will never happen, so we lock up.
> 
>  This bug was observed in Novell Bugzilla 284718, when request_irq()
>  failed.
> 
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
> 
> ---
> 
>  drivers/media/video/saa7134/saa7134-tvaudio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/media/video/saa7134/saa7134-tvaudio.c	2007-06-12 15:45:16.000000000 -0400
> +++ b/drivers/media/video/saa7134/saa7134-tvaudio.c	2007-06-15 14:16:14.000000000 -0400
> @@ -1005,7 +1005,7 @@
>  int saa7134_tvaudio_fini(struct saa7134_dev *dev)
>  {
>  	/* shutdown tvaudio thread */
> -	if (dev->thread.pid >= 0) {
> +	if (dev->thread.pid > 0) {
>  		dev->thread.shutdown = 1;
>  		wake_up_interruptible(&dev->thread.wq);
>  		wait_for_completion(&dev->thread.exit);
> 

This is no longer applicable to the dvb devel tree, because this code has
been converted to the kthread API.

However I guess we do want this in 2.6.22 and in 2.6.21.x.  Mauro, if
that's OK, do you want me to do the merges?


  reply	other threads:[~2007-06-23 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-21 18:45 [PATCH] saa7134: fix thread shutdown handling Jeff Mahoney
2007-06-23 16:54 ` Andrew Morton [this message]
2007-06-23 18:47   ` 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=20070623095426.6049f883.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jeffm@suse.com \
    --cc=kraxel@bytesex.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=stable@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.