LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bongani Hlope <bonganilinux@mweb.co.za>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Robert Fitzsimons <robfitz@273k.net>,
	video4linux-list@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: 2.6.25-rc[12] Video4Linux Bttv Regression
Date: Fri, 21 Mar 2008 16:55:30 +0200	[thread overview]
Message-ID: <200803211655.31085.bonganilinux@mweb.co.za> (raw)
In-Reply-To: <20080320142212.2361f6d8@gaivota>

On Thursday 20 March 2008 19:22:12 Mauro Carvalho Chehab wrote:
> On Mon, 17 Mar 2008 23:51:56 +0200
>
8<
>
> Could you please test this small patch?
>
> diff -r 134d43b48b4a linux/drivers/media/video/bt8xx/bttv-driver.c
> --- a/linux/drivers/media/video/bt8xx/bttv-driver.c	Tue Mar 18 23:46:37
> 2008 +0000 +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c	Thu Mar 20
> 14:20:54 2008 -0300 @@ -3288,6 +3288,7 @@ static int bttv_open(struct inode
> *inode
>  		return -ENOMEM;
>  	file->private_data = fh;
>  	*fh = btv->init;
> +	fh->btv = btv;
>  	fh->type = type;
>  	fh->ov.setup_ok = 0;
>  	v4l2_prio_open(&btv->prio,&fh->prio);
>
>
> Cheers,
> Mauro

Latest git with or without your patch still causes the oops..

The call trace that seems to be causing this oops is

radio
|-> ioctl(
       |->videodev.c:__video_do_ioctl
          |->v4l1-compat.c:v4l_compat_translate_ioctl
          |  case VIDIOCGTUNER: /*  get tuner information  */
          | {
          |      struct video_tuner      *tun = arg;
          |
          |      memset(&tun2,0,sizeof(tun2));
          |__ err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
               |->videodev.c:__video_do_ioctl
               |   case VIDIOC_G_TUNER:
               |   {
               |      struct v4l2_tuner *p=arg;
               |     __u32 index=p->index;
               |
               |      if (!vfd->vidioc_g_tuner)
               |          break;
               |
               |     memset(p,0,sizeof(*p));
               |     p->index=index;
               |
               |     ret=vfd->vidioc_g_tuner(file, fh, p);
               |_
                  |-> bttv_driver.c:radio_g_tuner
                  |  struct bttv_fh *fh = priv;
                  |  struct bttv *btv = fh->btv;
                  |  
                  |  if (UNSET == bttv_tvcards[btv->c.type].tuner)
                  |      return -EINVAL;
                  |  if (0 != t->index)
                  |    return -EINVAL;
                  |  mutex_lock(&btv->lock); 
                  |__
                       |-> mutex.c:__mutex_lock_common 
                       |  struct task_struct *task = current;
                       |  struct mutex_waiter waiter;
                       |  unsigned int old_val;
                       |  unsigned long flags;
                       |
                       |  spin_lock_mutex(&lock->wait_lock, flags);
                       |
                       |  debug_mutex_lock_common(lock, &waiter);
                       |  mutex_acquire(&lock->dep_map, subclass, 0, ip);
                       |  debug_mutex_add_waiter(lock, &waiter, 
task_thread_info(task));
                       |
                       |        /* add waiting tasks to the end of the 
waitqueue (FIFO): */
                       | list_add_tail(&waiter.list, &lock->wait_list); 
                         ^^^^
This is where it oops because lock->wait_list->next is NULL.

BUT, changing: 
memset(&tun2,0,sizeof(tun2));
to
memset(&tun2,-1,sizeof(tun2));
in
v4l1-compat.c:v4l_compat_translate_ioctl
...
 case VIDIOCGTUNER:

changes
lock->wait_list->next from being NULL to something else, and the oops move to 
the next case statement i.e. VIDIOCGFREQ






  reply	other threads:[~2008-03-21 14:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17  8:36 Bongani Hlope
2008-02-18 16:11 ` Mauro Carvalho Chehab
2008-02-18 21:20   ` Bongani Hlope
2008-02-18 23:21     ` Bongani Hlope
2008-02-19 14:16       ` Mauro Carvalho Chehab
2008-02-19 20:37         ` Bongani Hlope
2008-02-21  9:03           ` Bongani Hlope
2008-02-26 15:41         ` Robert Fitzsimons
2008-02-27  1:42           ` Robert Fitzsimons
2008-02-27  1:44             ` [PATCH] bttv: Re-enable radio tuner support for VIDIOCGFREQ/VIDIOCSFREQ ioctls Robert Fitzsimons
2008-02-27  1:47             ` [PATCH] bttv: Re-enabling radio support requires the use of struct bttv_fh Robert Fitzsimons
2008-02-27  9:52               ` Mauro Carvalho Chehab
2008-02-27 21:45               ` Bongani Hlope
2008-02-28  9:25                 ` Robert Fitzsimons
2008-03-17 21:51             ` 2.6.25-rc[12] Video4Linux Bttv Regression Bongani Hlope
2008-03-20 17:22               ` Mauro Carvalho Chehab
2008-03-21 14:55                 ` Bongani Hlope [this message]
2008-03-22  0:05                   ` [PATCH] bttv: Add a radio compat_ioctl file operation Robert Fitzsimons
2008-03-22 18:17                     ` Bongani Hlope
2008-03-23  1:01                       ` Mauro Carvalho Chehab
2008-03-23 13:25                         ` Bongani Hlope
2008-03-23 13:50                           ` Mauro Carvalho Chehab
2008-03-24  6:58                             ` Bongani Hlope

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=200803211655.31085.bonganilinux@mweb.co.za \
    --to=bonganilinux@mweb.co.za \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=robfitz@273k.net \
    --cc=video4linux-list@redhat.com \
    --subject='Re: 2.6.25-rc[12] Video4Linux Bttv Regression' \
    /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

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).