Re: [PATCH v3] media: pvrusb2: fix parsing error

2020-08-20 Thread Mike Isely


Acked-by: Mike Isely 

On Thu, 20 Aug 2020, Tong Zhang wrote:

> pvr2_std_str_to_id() returns 0 on failure and 1 on success,
> however the caller is checking failure case using <0
> 
> Co-developed-by: Hans Verkuil
> Signed-off-by: Tong Zhang 
> ---
> 
> v2: return -EINVAL as suggested by Hans Verkuil.
> I also rebased the code on v5.9-rc1.
> v3: remove unused variable
> 
>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c 
> b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index 1cfb7cf64131..f4a727918e35 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -864,10 +864,9 @@ static int ctrl_std_sym_to_val(struct pvr2_ctrl *cptr,
>  const char *bufPtr,unsigned int bufSize,
>  int *mskp,int *valp)
>  {
> - int ret;
>   v4l2_std_id id;
> - ret = pvr2_std_str_to_id(&id,bufPtr,bufSize);
> - if (ret < 0) return ret;
> + if (!pvr2_std_str_to_id(&id, bufPtr, bufSize))
> + return -EINVAL;
>   if (mskp) *mskp = id;
>   if (valp) *valp = id;
>   return 0;
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


Re: [PATCH] media: pvrusb2: Convert timers to use timer_setup()

2017-10-25 Thread Mike Isely

Ack'ed (separate formal reply)

  -Mike

On Wed, 25 Oct 2017, Kees Cook wrote:

> Eek, sorry, this uses timer_setup_on_stack() which is only in -next.
> If you can Ack this, I can carry it in the timer tree.
> 
> Thanks!
> 
> -Kees
> 
> On Tue, Oct 24, 2017 at 5:22 PM, Kees Cook  wrote:
> > In preparation for unconditionally passing the struct timer_list pointer to
> > all timer callbacks, switch to using the new timer_setup() and from_timer()
> > to pass the timer pointer explicitly.
> >
> > Cc: Mike Isely 
> > Cc: Mauro Carvalho Chehab 
> > Cc: linux-me...@vger.kernel.org
> > Signed-off-by: Kees Cook 
> > ---
> >  drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 64 
> > ++---
> >  1 file changed, 36 insertions(+), 28 deletions(-)
> >
> > diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c 
> > b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> > index ad5b25b89699..8289ee482f49 100644
> > --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> > +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> > @@ -330,10 +330,10 @@ static void pvr2_hdw_state_log_state(struct pvr2_hdw 
> > *);
> >  static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl);
> >  static int pvr2_hdw_commit_setup(struct pvr2_hdw *hdw);
> >  static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw);
> > -static void pvr2_hdw_quiescent_timeout(unsigned long);
> > -static void pvr2_hdw_decoder_stabilization_timeout(unsigned long);
> > -static void pvr2_hdw_encoder_wait_timeout(unsigned long);
> > -static void pvr2_hdw_encoder_run_timeout(unsigned long);
> > +static void pvr2_hdw_quiescent_timeout(struct timer_list *);
> > +static void pvr2_hdw_decoder_stabilization_timeout(struct timer_list *);
> > +static void pvr2_hdw_encoder_wait_timeout(struct timer_list *);
> > +static void pvr2_hdw_encoder_run_timeout(struct timer_list *);
> >  static int pvr2_issue_simple_cmd(struct pvr2_hdw *,u32);
> >  static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
> > unsigned int timeout,int probe_fl,
> > @@ -2373,18 +2373,15 @@ struct pvr2_hdw *pvr2_hdw_create(struct 
> > usb_interface *intf,
> > }
> > if (!hdw) goto fail;
> >
> > -   setup_timer(&hdw->quiescent_timer, pvr2_hdw_quiescent_timeout,
> > -   (unsigned long)hdw);
> > +   timer_setup(&hdw->quiescent_timer, pvr2_hdw_quiescent_timeout, 0);
> >
> > -   setup_timer(&hdw->decoder_stabilization_timer,
> > -   pvr2_hdw_decoder_stabilization_timeout,
> > -   (unsigned long)hdw);
> > +   timer_setup(&hdw->decoder_stabilization_timer,
> > +   pvr2_hdw_decoder_stabilization_timeout, 0);
> >
> > -   setup_timer(&hdw->encoder_wait_timer, pvr2_hdw_encoder_wait_timeout,
> > -   (unsigned long)hdw);
> > +   timer_setup(&hdw->encoder_wait_timer, pvr2_hdw_encoder_wait_timeout,
> > +   0);
> >
> > -   setup_timer(&hdw->encoder_run_timer, pvr2_hdw_encoder_run_timeout,
> > -   (unsigned long)hdw);
> > +   timer_setup(&hdw->encoder_run_timer, pvr2_hdw_encoder_run_timeout, 
> > 0);
> >
> > hdw->master_state = PVR2_STATE_DEAD;
> >
> > @@ -3539,10 +3536,16 @@ static void pvr2_ctl_read_complete(struct urb *urb)
> > complete(&hdw->ctl_done);
> >  }
> >
> > +struct hdw_timer {
> > +   struct timer_list timer;
> > +   struct pvr2_hdw *hdw;
> > +};
> >
> > -static void pvr2_ctl_timeout(unsigned long data)
> > +static void pvr2_ctl_timeout(struct timer_list *t)
> >  {
> > -   struct pvr2_hdw *hdw = (struct pvr2_hdw *)data;
> > +   struct hdw_timer *timer = from_timer(timer, t, timer);
> > +   struct pvr2_hdw *hdw = timer->hdw;
> > +
> > if (hdw->ctl_write_pend_flag || hdw->ctl_read_pend_flag) {
> > hdw->ctl_timeout_flag = !0;
> > if (hdw->ctl_write_pend_flag)
> > @@ -3564,7 +3567,10 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
> >  {
> > unsigned int idx;
> > int status = 0;
> > -   struct timer_list timer;
> > +   struct hdw_timer timer = {
> > +   .hdw = hdw,
> > +   };
> > +
> > if (!hdw->ctl_lock_held) {
> > pvr2_trace(PVR2_TRACE_ERROR_LEGS,
> >"Attempted to execute control transfer

Re: [PATCH] media: pvrusb2: Convert timers to use timer_setup()

2017-10-25 Thread Mike Isely

Acked-By: Mike Isely 

On Tue, 24 Oct 2017, Kees Cook wrote:

> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
> 
> Cc: Mike Isely 
> Cc: Mauro Carvalho Chehab 
> Cc: linux-me...@vger.kernel.org
> Signed-off-by: Kees Cook 
> ---
>  drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 64 
> ++---
>  1 file changed, 36 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c 
> b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> index ad5b25b89699..8289ee482f49 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
> @@ -330,10 +330,10 @@ static void pvr2_hdw_state_log_state(struct pvr2_hdw *);
>  static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl);
>  static int pvr2_hdw_commit_setup(struct pvr2_hdw *hdw);
>  static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw);
> -static void pvr2_hdw_quiescent_timeout(unsigned long);
> -static void pvr2_hdw_decoder_stabilization_timeout(unsigned long);
> -static void pvr2_hdw_encoder_wait_timeout(unsigned long);
> -static void pvr2_hdw_encoder_run_timeout(unsigned long);
> +static void pvr2_hdw_quiescent_timeout(struct timer_list *);
> +static void pvr2_hdw_decoder_stabilization_timeout(struct timer_list *);
> +static void pvr2_hdw_encoder_wait_timeout(struct timer_list *);
> +static void pvr2_hdw_encoder_run_timeout(struct timer_list *);
>  static int pvr2_issue_simple_cmd(struct pvr2_hdw *,u32);
>  static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
>   unsigned int timeout,int probe_fl,
> @@ -2373,18 +2373,15 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface 
> *intf,
>   }
>   if (!hdw) goto fail;
>  
> - setup_timer(&hdw->quiescent_timer, pvr2_hdw_quiescent_timeout,
> - (unsigned long)hdw);
> + timer_setup(&hdw->quiescent_timer, pvr2_hdw_quiescent_timeout, 0);
>  
> - setup_timer(&hdw->decoder_stabilization_timer,
> - pvr2_hdw_decoder_stabilization_timeout,
> - (unsigned long)hdw);
> + timer_setup(&hdw->decoder_stabilization_timer,
> + pvr2_hdw_decoder_stabilization_timeout, 0);
>  
> - setup_timer(&hdw->encoder_wait_timer, pvr2_hdw_encoder_wait_timeout,
> - (unsigned long)hdw);
> + timer_setup(&hdw->encoder_wait_timer, pvr2_hdw_encoder_wait_timeout,
> + 0);
>  
> - setup_timer(&hdw->encoder_run_timer, pvr2_hdw_encoder_run_timeout,
> - (unsigned long)hdw);
> + timer_setup(&hdw->encoder_run_timer, pvr2_hdw_encoder_run_timeout, 0);
>  
>   hdw->master_state = PVR2_STATE_DEAD;
>  
> @@ -3539,10 +3536,16 @@ static void pvr2_ctl_read_complete(struct urb *urb)
>   complete(&hdw->ctl_done);
>  }
>  
> +struct hdw_timer {
> + struct timer_list timer;
> + struct pvr2_hdw *hdw;
> +};
>  
> -static void pvr2_ctl_timeout(unsigned long data)
> +static void pvr2_ctl_timeout(struct timer_list *t)
>  {
> - struct pvr2_hdw *hdw = (struct pvr2_hdw *)data;
> + struct hdw_timer *timer = from_timer(timer, t, timer);
> + struct pvr2_hdw *hdw = timer->hdw;
> +
>   if (hdw->ctl_write_pend_flag || hdw->ctl_read_pend_flag) {
>   hdw->ctl_timeout_flag = !0;
>   if (hdw->ctl_write_pend_flag)
> @@ -3564,7 +3567,10 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
>  {
>   unsigned int idx;
>   int status = 0;
> - struct timer_list timer;
> + struct hdw_timer timer = {
> + .hdw = hdw,
> + };
> +
>   if (!hdw->ctl_lock_held) {
>   pvr2_trace(PVR2_TRACE_ERROR_LEGS,
>  "Attempted to execute control transfer without 
> lock!!");
> @@ -3621,8 +3627,8 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
>   hdw->ctl_timeout_flag = 0;
>   hdw->ctl_write_pend_flag = 0;
>   hdw->ctl_read_pend_flag = 0;
> - setup_timer(&timer, pvr2_ctl_timeout, (unsigned long)hdw);
> - timer.expires = jiffies + timeout;
> + timer_setup_on_stack(&timer.timer, pvr2_ctl_timeout, 0);
> + timer.timer.expires = jiffies + timeout;
>  
>   if (write_len && write_data) {
>   hdw->cmd_debug_state = 2;
> @@ -3677,7 +3683,7 @@ status);
>   }
>  
>   /* Start timer */
> - add_timer(&timer);
> + add_timer(&timer.timer);
>  
>   /* Now wait 

Re: usb/media/pvrusb2: warning in pvr2_send_request_ex/usb_submit_urb

2017-09-20 Thread Mike Isely

What you have here is way beyond just feeding random crap in via the 
syscall interface.  To cause this you have to fake the presence of a 
pvrusb2 compatible *hardware* USB device and then lie about its endpoint 
configuration.  Is that really a concern here?  Are we now saying that 
any kernel driver which talks via USB must now also specifically verify 
the exact expected USB endpoint configuration?  Where does that end?  
How about the vendor-specific RPC protocol that the hardware actually 
implements over the bulk endpoint?  It's likely that the pvrusb2 driver 
may be making assumptions about the expected responses over that 
protocol.

Please realize that I'm not dismissing this.  I can see some merit in 
this.  But I'm just a bit surprised that now we're going this far.  Is 
this really the intention?  You're talking about code 
(pvrusb2_send_request_ex()) that hasn't changed in about 10 years.  
With this level of paranoia there's got to be a pretty target-rich 
environment over the set of kernel-supported USB devices.

To take this another step, wouldn't that same level of paranoia be a 
concern for any externally connected PCI-Express device?  Because that's 
another external way into the computer that involves very non-trivial 
and very hardware-centric protocols.  Thunderbolt devices would be an 
example of this.

  -Mike


On Wed, 20 Sep 2017, Andrey Konovalov wrote:

> Hi!
> 
> I've got the following report while fuzzing the kernel with syzkaller.
> 
> On commit ebb2c2437d8008d46796902ff390653822af6cc4 (Sep 18).
> 
> There seems to be no check on endpoint type before submitting bulk urb
> in pvr2_send_request_ex().
> 
> usb 1-1: New USB device found, idVendor=2040, idProduct=7500
> usb 1-1: New USB device strings: Mfr=0, Product=255, SerialNumber=0
> usb 1-1: Product: a
> gadgetfs: configuration #6
> pvrusb2: Hardware description: WinTV HVR-1950 Model 750xx
> usb 1-1: BOGUS urb xfer, pipe 3 != type 1
> [ cut here ]
> WARNING: CPU: 1 PID: 2713 at drivers/usb/core/urb.c:449
> usb_submit_urb+0xf8a/0x11d0
> Modules linked in:
> CPU: 1 PID: 2713 Comm: pvrusb2-context Not tainted
> 4.14.0-rc1-42251-gebb2c2437d80 #210
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> task: 88006b7a18c0 task.stack: 880069978000
> RIP: 0010:usb_submit_urb+0xf8a/0x11d0 drivers/usb/core/urb.c:448
> RSP: 0018:88006997f990 EFLAGS: 00010286
> RAX: 0029 RBX: 880063661900 RCX: 
> RDX: 0029 RSI: 86876d60 RDI: ed000d32ff24
> RBP: 88006997fa90 R08: 11000d32fdca R09: 
> R10:  R11:  R12: 11000d32ff39
> R13: 0001 R14: 0003 R15: 880068bbed68
> FS:  () GS:88006c60() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: 01032000 CR3: 6a0ff000 CR4: 06f0
> Call Trace:
>  pvr2_send_request_ex+0xa57/0x1d80 
> drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3645
>  pvr2_hdw_check_firmware drivers/media/usb/pvrusb2/pvrusb2-hdw.c:1812
>  pvr2_hdw_setup_low drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2107
>  pvr2_hdw_setup drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2250
>  pvr2_hdw_initialize+0x548/0x3c10 drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2327
>  pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:118
>  pvr2_context_thread_func+0x361/0x8c0
> drivers/media/usb/pvrusb2/pvrusb2-context.c:167
>  kthread+0x3a1/0x470 kernel/kthread.c:231
>  ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431
> Code: 48 8b 85 30 ff ff ff 48 8d b8 98 00 00 00 e8 ee 82 89 fe 45 89
> e8 44 89 f1 4c 89 fa 48 89 c6 48 c7 c7 40 c0 ea 86 e8 30 1b dc fc <0f>
> ff e9 9b f7 ff ff e8 aa 95 25 fd e9 80 f7 ff ff e8 50 74 f3
> ---[ end trace 6919030503719da6 ]---
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


Re: [PATCH v2 5/6] media/usb/pvrusb2: Support for V4L2_CTRL_WHICH_DEF_VAL

2015-10-29 Thread Mike Isely

Looks good to me (still), including now the change I had previously 
suggested.  For the record, the ack still applies.  (I guess you can 
consider this to be an ack of the ack...)

  -Mike


On Thu, 29 Oct 2015, Ricardo Ribalda Delgado wrote:

> This driver does not use the control infrastructure.
> Add support for the new field which on structure
>  v4l2_ext_controls
> 
> Acked-by: Mike Isely 
> Signed-off-by: Ricardo Ribalda Delgado 
> ---
>  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 16 ++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c 
> b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> index 1c5f85bf7ed4..81f788b7b242 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> @@ -628,6 +628,7 @@ static int pvr2_g_ext_ctrls(struct file *file, void *priv,
>   struct pvr2_v4l2_fh *fh = file->private_data;
>   struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
>   struct v4l2_ext_control *ctrl;
> + struct pvr2_ctrl *cptr;
>   unsigned int idx;
>   int val;
>   int ret;
> @@ -635,8 +636,15 @@ static int pvr2_g_ext_ctrls(struct file *file, void 
> *priv,
>   ret = 0;
>   for (idx = 0; idx < ctls->count; idx++) {
>   ctrl = ctls->controls + idx;
> - ret = pvr2_ctrl_get_value(
> - pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id), &val);
> + cptr = pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id);
> + if (cptr) {
> + if (ctls->which == V4L2_CTRL_WHICH_DEF_VAL)
> + pvr2_ctrl_get_def(cptr, &val);
> + else
> + ret = pvr2_ctrl_get_value(cptr, &val);
> + } else
> + ret = -EINVAL;
> +
>   if (ret) {
>   ctls->error_idx = idx;
>   return ret;
> @@ -658,6 +666,10 @@ static int pvr2_s_ext_ctrls(struct file *file, void 
> *priv,
>   unsigned int idx;
>   int ret;
>  
> + /* Default value cannot be changed */
> + if (ctls->which == V4L2_CTRL_WHICH_DEF_VAL)
> + return -EINVAL;
> +
>   ret = 0;
>   for (idx = 0; idx < ctls->count; idx++) {
>   ctrl = ctls->controls + idx;
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 07/10] media/usb/pvrusb2: Support for V4L2_CTRL_WHICH_DEF_VAL

2015-08-21 Thread Mike Isely

The code you've added is carefully checking the return pointer from 
pvr2_hdw_get_ctrl_v4l() yet the original code did not operate this way.  
The result is that now there's this "unbalanced" effect where it appears 
that the validity of the pvr2_ctrl instance is only checked on one side 
of the if-statement.  I would recommend instead to elevate the call to 
pvr2_hdw_get_ctrl_v4l() out of the if-statement - since in both cases 
it's being called the same way both times.  Then do the validity check 
in that one spot and that simplifies the if-statement all the way down 
to choosing between pvr2_ctrl_get_value() vs pvr2_ctrl_get_def().

It's not a correctness comment; what you have should work fine.  So I'm 
ack'ing this in any case:

Acked-By: Mike Isely 

But you can do the above pretty easily & safely, and simplify it a bit 
further.

  -Mike


On Fri, 21 Aug 2015, Ricardo Ribalda Delgado wrote:

> This driver does not use the control infrastructure.
> Add support for the new field which on structure
>  v4l2_ext_controls
> 
> Signed-off-by: Ricardo Ribalda Delgado 
> ---
>  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 17 -
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c 
> b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> index 1c5f85bf7ed4..43b2f2214798 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
> @@ -628,6 +628,7 @@ static int pvr2_g_ext_ctrls(struct file *file, void *priv,
>   struct pvr2_v4l2_fh *fh = file->private_data;
>   struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
>   struct v4l2_ext_control *ctrl;
> + struct pvr2_ctrl *cptr;
>   unsigned int idx;
>   int val;
>   int ret;
> @@ -635,8 +636,18 @@ static int pvr2_g_ext_ctrls(struct file *file, void 
> *priv,
>   ret = 0;
>   for (idx = 0; idx < ctls->count; idx++) {
>   ctrl = ctls->controls + idx;
> - ret = pvr2_ctrl_get_value(
> + if (ctls->which == V4L2_CTRL_WHICH_DEF_VAL) {
> + cptr = pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id);
> + if (cptr)
> + pvr2_ctrl_get_def(cptr, &val);
> + else
> + ret = -EINVAL;
> +
> +
> + } else
> + ret = pvr2_ctrl_get_value(
>   pvr2_hdw_get_ctrl_v4l(hdw, ctrl->id), &val);
> +
>   if (ret) {
>   ctls->error_idx = idx;
>   return ret;
> @@ -658,6 +669,10 @@ static int pvr2_s_ext_ctrls(struct file *file, void 
> *priv,
>   unsigned int idx;
>   int ret;
>  
> + /* Default value cannot be changed */
> + if (ctls->which == V4L2_CTRL_WHICH_DEF_VAL)
> + return -EINVAL;
> +
>   ret = 0;
>   for (idx = 0; idx < ctls->count; idx++) {
>   ctrl = ctls->controls + idx;
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 065/193] drivers/media/video/pvrusb2: remove CONFIG_EXPERIMENTAL

2012-10-23 Thread Mike Isely

I never liked that designation in the first place, so no argument 
here...

Acked-By: Mike Isely 


On Tue, 23 Oct 2012, Kees Cook wrote:

> This config item has not carried much meaning for a while now and is
> almost always enabled by default. As agreed during the Linux kernel
> summit, remove it.
> 
> CC: Mike Isely 
> CC: Mauro Carvalho Chehab 
> Signed-off-by: Kees Cook 
> ---
>  drivers/media/usb/pvrusb2/Kconfig |8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/usb/pvrusb2/Kconfig 
> b/drivers/media/usb/pvrusb2/Kconfig
> index 32b11c1..60a2604 100644
> --- a/drivers/media/usb/pvrusb2/Kconfig
> +++ b/drivers/media/usb/pvrusb2/Kconfig
> @@ -17,9 +17,9 @@ config VIDEO_PVRUSB2
> module will be called pvrusb2
>  
>  config VIDEO_PVRUSB2_SYSFS
> - bool "pvrusb2 sysfs support (EXPERIMENTAL)"
> + bool "pvrusb2 sysfs support"
>   default y
> - depends on VIDEO_PVRUSB2 && SYSFS && EXPERIMENTAL
> + depends on VIDEO_PVRUSB2 && SYSFS
>   ---help---
> This option enables the operation of a sysfs based
> interface for query and control of the pvrusb2 driver.
> @@ -33,9 +33,9 @@ config VIDEO_PVRUSB2_SYSFS
> Note: This feature is experimental and subject to change.
>  
>  config VIDEO_PVRUSB2_DVB
> - bool "pvrusb2 ATSC/DVB support (EXPERIMENTAL)"
> + bool "pvrusb2 ATSC/DVB support"
>   default y
> - depends on VIDEO_PVRUSB2 && DVB_CORE && EXPERIMENTAL
> + depends on VIDEO_PVRUSB2 && DVB_CORE
>   select DVB_LGDT330X if MEDIA_SUBDRV_AUTOSELECT
>   select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT
>   select DVB_S5H1411 if MEDIA_SUBDRV_AUTOSELECT
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] pvrusb2: Declare MODULE_FIRMWARE usage

2012-07-26 Thread Mike Isely

Acked-By: Mike Isely 

  -Mike


On Thu, 26 Jul 2012, Tim Gardner wrote:

> Cc: Mike Isely 
> Cc: Mauro Carvalho Chehab 
> Cc: linux-me...@vger.kernel.org
> Signed-off-by: Tim Gardner 
> ---
>  drivers/media/video/pvrusb2/pvrusb2-devattr.c |   17 -
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c 
> b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
> index d8c8982..adc501d3 100644
> --- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
> +++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
> @@ -54,8 +54,9 @@ static const struct pvr2_device_client_desc 
> pvr2_cli_29xxx[] = {
>   { .module_id = PVR2_CLIENT_ID_DEMOD },
>  };
>  
> +#define PVR2_FIRMWARE_29xxx "v4l-pvrusb2-29xxx-01.fw"
>  static const char *pvr2_fw1_names_29xxx[] = {
> - "v4l-pvrusb2-29xxx-01.fw",
> + PVR2_FIRMWARE_29xxx,
>  };
>  
>  static const struct pvr2_device_desc pvr2_device_29xxx = {
> @@ -87,8 +88,9 @@ static const struct pvr2_device_client_desc 
> pvr2_cli_24xxx[] = {
>   { .module_id = PVR2_CLIENT_ID_DEMOD },
>  };
>  
> +#define PVR2_FIRMWARE_24xxx "v4l-pvrusb2-24xxx-01.fw"
>  static const char *pvr2_fw1_names_24xxx[] = {
> - "v4l-pvrusb2-24xxx-01.fw",
> + PVR2_FIRMWARE_24xxx,
>  };
>  
>  static const struct pvr2_device_desc pvr2_device_24xxx = {
> @@ -369,8 +371,9 @@ static const struct pvr2_device_client_desc 
> pvr2_cli_73xxx[] = {
> .i2c_address_list = "\x42"},
>  };
>  
> +#define PVR2_FIRMWARE_73xxx "v4l-pvrusb2-73xxx-01.fw"
>  static const char *pvr2_fw1_names_73xxx[] = {
> - "v4l-pvrusb2-73xxx-01.fw",
> + PVR2_FIRMWARE_73xxx,
>  };
>  
>  static const struct pvr2_device_desc pvr2_device_73xxx = {
> @@ -475,8 +478,9 @@ static const struct pvr2_dvb_props pvr2_751xx_dvb_props = 
> {
>  };
>  #endif
>  
> +#define PVR2_FIRMWARE_75xxx "v4l-pvrusb2-73xxx-01.fw"
>  static const char *pvr2_fw1_names_75xxx[] = {
> - "v4l-pvrusb2-73xxx-01.fw",
> + PVR2_FIRMWARE_75xxx,
>  };
>  
>  static const struct pvr2_device_desc pvr2_device_750xx = {
> @@ -556,7 +560,10 @@ struct usb_device_id pvr2_device_table[] = {
>  };
>  
>  MODULE_DEVICE_TABLE(usb, pvr2_device_table);
> -
> +MODULE_FIRMWARE(PVR2_FIRMWARE_29xxx);
> +MODULE_FIRMWARE(PVR2_FIRMWARE_24xxx);
> +MODULE_FIRMWARE(PVR2_FIRMWARE_73xxx);
> +MODULE_FIRMWARE(PVR2_FIRMWARE_75xxx);
>  
>  /*
>Stuff for Emacs to see, in order to encourage consistent editing style:
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [393/2many] MAINTAINERS - PVRUSB2 VIDEO4LINUX DRIVER

2007-08-13 Thread Mike Isely

Signed-off-by: Mike Isely <[EMAIL PROTECTED]>

On Sun, 12 Aug 2007, [EMAIL PROTECTED] wrote:

> Add file pattern to MAINTAINER entry
> 
> Signed-off-by: Joe Perches <[EMAIL PROTECTED]>
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 62b6ede..3889034 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3760,6 +3760,8 @@ L:  [EMAIL PROTECTED]   (subscribers-only)
>  L:   [EMAIL PROTECTED]
>  W:   http://www.isely.net/pvrusb2/
>  S:   Maintained
> +F:   Documentation/video4linux/README.pvrusb2
> +F:   drivers/media/video/pvrusb2/
>  
>  PXA2xx SUPPORT
>  P:   Nicolas Pitre
> 

-- 
| Mike Isely  | PGP fingerprint
 Spammers Die!! | | 03 54 43 4D 75 E5 CC 92
|   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
| |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4/5] pvrusb2: use mutex instead of semaphore

2007-04-27 Thread Mike Isely

Whoops.  A straggler.

Signed-off-by: Mike Isely <[EMAIL PROTECTED]>

On Fri, 27 Apr 2007, Matthias Kaehlcke wrote:

> the pvrusb2 driver use a semaphore as mutex. use the mutex API instead
> of the (binary) semaphore
> 
> Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
> 
> --
> diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c 
> b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> index 9916cf3..ea450b0 100644
> --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> @@ -83,7 +83,7 @@ static struct pvr2_string_table pvr2_client_lists[] = {
>  };
>  
>  static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 
> NULL};
> -static DECLARE_MUTEX(pvr2_unit_sem);
> +static DEFINE_MUTEX(pvr2_unit_mtx);
>  
>  static int ctlchg = 0;
>  static int initusbreset = 1;
> @@ -2069,14 +2069,14 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface 
> *intf,
>   hdw->ctl_read_urb = usb_alloc_urb(0,GFP_KERNEL);
>   if (!hdw->ctl_read_urb) goto fail;
>  
> - down(&pvr2_unit_sem); do {
> + mutex_lock(&pvr2_unit_mtx); do {
>   for (idx = 0; idx < PVR_NUM; idx++) {
>   if (unit_pointers[idx]) continue;
>   hdw->unit_number = idx;
>   unit_pointers[idx] = hdw;
>   break;
>   }
> - } while (0); up(&pvr2_unit_sem);
> + } while (0); mutex_unlock(&pvr2_unit_mtx);
>  
>   cnt1 = 0;
>   cnt2 = scnprintf(hdw->name+cnt1,sizeof(hdw->name)-cnt1,"pvrusb2");
> @@ -2174,13 +2174,13 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
>   }
>   pvr2_i2c_core_done(hdw);
>   pvr2_hdw_remove_usb_stuff(hdw);
> - down(&pvr2_unit_sem); do {
> + mutex_lock(&pvr2_unit_mtx); do {
>   if ((hdw->unit_number >= 0) &&
>   (hdw->unit_number < PVR_NUM) &&
>   (unit_pointers[hdw->unit_number] == hdw)) {
>   unit_pointers[hdw->unit_number] = NULL;
>       }
> - } while (0); up(&pvr2_unit_sem);
> + } while (0); mutex_unlock(&pvr2_unit_mtx);
>   kfree(hdw->controls);
>   kfree(hdw->mpeg_ctrl_info);
>   kfree(hdw->std_defs);
> 
> 

-- 
| Mike Isely  | PGP fingerprint
 Spammers Die!! | | 03 54 43 4D 75 E5 CC 92
|   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
| |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.20] pvrusb2: use ARRAY_SIZE macro when appropriate (2)

2007-02-05 Thread Mike Isely
On Mon, 5 Feb 2007, Ahmed S. Darwish wrote:

> Hi all,
> A patch to use ARRAY_SIZE already defined in kernel.h. This patch is
> a complementry (and does not include) the one sent one week earlier.
> 
> Signed-off-by: Ahmed S. Darwish <[EMAIL PROTECTED]>

Ahmed:

After that initial patch a while back I then combed through the entire 
pvrusb2 driver and cleaned up all the other cases.  Those patches should 
already be on a trajectory for 2.6.21.  I'll check it against this patch 
but I think these should already all be handled.

  -Mike


-- 
    | Mike Isely  | PGP fingerprint
 Spammers Die!! | | 03 54 43 4D 75 E5 CC 92
|   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
| |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.20-rc5 2/4] pvrusb2: Use ARRAY_SIZE macro

2007-01-18 Thread Mike Isely
On Tue, 16 Jan 2007, Ahmed S. Darwish wrote:

> On Tue, Jan 16, 2007 at 10:16:33AM -0800, Randy Dunlap wrote:
> > On Tue, 16 Jan 2007 03:36:16 -0500 (EST) Robert P. J. Day wrote:
> > 
> > > On Tue, 16 Jan 2007, Ahmed S. Darwish wrote:
> > > 
> > > > Use ARRAY_SIZE macro in pvrusb2-hdw.c file
> > > >
> > > > Signed-off-by: Ahmed S. Darwish <[EMAIL PROTECTED]>
> > > 
> > > ... snip ...
> > > 
> > > i'm not sure it's worth submitting multiple patches to convert code
> > > expressions to the ARRAY_SIZE() macro since i was going to wait for
> > > the next kernel release, and do that in one fell swoop with a single
> > > patch.
> > > 
> > > but if people higher up the food chain think it's a better idea to do
> > > it a little at a time, that's fine.
> > 
> > I'm not strictly on the food chain, but these 4 patches to
> > pvrusb2 should have been sent as one patch IMO.
> 
> Here's the same patch in one file as suggested.
> 
> A patch to use ARRAY_SIZE macro when appropriate. 
> 
> Signed-off-by: Ahmed S. Darwish <[EMAIL PROTECTED]>
> ---

Ahmed:

I've pulled your patch into my driver source and will propagate it up 
appropriately as part of the next batch of pvrusb2 changes to come out 
of the v4l-dvb repository.

  -Mike


-- 
| Mike Isely  | PGP fingerprint
 Spammers Die!! | | 03 54 43 4D 75 E5 CC 92
|   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
| |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] video: pvrusb2-hdw kfree cleanup

2007-01-02 Thread Mike Isely
On Tue, 2 Jan 2007, Mariusz Kozlowski wrote:

> Hello, 
> 
> > This patch removes redundant argument check for kfree().
> > 
> >  drivers/media/video/pvrusb2/pvrusb2-hdw.c |   16 
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>
> 
> 

Signed-off-by: Mike Isely <[EMAIL PROTECTED]>

  -Mike

-- 
| Mike Isely  | PGP fingerprint
 Spammers Die!! | | 03 54 43 4D 75 E5 CC 92
|   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
| |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/