public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Valdis.Kletnieks@vt.edu,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken
Date: Fri, 15 Oct 2010 02:05:26 -0700	[thread overview]
Message-ID: <20101015020526.1819545f.akpm@linux-foundation.org> (raw)
In-Reply-To: <201010151045.45630.hverkuil@xs4all.nl>

On Fri, 15 Oct 2010 10:45:45 +0200 Hans Verkuil <hverkuil@xs4all.nl> wrote:

> On Thursday, October 14, 2010 22:06:29 Valdis.Kletnieks@vt.edu wrote:
> > On Wed, 13 Oct 2010 17:13:25 PDT, akpm@linux-foundation.org said:
> > > The mm-of-the-moment snapshot 2010-10-13-17-13 has been uploaded to
> > > 
> > >    http://userweb.kernel.org/~akpm/mmotm/
> > 
> > This broke my webcam.  I bisected it down to this commit, and things
> > work again after reverting the 2 code lines of change.
> > 
> > commit 9e4d79a98ebd857ec729f5fa8f432f35def4d0da
> > Author: Hans Verkuil <hverkuil@xs4all.nl>
> > Date:   Sun Sep 26 08:16:56 2010 -0300
> > 
> >     V4L/DVB: v4l2-dev: after a disconnect any ioctl call will be blocked
> >     
> >     Until now all fops except release and (unlocked_)ioctl returned an error
> >     after the device node was unregistered. Extend this as well to the ioctl
> >     fops. There is nothing useful that an application can do here and it
> >     complicates the driver code unnecessarily.
> >     
> >     Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
> >     Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> > 
> > 
> > diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
> > index d4a3532..f069c61 100644
> > --- a/drivers/media/video/v4l2-dev.c
> > +++ b/drivers/media/video/v4l2-dev.c
> > @@ -221,8 +221,8 @@ static long v4l2_ioctl(struct file *filp, unsigned int cmd, 
> >         struct video_device *vdev = video_devdata(filp);
> >         int ret;
> >  
> > -       /* Allow ioctl to continue even if the device was unregistered.
> > -          Things like dequeueing buffers might still be useful. */
> > +       if (!vdev->fops->ioctl)
> > +               return -ENOTTY;
> >         if (vdev->fops->unlocked_ioctl) {
> >                 ret = vdev->fops->unlocked_ioctl(filp, cmd, arg);
> >         } else if (vdev->fops->ioctl) {
> > 
> > I suspect this doesn't do what's intended if a driver is using ->unlocked_ioctl
> > rather than ->ioctl, and it should be reverted - it only saves at most one
> > if statement.
> > 
> > 
> 
> I'm not sure what is going on here. It looks like this patch is mangled in your
> tree since the same patch in the v4l-dvb repository looks like this:
> 
> diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c                                                         
> index 32575a6..26d39c4 100644                                                                                                        
> --- a/drivers/media/video/v4l2-dev.c                                                                                                 
> +++ b/drivers/media/video/v4l2-dev.c                                                                                                 
> @@ -222,8 +222,8 @@ static int v4l2_ioctl(struct inode *inode, struct file *filp,                                                    
>                                                                                                                                      
>         if (!vdev->fops->ioctl)                                                                                                      
>                 return -ENOTTY;                                                                                                      
> -       /* Allow ioctl to continue even if the device was unregistered.                                                              
> -          Things like dequeueing buffers might still be useful. */
> +       if (!video_is_registered(vdev))
> +               return -ENODEV;
>         return vdev->fops->ioctl(filp, cmd, arg);
>  }
>  
> @@ -234,8 +234,8 @@ static long v4l2_unlocked_ioctl(struct file *filp,
>  
>         if (!vdev->fops->unlocked_ioctl)
>                 return -ENOTTY;
> -       /* Allow ioctl to continue even if the device was unregistered.
> -          Things like dequeueing buffers might still be useful. */
> +       if (!video_is_registered(vdev))
> +               return -ENODEV;
>         return vdev->fops->unlocked_ioctl(filp, cmd, arg);
>  }
> 
> In your diff there is a mismatch between ioctl and unlocked_ioctl which no doubt
> is causing all the problems for you.

The patch which Valdis quoted is what is in linux-next.  I'm not
at which stage the mangling happened?

  reply	other threads:[~2010-10-15  9:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201010140044.o9E0iuR3029069@imap1.linux-foundation.org>
2010-10-14 20:06 ` mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken Valdis.Kletnieks
2010-10-15  8:45   ` Hans Verkuil
2010-10-15  9:05     ` Andrew Morton [this message]
2010-10-15 10:02       ` Hans Verkuil
2010-10-15 12:05         ` Mauro Carvalho Chehab
2010-10-15 12:23           ` Hans Verkuil
2010-10-18 19:00             ` Mauro Carvalho Chehab
2010-10-18 19:39               ` 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=20101015020526.1819545f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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