kernel-ark/drivers/media/usb/gspca
Hans de Goede 345321dc9c [media] gspca: Don't set gspca_dev->dev to NULL before stop0
In commit a3d6e8cc0e gspca_dev->dev is set
to NULL on disconnect, before calling stop0. The plan was to get rid of
gspca_dev->present and instead simply check for gspca_dev->dev everywhere
where we were checking for present. This should be race free since all users
of gspca_dev->dev hold the usb_lock, or so I thought.

But I was wrong, drivers which use a work-queue + synchronous bulk transfers
to get the video data don't hold the usb_lock while doing so, their stop0
callbacks stop the workqueue, so they won't be using gspca_dev->dev anymore
after the stop0 call, but they might be dereferincing it before, so we should
not set gspca_dev->dev to NULL on disconnect before calling stop0.

This also means that the workqueue functions in these drivers cannot
use gspca_dev->dev to check if they need to stop because of disconnection,
so we will need to keep gspca_dev->present around, and set that to 0 on
disconnect, before calling stop0. Unfortunately as part of the plan to remove
gspca_dev->present, these workqueues where already moved over to checking
for gspca_dev->dev instead of gspca_dev->present as part of commit
254902b01d, so this patch also reverts those
parts of that commit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-13 17:42:17 -03:00
..
gl860
m5602
stv06xx
autogain_functions.c
autogain_functions.h
benq.c
conex.c
cpia1.c [media] drivers/media/usb/gspca/cpia1.c: fix error return code 2012-09-13 17:42:16 -03:00
etoms.c
finepix.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00
gspca.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00
gspca.h
jeilinj.c
jl2005bcd.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00
jpeg.h
Kconfig
kinect.c
konica.c
Makefile
mars.c
mr97310a.c
nw80x.c
ov519.c
ov534_9.c
ov534.c
pac207.c
pac7302.c
pac7311.c
pac_common.h
se401.c
se401.h
sn9c20x.c
sn9c2028.c
sn9c2028.h
sonixb.c
sonixj.c
spca500.c
spca501.c
spca505.c
spca506.c
spca508.c
spca561.c
spca1528.c
sq905.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00
sq905c.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00
sq930x.c
stk014.c
stv0680.c
sunplus.c
t613.c
topro.c
tv8532.c
vc032x.c
vicam.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00
w996Xcf.c
xirlink_cit.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00
zc3xx-reg.h
zc3xx.c [media] gspca: Don't set gspca_dev->dev to NULL before stop0 2012-09-13 17:42:17 -03:00