[linuxtv-media:master 247/250] arch/mips/include/asm/uaccess.h:445:32: warning: initialization makes integer from pointer without a cast

2018-07-26 Thread kbuild test robot
tree:   git://linuxtv.org/media_tree.git master
head:   343b23a7c6b6680ef949e6112a4ee60688acf39d
commit: f863ce990030cfc5a57a490b4613be4a523ffce1 [247/250] media: dvb: get rid 
of VIDEO_SET_SPU_PALETTE
config: mips-fuloong2e_defconfig (attached as .config)
compiler: mips64el-linux-gnuabi64-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout f863ce990030cfc5a57a490b4613be4a523ffce1
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=mips 

All warnings (new ones prefixed by >>):

   fs/compat_ioctl.c: In function 'do_video_set_spu_palette':
   fs/compat_ioctl.c:218:45: error: invalid application of 'sizeof' to 
incomplete type 'struct video_spu_palette'
 up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
^~
   In file included from include/linux/uaccess.h:14:0,
from include/linux/compat.h:19,
from fs/compat_ioctl.c:17:
   fs/compat_ioctl.c:219:46: error: dereferencing pointer to incomplete type 
'struct video_spu_palette'
 err  = put_user(compat_ptr(palp), _native->palette);
 ^
   arch/mips/include/asm/uaccess.h:444:15: note: in definition of macro 
'__put_user_check'
 __typeof__(*(ptr)) __user *__pu_addr = (ptr);   \
  ^~~
   fs/compat_ioctl.c:219:9: note: in expansion of macro 'put_user'
 err  = put_user(compat_ptr(palp), _native->palette);
^~~~
>> arch/mips/include/asm/uaccess.h:445:32: warning: initialization makes 
>> integer from pointer without a cast [-Wint-conversion]
 __typeof__(*(ptr)) __pu_val = (x);\
   ^
>> arch/mips/include/asm/uaccess.h:158:2: note: in expansion of macro 
>> '__put_user_check'
 __put_user_check((x), (ptr), sizeof(*(ptr)))
 ^~~~
   fs/compat_ioctl.c:219:9: note: in expansion of macro 'put_user'
 err  = put_user(compat_ptr(palp), _native->palette);
^~~~
   At top level:
   fs/compat_ioctl.c:206:12: warning: 'do_video_set_spu_palette' defined but 
not used [-Wunused-function]
static int do_video_set_spu_palette(struct file *file,
   ^~~~

vim +445 arch/mips/include/asm/uaccess.h

^1da177e include/asm-mips/uaccess.h  Linus Torvalds  2005-04-16  441  
^1da177e include/asm-mips/uaccess.h  Linus Torvalds  2005-04-16  442  
#define __put_user_check(x, ptr, size)\
^1da177e include/asm-mips/uaccess.h  Linus Torvalds  2005-04-16  443  ({
\
fe00f943 include/asm-mips/uaccess.h  Ralf Baechle2005-03-01 @444
__typeof__(*(ptr)) __user *__pu_addr = (ptr);   \
fe00f943 include/asm-mips/uaccess.h  Ralf Baechle2005-03-01 @445
__typeof__(*(ptr)) __pu_val = (x);  \
8d2d91e8 include/asm-mips/uaccess.h  Ralf Baechle2008-10-11  446
int __pu_err = -EFAULT; \
^1da177e include/asm-mips/uaccess.h  Linus Torvalds  2005-04-16  447
\
ef41f460 arch/mips/include/asm/uaccess.h Ralf Baechle2009-04-28  448
might_fault();  \
ac1d8590 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  449
if (likely(access_ok(VERIFY_WRITE,  __pu_addr, size))) {\
12060666 arch/mips/include/asm/uaccess.h Paul Burton 2015-05-24  450
if (eva_kernel_access())\
ac1d8590 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  451
__put_kernel_common(__pu_addr, size);   \
ac1d8590 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  452
else\
ec56b1d4 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-17  453
__put_user_common(__pu_addr, size); \
ac1d8590 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-11  454
}   \
ec56b1d4 arch/mips/include/asm/uaccess.h Markos Chandras 2013-12-17  455
\
^1da177e include/asm-mips/uaccess.h  Linus Torvalds  2005-04-16  456
__pu_err;   \
^1da177e include/asm-mips/uaccess.h  Linus Torvalds  2005-04-16  457  })
^1da177e include/asm-mips/uaccess.h  Linus Torvalds  2005-04-16  458  

:: The code at line 445 was first introduced by commit
:: 

cron job: media_tree daily build: ERRORS

2018-07-26 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Fri Jul 27 05:00:19 CEST 2018
media-tree git hash:343b23a7c6b6680ef949e6112a4ee60688acf39d
media_build git hash:   a9bf44fe0a671f90de0b2dc2f2281a07e7501333
v4l-utils git hash: 5e8d31abc6f531ef0bc0fc563d5311602a395685
edid-decode git hash:   ab18befbcacd6cd4dff63faa82e32700369d6f25
gcc version:i686-linux-gcc (GCC) 8.1.0
sparse version: 0.5.2
smatch version: 0.5.1
host hardware:  x86_64
host os:4.16.0-1-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: OK
linux-git-arm-pxa: OK
linux-git-arm-stm32: OK
linux-git-arm64: OK
linux-git-i686: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
Check COMPILE_TEST: OK
linux-2.6.36.4-i686: ERRORS
linux-2.6.36.4-x86_64: ERRORS
linux-2.6.37.6-i686: ERRORS
linux-2.6.37.6-x86_64: ERRORS
linux-2.6.38.8-i686: ERRORS
linux-2.6.38.8-x86_64: ERRORS
linux-2.6.39.4-i686: ERRORS
linux-2.6.39.4-x86_64: ERRORS
linux-3.0.101-i686: ERRORS
linux-3.0.101-x86_64: ERRORS
linux-3.1.10-i686: ERRORS
linux-3.1.10-x86_64: ERRORS
linux-3.2.102-i686: ERRORS
linux-3.2.102-x86_64: ERRORS
linux-3.3.8-i686: ERRORS
linux-3.3.8-x86_64: ERRORS
linux-3.4.113-i686: ERRORS
linux-3.4.113-x86_64: ERRORS
linux-3.5.7-i686: ERRORS
linux-3.5.7-x86_64: ERRORS
linux-3.6.11-i686: ERRORS
linux-3.6.11-x86_64: ERRORS
linux-3.7.10-i686: ERRORS
linux-3.7.10-x86_64: ERRORS
linux-3.8.13-i686: ERRORS
linux-3.8.13-x86_64: ERRORS
linux-3.9.11-i686: ERRORS
linux-3.9.11-x86_64: ERRORS
linux-3.10.108-i686: ERRORS
linux-3.10.108-x86_64: ERRORS
linux-3.11.10-i686: ERRORS
linux-3.11.10-x86_64: ERRORS
linux-3.12.74-i686: ERRORS
linux-3.12.74-x86_64: ERRORS
linux-3.13.11-i686: OK
linux-3.13.11-x86_64: OK
linux-3.14.79-i686: OK
linux-3.14.79-x86_64: OK
linux-3.15.10-i686: OK
linux-3.15.10-x86_64: OK
linux-3.16.57-i686: OK
linux-3.16.57-x86_64: OK
linux-3.17.8-i686: OK
linux-3.17.8-x86_64: OK
linux-3.18.115-i686: OK
linux-3.18.115-x86_64: OK
linux-3.19.8-i686: OK
linux-3.19.8-x86_64: OK
linux-4.0.9-i686: OK
linux-4.0.9-x86_64: OK
linux-4.1.52-i686: OK
linux-4.1.52-x86_64: OK
linux-4.2.8-i686: OK
linux-4.2.8-x86_64: OK
linux-4.3.6-i686: OK
linux-4.3.6-x86_64: OK
linux-4.4.140-i686: OK
linux-4.4.140-x86_64: OK
linux-4.5.7-i686: OK
linux-4.5.7-x86_64: OK
linux-4.6.7-i686: OK
linux-4.6.7-x86_64: OK
linux-4.7.10-i686: OK
linux-4.7.10-x86_64: OK
linux-4.8.17-i686: OK
linux-4.8.17-x86_64: OK
linux-4.9.112-i686: OK
linux-4.9.112-x86_64: OK
linux-4.10.17-i686: OK
linux-4.10.17-x86_64: OK
linux-4.11.12-i686: OK
linux-4.11.12-x86_64: OK
linux-4.12.14-i686: OK
linux-4.12.14-x86_64: OK
linux-4.13.16-i686: OK
linux-4.13.16-x86_64: OK
linux-4.14.55-i686: OK
linux-4.14.55-x86_64: OK
linux-4.15.18-i686: OK
linux-4.15.18-x86_64: OK
linux-4.16.18-i686: OK
linux-4.16.18-x86_64: OK
linux-4.17.6-i686: OK
linux-4.17.6-x86_64: OK
linux-4.18-rc4-i686: OK
linux-4.18-rc4-x86_64: OK
apps: OK
spec-git: OK

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html


[PATCH] media: video-i2c: hwmon: fix return value from amg88xx_hwmon_init()

2018-07-26 Thread Matt Ranostay
PTR_ERR was making any pointer passed an error pointer, and should be
replaced with PTR_ERR_OR_ZERO which checks if is an actual error condition.

Signed-off-by: Matt Ranostay 
---
 drivers/media/i2c/video-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 7dc9338502e5..06d29d8f6be8 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -167,7 +167,7 @@ static int amg88xx_hwmon_init(struct video_i2c_data *data)
void *hwmon = devm_hwmon_device_register_with_info(>client->dev,
"amg88xx", data, _chip_info, NULL);
 
-   return PTR_ERR(hwmon);
+   return PTR_ERR_OR_ZERO(hwmon);
 }
 #else
 #defineamg88xx_hwmon_init  NULL
-- 
2.17.1



photos for your company

2018-07-26 Thread Jan

I would like to contact the person that manages your images for your
company?

We provide different services that makes your images and pictures to look
good. For the images to
be more attractive, we services such as background image cut out, clipping
path, shadow adding
(drop shadow, reflection shadow, natural shadow, mirror effect), image
masking, product image editing.
Image Manipulation / Clothes Neck-Joint and image retouching.

Also, we also use the most recent application as well as techniques such as
Adobe Photoshop.

The following are the kind of services together:

Clipping Path Service
Clipping Path, Cut out image,Image Clipping, Clip image
Photo Masking Service
Channel Masking,Photo Masking, Translucent Masking
Image Cropping Service
Crop image, Photo cut out,
Image Manipulation Service
Composite image, Neck Joint
Shadow Adding Services
Drop Shadow adding, Reflection shadow,Natural shadow
Photo Retouching Service
Photo Retouching, Glamour Retouching.

Our Service is 24-48 hours but we can deliver the images sooner in case of
emergency.

We can give you editing test on your photos.
We do unlimited revisions until you are satisfied with the work.

Thanks,
Jan Williams



your website photos

2018-07-26 Thread Jan

I would like to contact the person that manages your images for your
company?

We provide different services that makes your images and pictures to look
good. For the images to
be more attractive, we services such as background image cut out, clipping
path, shadow adding
(drop shadow, reflection shadow, natural shadow, mirror effect), image
masking, product image editing.
Image Manipulation / Clothes Neck-Joint and image retouching.

Also, we also use the most recent application as well as techniques such as
Adobe Photoshop.

The following are the kind of services together:

Clipping Path Service
Clipping Path, Cut out image,Image Clipping, Clip image
Photo Masking Service
Channel Masking,Photo Masking, Translucent Masking
Image Cropping Service
Crop image, Photo cut out,
Image Manipulation Service
Composite image, Neck Joint
Shadow Adding Services
Drop Shadow adding, Reflection shadow,Natural shadow
Photo Retouching Service
Photo Retouching, Glamour Retouching.

Our Service is 24-48 hours but we can deliver the images sooner in case of
emergency.

We can give you editing test on your photos.
We do unlimited revisions until you are satisfied with the work.

Thanks,
Jan Williams



Re: Logspam with "two consecutive events of type space" on gpio-ir-recv and meson-ir

2018-07-26 Thread Matthias Reichl
Hi Sean,

On Wed, Jul 25, 2018 at 09:21:00PM +0100, Sean Young wrote:
> Hi Hias,
> 
> On Sat, Jul 21, 2018 at 09:04:21PM +0200, Matthias Reichl wrote:
> > Hi Sean,
> > 
> > I noticed that on 4.18-rc5 I get dmesg logspam with
> > "rc rc0: two consecutive events of type space" on gpio-ir-recv
> > and meson-ir - mceusb seems to be fine (haven't tested with
> > other IR receivers yet).
> 
> This does not have a proper fix yet, however we have a workaround
> here:
> 
> https://git.linuxtv.org/media_tree.git/commit/?h=fixes=0ca54b29054151b7a52cbb8904732280afe5a302

Ah, thanks a lot for the pointer, must have missed the discussion
and patch on the list.

The workaround looks fine to me and should be good enough for now.

so long,

Hias


Re: [git:media_tree/master] media: uvcvideo: Add KSMedia 8-bit IR format support

2018-07-26 Thread Paul Menzel
Dear Mauro,


On 07/26/18 17:03, Mauro Carvalho Chehab wrote:
> This is an automatic generated email to let you know that the following patch 
> were queued:
> 
> Subject: media: uvcvideo: Add KSMedia 8-bit IR format support
> Author:  Laurent Pinchart 
> Date:Wed Mar 21 05:16:40 2018 -0400
> 
> Add support for the 8-bit IR format GUID defined in the Microsoft Kernel
> Streaming Media API.
> 
> Reported-by: Paul Menzel 
> Signed-off-by: Laurent Pinchart 
> Tested-by: Paul Menzel 
> Signed-off-by: Mauro Carvalho Chehab 
> 
>  drivers/media/usb/uvc/uvc_driver.c | 5 +
>  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
>  2 files changed, 8 insertions(+)

[…]

Thank you very much for accepting Laurent’s patch. Could you please tag
this for the stable series (Cc: sta...@vger.kernel.org)?


Kind regards,

Paul



smime.p7s
Description: S/MIME Cryptographic Signature


media: dvbsky: issues with DVBSky T680CI

2018-07-26 Thread Peter
Hi Mauro,

the last two commits on drivers/media/usb/dvb-usb-v2/dvbsky.c have negative 
effects on the operation of the DVBSky T680CI. With kernel 4.18-rc6, but 
commits 7d95fb746c4eece67308f1642a666ea1ebdbd2cc and 
14f4eaeddabce65deba2e1346efccf80f666f7b7 undone the device works.

Commit 14f4eaed ("media: dvbsky: fix driver unregister logic") causes the 
following:
After disconnecting the T680CI /dev/dvb/adapter0/frontend0 still exits. So, if 
connected again it cannot create a frontend:

[  560.756035] usb 2-3: new high-speed USB device number 4 using xhci_hcd
[  561.100030] usb 2-3: dvb_usb_v2: found a 'DVBSky T680CI' in warm state
[  561.100205] usb 2-3: dvb_usb_v2: will pass the complete MPEG2 transport 
stream to the software demuxer
[  561.100220] dvbdev: DVB: registering new adapter (DVBSky T680CI)
[  561.101426] usb 2-3: dvb_usb_v2: MAC address: xx:xx:xx:xx:xx:xx
[  561.109404] i2c i2c-8: Added multiplexed i2c bus 9
[  561.109410] si2168 8-0064: Silicon Labs Si2168-B40 successfully identified
[  561.109414] si2168 8-0064: firmware version: B 4.0.2
[  561.112485] si2157 9-0060: Silicon Labs Si2147/2148/2157/2158 successfully 
attached
[  561.119145] sp2 8-0040: CIMaX SP2 successfully attached
[  561.119161] usb 2-3: DVB: registering adapter 0 frontend 0 (Silicon Labs 
Si2168)...

[  561.119174] sysfs: cannot create duplicate filename '/class/dvb/
dvb0.frontend0'
[  561.119178] CPU: 0 PID: 17859 Comm: kworker/0:2 Not tainted 4.18.0-rc6 #1
[  561.119180] Hardware name: LENOVO 20BWS49800/20BWS49800, BIOS JBET70WW 
(1.34 ) 06/15/2018
[  561.119186] Workqueue: usb_hub_wq hub_event
[  561.119189] Call Trace:
[  561.119197]  dump_stack+0x46/0x5b
[  561.119202]  sysfs_warn_dup+0x51/0x60
[  561.119207]  sysfs_do_create_link_sd.isra.2+0x87/0xa0
[  561.119210]  device_add+0x2c9/0x630
[  561.119214]  device_create_groups_vargs+0xd8/0xe0
[  561.119218]  device_create+0x44/0x60
[  561.119223]  ? _cond_resched+0x10/0x40
[  561.119228]  ? kmem_cache_alloc_trace+0x159/0x160
[  561.119234]  dvb_register_device+0x21f/0x2b0 [dvb_core]
[  561.119240]  dvb_register_frontend+0x18c/0x220 [dvb_core]
[  561.119246]  ? dvb_usbv2_probe+0xb55/0x11b0 [dvb_usb_v2]
[  561.119249]  dvb_usbv2_probe+0xb55/0x11b0 [dvb_usb_v2]
[  561.119254]  usb_probe_interface+0xfc/0x300
[  561.119258]  driver_probe_device+0x2ec/0x4c0
[  561.119261]  ? __driver_attach+0x110/0x110
[  561.119263]  bus_for_each_drv+0x61/0xa0
[  561.119267]  __device_attach+0xd4/0x150
[  561.119270]  bus_probe_device+0x85/0xa0
[  561.119273]  device_add+0x40b/0x630
[  561.119276]  usb_set_configuration+0x4fb/0x8a0
[  561.119281]  generic_probe+0x23/0x70
[  561.119284]  driver_probe_device+0x2ec/0x4c0
[  561.119287]  ? __driver_attach+0x110/0x110
[  561.119289]  bus_for_each_drv+0x61/0xa0
[  561.119292]  __device_attach+0xd4/0x150
[  561.119295]  bus_probe_device+0x85/0xa0
[  561.119297]  device_add+0x40b/0x630
[  561.119301]  usb_new_device+0x1b3/0x3d0
[  561.119305]  hub_event+0x7a2/0x16e0
[  561.119310]  process_one_work+0x1cf/0x3f0
[  561.119314]  worker_thread+0x28/0x3c0
[  561.119317]  ? set_worker_desc+0xb0/0xb0
[  561.119321]  kthread+0x10e/0x130
[  561.119326]  ? kthread_create_worker_on_cpu+0x70/0x70
[  561.119329]  ret_from_fork+0x35/0x40
[  561.119351] dvbdev: dvb_register_device: failed to create device 
dvb0.frontend0 (-17)

[  561.148038] rc_core: IR keymap rc-dvbsky not found
[  561.148040] Registered IR keymap rc-empty
[  561.148101] rc rc0: DVBSky T680CI as /devices/pci:00/:00:14.0/
usb2/2-3/rc/rc0
[  561.148171] input: DVBSky T680CI as /devices/pci:00/:00:14.0/
usb2/2-3/rc/rc0/input17
[  561.148345] usb 2-3: dvb_usb_v2: schedule remote query interval to 300 
msecs
[  561.148351] usb 2-3: dvb_usb_v2: 'DVBSky T680CI' successfully initialized 
and connected

With commit 7d95fb74 ("media: dvbsky: use just one mutex for serializing 
device R/W ops") scanning and watching/recording of DVB-T2 channels doesn't 
work anymore (DVB-T/C not tested). Recordings are just empty files. dvbv5-scan 
outputs the following: 

$ dvbv5-scan dvb_channel.conf
Cannot calc frequency shift. Either bandwidth/symbol-rate is unavailable 
(yet).
Scanning frequency #1 49800
Lock   (0x1f) Signal= -49,00dBm C/N= 27,25dB UCB= 0 postBER= 80,2x10^-3
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #2 57800
Lock   (0x1f) Signal= -48,00dBm C/N= 32,75dB UCB= 0 postBER= 1,00
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
..

I also noticed that the module m88ds3103 is loaded automatically whenever the 
module dvb_usb_dvbsky is loaded. However, m88ds3103 is a DVB-S/S2 demodulator 
driver, but the T680CI is a DVB-T/T2/C device. Is there a reason why it is 
loaded automatically? Maybe because the dvbsky driver was written for S960/
S860 in the first place and support for T680CI was added later?

Could you please look into this? Thank you.

There 

[GIT PULL] [RESEND] urgent em28xx bug fixes for immediate merge

2018-07-26 Thread Michael Ira Krufky
...previous email failed to indicate `em28xx` branch.  My bad.  Please merge.

The following changes since commit 7ba2eb72f843fb79de1857a39f9a7e8006f8133b:

  media: dib0700: add code comment (2018-07-25 14:55:59 -0400)

are available in the Git repository at:

  ssh://mkru...@linuxtv.org:/home/mkrufky/git/dvb.git em28xx

for you to fetch changes up to f7869d3cd1705c1d7f883d364a1fe52085d219c4:

  em28xx: Remove duplicate PID (2018-07-26 07:42:52 -0400)


Brad Love (3):
  em28xx: Fix dual transport stream operation
  em28xx: Fix DualHD disconnect oops
  em28xx: Remove duplicate PID

 drivers/media/usb/em28xx/em28xx-cards.c | 6 +++---
 drivers/media/usb/em28xx/em28xx-dvb.c   | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)
On Thu, Jul 26, 2018 at 8:27 AM Michael Ira Krufky  wrote:
>
> This is a resend of https://patchwork.linuxtv.org/patch/51227/ - I
> forgot to include an email subject in the pull request :-/
>
> Hello Mauro,
>
> The following three patches from Brad Love are urgently needed for
> merge ASAP.  One just removes a duplicated PID, so it's not as
> important but should be merged ASAP nonetheless.  The other two fix an
> OOPS along with broken dual transport streaming operation.  Please
> merge ASAP.
>
> The following changes since commit 7ba2eb72f843fb79de1857a39f9a7e8006f8133b:
>
>   media: dib0700: add code comment (2018-07-25 14:55:59 -0400)
>
> are available in the Git repository at:
>
>   ssh://linuxtv.org:/home/mkrufky/git/dvb.git
>
> for you to fetch changes up to f7869d3cd1705c1d7f883d364a1fe52085d219c4:
>
>   em28xx: Remove duplicate PID (2018-07-26 07:42:52 -0400)
>
> 
> Brad Love (3):
>   em28xx: Fix dual transport stream operation
>   em28xx: Fix DualHD disconnect oops
>   em28xx: Remove duplicate PID
>
>  drivers/media/usb/em28xx/em28xx-cards.c | 6 +++---
>  drivers/media/usb/em28xx/em28xx-dvb.c   | 4 +++-
>  2 files changed, 6 insertions(+), 4 deletions(-)


[GIT PULL FOR v4.19] uvcvideo changes

2018-07-26 Thread Laurent Pinchart
Hi Mauro,

The following changes since commit 7ba2eb72f843fb79de1857a39f9a7e8006f8133b:

  media: dib0700: add code comment (2018-07-25 14:55:59 -0400)

are available in the Git repository at:

  git://linuxtv.org/pinchartl/media.git uvc/next

for you to fetch changes up to 3c3ffa7cbccc4dbb689adaf87e5186e2a71ea0fa:

  uvcvideo: Send a control event when a Control Change interrupt arrives 
(2018-07-26 15:54:22 +0300)


Guennadi Liakhovetski (3):
  uvcvideo: Remove a redundant check
  uvcvideo: Handle control pipe protocol STALLs
  uvcvideo: Send a control event when a Control Change interrupt arrives

Kieran Bingham (1):
  uvcvideo: Fix minor spelling

Laurent Pinchart (1):
  uvcvideo: Add KSMedia 8-bit IR format support

Nicolas Dufresne (1):
  uvcvideo: Also validate buffers in BULK mode

 drivers/media/usb/uvc/uvc_ctrl.c   | 215 +++-
 drivers/media/usb/uvc/uvc_driver.c |   5 ++
 drivers/media/usb/uvc/uvc_status.c | 121 ++---
 drivers/media/usb/uvc/uvc_v4l2.c   |   4 +-
 drivers/media/usb/uvc/uvc_video.c  |  62 ++---
 drivers/media/usb/uvc/uvcvideo.h   |  18 +++-
 include/uapi/linux/uvcvideo.h  |   2 +
 7 files changed, 346 insertions(+), 81 deletions(-)

-- 
Regards,

Laurent Pinchart





Re: [PATCH v9] uvcvideo: send a control event when a Control Change interrupt arrives

2018-07-26 Thread Guennadi Liakhovetski
Hi Laurent,

Thanks. Now we can get to the next one: 
https://patchwork.linuxtv.org/patch/46184/ - without that one nobody can 
get complete D4XX metadata. After I get your comments to it I'll address 
them together with Sakari's ones.

Thanks
Guennadi

On Thu, 26 Jul 2018, Laurent Pinchart wrote:

> Hi Guennadi,
> 
> Thank you for the patch.
> 
> On Thursday, 26 July 2018 11:17:53 EEST Guennadi Liakhovetski wrote:
> > From: Guennadi Liakhovetski 
> > 
> > UVC defines a method of handling asynchronous controls, which sends a
> > USB packet over the interrupt pipe. This patch implements support for
> > such packets by sending a control event to the user. Since this can
> > involve USB traffic and, therefore, scheduling, this has to be done
> > in a work queue.
> > 
> > Signed-off-by: Guennadi Liakhovetski 
> 
> Reviewed-by: Laurent Pinchart 
> 
> applied to my tree and pushed to the uvc/next branch.
> 
> > ---
> > 
> > v9:
> > - multiple optimisations and style improvements from Laurent - thanks
> > - avoid the handle rewriting race at least in cases, when the user only
> > sends a new control after receiving an event for the previous one
> > 
> > Laurent, you added a couple of comments, using DocBook markup like
> > "@param" but you didn't mark those comments for DocBook processing with
> > "/**" - I don't care that much, just wanted to check, that that was
> > intentional.
> 
> Yes, it's not worth compiling that as kerneldoc, I just wanted to mark 
> references to variable names for clarity.
> 
> >  drivers/media/usb/uvc/uvc_ctrl.c   | 211
> > - drivers/media/usb/uvc/uvc_status.c |
> > 121 ++---
> >  drivers/media/usb/uvc/uvc_v4l2.c   |   4 +-
> >  drivers/media/usb/uvc/uvcvideo.h   |  15 ++-
> >  include/uapi/linux/uvcvideo.h  |   2 +
> >  5 files changed, 286 insertions(+), 67 deletions(-)
> > 
> > diff --git a/drivers/media/usb/uvc/uvc_ctrl.c
> > b/drivers/media/usb/uvc/uvc_ctrl.c index 2a213c8..ddd069b 100644
> > --- a/drivers/media/usb/uvc/uvc_ctrl.c
> > +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> > @@ -20,6 +20,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> > 
> > @@ -971,12 +972,30 @@ static int uvc_ctrl_populate_cache(struct
> > uvc_video_chain *chain, return 0;
> >  }
> > 
> > +static s32 __uvc_ctrl_get_value(struct uvc_control_mapping *mapping,
> > +   const u8 *data)
> > +{
> > +   s32 value = mapping->get(mapping, UVC_GET_CUR, data);
> > +
> > +   if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) {
> > +   struct uvc_menu_info *menu = mapping->menu_info;
> > +   unsigned int i;
> > +
> > +   for (i = 0; i < mapping->menu_count; ++i, ++menu) {
> > +   if (menu->value == value) {
> > +   value = i;
> > +   break;
> > +   }
> > +   }
> > +   }
> > +
> > +   return value;
> > +}
> > +
> >  static int __uvc_ctrl_get(struct uvc_video_chain *chain,
> > struct uvc_control *ctrl, struct uvc_control_mapping *mapping,
> > s32 *value)
> >  {
> > -   struct uvc_menu_info *menu;
> > -   unsigned int i;
> > int ret;
> > 
> > if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0)
> > @@ -993,18 +1012,8 @@ static int __uvc_ctrl_get(struct uvc_video_chain
> > *chain, ctrl->loaded = 1;
> > }
> > 
> > -   *value = mapping->get(mapping, UVC_GET_CUR,
> > -   uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
> > -
> > -   if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) {
> > -   menu = mapping->menu_info;
> > -   for (i = 0; i < mapping->menu_count; ++i, ++menu) {
> > -   if (menu->value == *value) {
> > -   *value = i;
> > -   break;
> > -   }
> > -   }
> > -   }
> > +   *value = __uvc_ctrl_get_value(mapping,
> > +   uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
> > 
> > return 0;
> >  }
> > @@ -1216,53 +1225,135 @@ static void uvc_ctrl_fill_event(struct
> > uvc_video_chain *chain, ev->u.ctrl.default_value = v4l2_ctrl.default_value;
> >  }
> > 
> > -static void uvc_ctrl_send_event(struct uvc_fh *handle,
> > -   struct uvc_control *ctrl, struct uvc_control_mapping *mapping,
> > -   s32 value, u32 changes)
> > +/*
> > + * Send control change events to all subscribers for the @ctrl control. By
> > + * default the subscriber that generated the event, as identified by
> > @handle, + * is not notified unless it has set the
> > V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK flag. + * @handle can be NULL for
> > asynchronous events related to auto-update controls, + * in which case all
> > subscribers are notified.
> > + */
> > +static void uvc_ctrl_send_event(struct uvc_video_chain *chain,
> > +   struct uvc_fh *handle, struct uvc_control *ctrl,
> > +   struct uvc_control_mapping *mapping, s32 value, u32 changes)
> >  {
> > +   struct v4l2_fh *originator 

[PULL] urgent em28xx bug fixes for immediate merge

2018-07-26 Thread Michael Ira Krufky
This is a resend of https://patchwork.linuxtv.org/patch/51227/ - I
forgot to include an email subject in the pull request :-/

Hello Mauro,

The following three patches from Brad Love are urgently needed for
merge ASAP.  One just removes a duplicated PID, so it's not as
important but should be merged ASAP nonetheless.  The other two fix an
OOPS along with broken dual transport streaming operation.  Please
merge ASAP.

The following changes since commit 7ba2eb72f843fb79de1857a39f9a7e8006f8133b:

  media: dib0700: add code comment (2018-07-25 14:55:59 -0400)

are available in the Git repository at:

  ssh://linuxtv.org:/home/mkrufky/git/dvb.git

for you to fetch changes up to f7869d3cd1705c1d7f883d364a1fe52085d219c4:

  em28xx: Remove duplicate PID (2018-07-26 07:42:52 -0400)


Brad Love (3):
  em28xx: Fix dual transport stream operation
  em28xx: Fix DualHD disconnect oops
  em28xx: Remove duplicate PID

 drivers/media/usb/em28xx/em28xx-cards.c | 6 +++---
 drivers/media/usb/em28xx/em28xx-dvb.c   | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)


Re: [PATCH v9] uvcvideo: send a control event when a Control Change interrupt arrives

2018-07-26 Thread Laurent Pinchart
Hi Guennadi,

Thank you for the patch.

On Thursday, 26 July 2018 11:17:53 EEST Guennadi Liakhovetski wrote:
> From: Guennadi Liakhovetski 
> 
> UVC defines a method of handling asynchronous controls, which sends a
> USB packet over the interrupt pipe. This patch implements support for
> such packets by sending a control event to the user. Since this can
> involve USB traffic and, therefore, scheduling, this has to be done
> in a work queue.
> 
> Signed-off-by: Guennadi Liakhovetski 

Reviewed-by: Laurent Pinchart 

applied to my tree and pushed to the uvc/next branch.

> ---
> 
> v9:
> - multiple optimisations and style improvements from Laurent - thanks
> - avoid the handle rewriting race at least in cases, when the user only
> sends a new control after receiving an event for the previous one
> 
> Laurent, you added a couple of comments, using DocBook markup like
> "@param" but you didn't mark those comments for DocBook processing with
> "/**" - I don't care that much, just wanted to check, that that was
> intentional.

Yes, it's not worth compiling that as kerneldoc, I just wanted to mark 
references to variable names for clarity.

>  drivers/media/usb/uvc/uvc_ctrl.c   | 211
> - drivers/media/usb/uvc/uvc_status.c |
> 121 ++---
>  drivers/media/usb/uvc/uvc_v4l2.c   |   4 +-
>  drivers/media/usb/uvc/uvcvideo.h   |  15 ++-
>  include/uapi/linux/uvcvideo.h  |   2 +
>  5 files changed, 286 insertions(+), 67 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c
> b/drivers/media/usb/uvc/uvc_ctrl.c index 2a213c8..ddd069b 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
> 
> @@ -971,12 +972,30 @@ static int uvc_ctrl_populate_cache(struct
> uvc_video_chain *chain, return 0;
>  }
> 
> +static s32 __uvc_ctrl_get_value(struct uvc_control_mapping *mapping,
> + const u8 *data)
> +{
> + s32 value = mapping->get(mapping, UVC_GET_CUR, data);
> +
> + if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) {
> + struct uvc_menu_info *menu = mapping->menu_info;
> + unsigned int i;
> +
> + for (i = 0; i < mapping->menu_count; ++i, ++menu) {
> + if (menu->value == value) {
> + value = i;
> + break;
> + }
> + }
> + }
> +
> + return value;
> +}
> +
>  static int __uvc_ctrl_get(struct uvc_video_chain *chain,
>   struct uvc_control *ctrl, struct uvc_control_mapping *mapping,
>   s32 *value)
>  {
> - struct uvc_menu_info *menu;
> - unsigned int i;
>   int ret;
> 
>   if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0)
> @@ -993,18 +1012,8 @@ static int __uvc_ctrl_get(struct uvc_video_chain
> *chain, ctrl->loaded = 1;
>   }
> 
> - *value = mapping->get(mapping, UVC_GET_CUR,
> - uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
> -
> - if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) {
> - menu = mapping->menu_info;
> - for (i = 0; i < mapping->menu_count; ++i, ++menu) {
> - if (menu->value == *value) {
> - *value = i;
> - break;
> - }
> - }
> - }
> + *value = __uvc_ctrl_get_value(mapping,
> + uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
> 
>   return 0;
>  }
> @@ -1216,53 +1225,135 @@ static void uvc_ctrl_fill_event(struct
> uvc_video_chain *chain, ev->u.ctrl.default_value = v4l2_ctrl.default_value;
>  }
> 
> -static void uvc_ctrl_send_event(struct uvc_fh *handle,
> - struct uvc_control *ctrl, struct uvc_control_mapping *mapping,
> - s32 value, u32 changes)
> +/*
> + * Send control change events to all subscribers for the @ctrl control. By
> + * default the subscriber that generated the event, as identified by
> @handle, + * is not notified unless it has set the
> V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK flag. + * @handle can be NULL for
> asynchronous events related to auto-update controls, + * in which case all
> subscribers are notified.
> + */
> +static void uvc_ctrl_send_event(struct uvc_video_chain *chain,
> + struct uvc_fh *handle, struct uvc_control *ctrl,
> + struct uvc_control_mapping *mapping, s32 value, u32 changes)
>  {
> + struct v4l2_fh *originator = handle ? >vfh : NULL;
>   struct v4l2_subscribed_event *sev;
>   struct v4l2_event ev;
> 
>   if (list_empty(>ev_subs))
>   return;
> 
> - uvc_ctrl_fill_event(handle->chain, , ctrl, mapping, value, changes);
> + uvc_ctrl_fill_event(chain, , ctrl, mapping, value, changes);
> 
>   list_for_each_entry(sev, >ev_subs, node) {
> - if (sev->fh != >vfh ||
> + if (sev->fh != originator ||
>   (sev->flags & 

[no subject]

2018-07-26 Thread Michael Ira Krufky
Hello Mauro,

The following three patches from Brad Love are urgently needed for
merge ASAP.  One just removes a duplicated PID, so it's not as
important but should be merged ASAP nonetheless.  The other two fix an
OOPS along with broken dual transport streaming operation.  Please
merge ASAP.

The following changes since commit 7ba2eb72f843fb79de1857a39f9a7e8006f8133b:

  media: dib0700: add code comment (2018-07-25 14:55:59 -0400)

are available in the Git repository at:

  ssh://linuxtv.org:/home/mkrufky/git/dvb.git

for you to fetch changes up to f7869d3cd1705c1d7f883d364a1fe52085d219c4:

  em28xx: Remove duplicate PID (2018-07-26 07:42:52 -0400)


Brad Love (3):
  em28xx: Fix dual transport stream operation
  em28xx: Fix DualHD disconnect oops
  em28xx: Remove duplicate PID

 drivers/media/usb/em28xx/em28xx-cards.c | 6 +++---
 drivers/media/usb/em28xx/em28xx-dvb.c   | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)


[PATCH v9] uvcvideo: send a control event when a Control Change interrupt arrives

2018-07-26 Thread Guennadi Liakhovetski
From: Guennadi Liakhovetski 

UVC defines a method of handling asynchronous controls, which sends a
USB packet over the interrupt pipe. This patch implements support for
such packets by sending a control event to the user. Since this can
involve USB traffic and, therefore, scheduling, this has to be done
in a work queue.

Signed-off-by: Guennadi Liakhovetski 
---

v9:
- multiple optimisations and style improvements from Laurent - thanks
- avoid the handle rewriting race at least in cases, when the user only 
sends a new control after receiving an event for the previous one

Laurent, you added a couple of comments, using DocBook markup like 
"@param" but you didn't mark those comments for DocBook processing with 
"/**" - I don't care that much, just wanted to check, that that was 
intentional.

 drivers/media/usb/uvc/uvc_ctrl.c   | 211 -
 drivers/media/usb/uvc/uvc_status.c | 121 ++---
 drivers/media/usb/uvc/uvc_v4l2.c   |   4 +-
 drivers/media/usb/uvc/uvcvideo.h   |  15 ++-
 include/uapi/linux/uvcvideo.h  |   2 +
 5 files changed, 286 insertions(+), 67 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 2a213c8..ddd069b 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -971,12 +972,30 @@ static int uvc_ctrl_populate_cache(struct uvc_video_chain 
*chain,
return 0;
 }
 
+static s32 __uvc_ctrl_get_value(struct uvc_control_mapping *mapping,
+   const u8 *data)
+{
+   s32 value = mapping->get(mapping, UVC_GET_CUR, data);
+
+   if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) {
+   struct uvc_menu_info *menu = mapping->menu_info;
+   unsigned int i;
+
+   for (i = 0; i < mapping->menu_count; ++i, ++menu) {
+   if (menu->value == value) {
+   value = i;
+   break;
+   }
+   }
+   }
+
+   return value;
+}
+
 static int __uvc_ctrl_get(struct uvc_video_chain *chain,
struct uvc_control *ctrl, struct uvc_control_mapping *mapping,
s32 *value)
 {
-   struct uvc_menu_info *menu;
-   unsigned int i;
int ret;
 
if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0)
@@ -993,18 +1012,8 @@ static int __uvc_ctrl_get(struct uvc_video_chain *chain,
ctrl->loaded = 1;
}
 
-   *value = mapping->get(mapping, UVC_GET_CUR,
-   uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
-
-   if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) {
-   menu = mapping->menu_info;
-   for (i = 0; i < mapping->menu_count; ++i, ++menu) {
-   if (menu->value == *value) {
-   *value = i;
-   break;
-   }
-   }
-   }
+   *value = __uvc_ctrl_get_value(mapping,
+   uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
 
return 0;
 }
@@ -1216,53 +1225,135 @@ static void uvc_ctrl_fill_event(struct uvc_video_chain 
*chain,
ev->u.ctrl.default_value = v4l2_ctrl.default_value;
 }
 
-static void uvc_ctrl_send_event(struct uvc_fh *handle,
-   struct uvc_control *ctrl, struct uvc_control_mapping *mapping,
-   s32 value, u32 changes)
+/*
+ * Send control change events to all subscribers for the @ctrl control. By
+ * default the subscriber that generated the event, as identified by @handle,
+ * is not notified unless it has set the V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK flag.
+ * @handle can be NULL for asynchronous events related to auto-update controls,
+ * in which case all subscribers are notified.
+ */
+static void uvc_ctrl_send_event(struct uvc_video_chain *chain,
+   struct uvc_fh *handle, struct uvc_control *ctrl,
+   struct uvc_control_mapping *mapping, s32 value, u32 changes)
 {
+   struct v4l2_fh *originator = handle ? >vfh : NULL;
struct v4l2_subscribed_event *sev;
struct v4l2_event ev;
 
if (list_empty(>ev_subs))
return;
 
-   uvc_ctrl_fill_event(handle->chain, , ctrl, mapping, value, changes);
+   uvc_ctrl_fill_event(chain, , ctrl, mapping, value, changes);
 
list_for_each_entry(sev, >ev_subs, node) {
-   if (sev->fh != >vfh ||
+   if (sev->fh != originator ||
(sev->flags & V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK) ||
(changes & V4L2_EVENT_CTRL_CH_FLAGS))
v4l2_event_queue_fh(sev->fh, );
}
 }
 
-static void uvc_ctrl_send_slave_event(struct uvc_fh *handle,
-   struct uvc_control *master, u32 slave_id,
-   const struct v4l2_ext_control *xctrls, unsigned int xctrls_count)
+/*
+ * Send control change events for the slave of the @master 

vicodec: current -> cur

2018-07-26 Thread Hans Verkuil
'current' is also defined in asm-generic/current.h.

When compiling this driver for older kernels with the media_build system,
this header is included via compat.h and it no longer compiles. Rename
current to cur.

Signed-off-by: Hans Verkuil 
---
diff --git a/drivers/media/platform/vicodec/vicodec-codec.c 
b/drivers/media/platform/vicodec/vicodec-codec.c
index e880a6c5747f..2d047646f614 100644
--- a/drivers/media/platform/vicodec/vicodec-codec.c
+++ b/drivers/media/platform/vicodec/vicodec-codec.c
@@ -555,7 +555,7 @@ static int var_inter(const s16 *old, const s16 *new)
return ret;
 }

-static int decide_blocktype(const u8 *current, const u8 *reference,
+static int decide_blocktype(const u8 *cur, const u8 *reference,
s16 *deltablock, unsigned int stride,
unsigned int input_step)
 {
@@ -566,7 +566,7 @@ static int decide_blocktype(const u8 *current, const u8 
*reference,
int vari;
int vard;

-   fill_encoder_block(current, tmp, stride, input_step);
+   fill_encoder_block(cur, tmp, stride, input_step);
fill_encoder_block(reference, old, 8, 1);
vari = var_intra(tmp);



Re: [PATCH v8 2/3] uvcvideo: send a control event when a Control Change interrupt arrives

2018-07-26 Thread Guennadi Liakhovetski
Hi Laurent,

Thanks for the diff. I'm about to go over it and check your comments, but 
I cannot seem to find a git tree with your current stack. Particularly, 
you wanted to apply patches 1 and 3 from this series before applying this 
one, so, I'd prefer to work on top of the same tree as you to make sure to 
avoid rejects.

Thanks
Guennaddi

On Wed, 25 Jul 2018, Laurent Pinchart wrote:

> Hi Guennadi,
> 
> On Wednesday, 25 July 2018 20:21:54 EEST Guennadi Liakhovetski wrote:
> > On Wed, 25 Jul 2018, Laurent Pinchart wrote:
> > > On Wednesday, 18 July 2018 09:55:27 EEST Guennadi Liakhovetski wrote:
> > >> On Wed, 18 Jul 2018, Laurent Pinchart wrote:
> > >>> On Wednesday, 18 July 2018 00:30:45 EEST Guennadi Liakhovetski wrote:
> >  On Tue, 17 Jul 2018, Laurent Pinchart wrote:
> > > On Thursday, 12 July 2018 10:30:46 EEST Guennadi Liakhovetski wrote:
> > >> On Thu, 12 Jul 2018, Laurent Pinchart wrote:
> > >>> On Tuesday, 8 May 2018 18:07:43 EEST Guennadi Liakhovetski wrote:
> >  UVC defines a method of handling asynchronous controls, which
> >  sends a USB packet over the interrupt pipe. This patch implements
> >  support for such packets by sending a control event to the user.
> >  Since this can involve USB traffic and, therefore, scheduling, this
> >  has to be done in a work queue.
> >  
> >  Signed-off-by: Guennadi Liakhovetski
> >  
> >  ---
> >  
> >  v8:
> >  
> >  * avoid losing events by delaying the status URB resubmission
> >    until after completion of the current event
>   * extract control value calculation into __uvc_ctrl_get_value()
> >  * do not proactively return EBUSY if the previous control hasn't
> >    completed yet, let the camera handle such cases
> >  * multiple cosmetic changes
> >  
> >   drivers/media/usb/uvc/uvc_ctrl.c   | 166 +++--
> >   drivers/media/usb/uvc/uvc_status.c | 112 ++---
> >   drivers/media/usb/uvc/uvc_v4l2.c   |   4 +-
> >   drivers/media/usb/uvc/uvcvideo.h   |  15 +++-
> >   include/uapi/linux/uvcvideo.h  |   2 +
> >   5 files changed, 255 insertions(+), 44 deletions(-)
> >  
> >  diff --git a/drivers/media/usb/uvc/uvc_ctrl.c
> >  b/drivers/media/usb/uvc/uvc_ctrl.c index 2a213c8..796f86a 100644
> >  --- a/drivers/media/usb/uvc/uvc_ctrl.c
> >  +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> > >> 
> > >> [snip]
> > >> 
> >  +static void uvc_ctrl_status_event_work(struct work_struct *work)
> >  +{
> >  +  struct uvc_device *dev = container_of(work, struct uvc_device,
> >  +async_ctrl.work);
> >  +  struct uvc_ctrl_work *w = >async_ctrl;
> >  +  struct uvc_control_mapping *mapping;
> >  +  struct uvc_control *ctrl = w->ctrl;
> >  +  unsigned int i;
> >  +  int ret;
> >  +
> >  +  mutex_lock(>chain->ctrl_mutex);
> >  +
> >  +  list_for_each_entry(mapping, >info.mappings, list) {
> >  +  s32 value = __uvc_ctrl_get_value(mapping, w->data);
> >  +
> >  +  /*
> >  +   * So far none of the auto-update controls in the 
> >  uvc_ctrls[]
> >  +   * table is mapped to a V4L control with slaves in the
> >  +   * uvc_ctrl_mappings[] list, so slave controls so far 
> >  never
> >  have
> >  +   * handle == NULL, but this can change in the future
> >  +   */
> >  +  for (i = 0; i < ARRAY_SIZE(mapping->slave_ids); ++i) {
> >  +  if (!mapping->slave_ids[i])
> >  +  break;
> >  +
> >  +  __uvc_ctrl_send_slave_event(ctrl->handle, 
> >  w->chain,
> >  +  ctrl, 
> >  mapping->slave_ids[i]);
> >  +  }
> >  +
> >  +  uvc_ctrl_send_event(ctrl->handle, ctrl, mapping, value,
> >  +  V4L2_EVENT_CTRL_CH_VALUE);
> >  +  }
> >  +
> >  +  mutex_unlock(>chain->ctrl_mutex);
> >  +
> >  +  ctrl->handle = NULL;
> > >>> 
> > >>> Can't this race with a uvc_ctrl_set() call, resulting in
> > >>> ctrl->handle being NULL after the control gets set ?
> > >> 
> > >> Right, it's better to set .handle to NULL before sending events.
> > >> Something like
> > >> 
> > >> mutex_lock();
> > >> 
> > >> handle = ctrl->handle;
> > >> ctrl->handle = NULL;
> > >> 
> > >> list_for_each_entry() {
> > >> 
> > >>  ...
> > >>  uvc_ctrl_send_event(handle,...);
> > >> 
> > >> }
> >