kernel-ark/drivers
Trent Piepho e42af83f48 V4L/DVB (5887): zr36067: Fix poll() operation
During uncompressed capture, the poll() function was looking the wrong frame.
It was using the frame the driver was going to capture into next (pend_tail),
when it should have been looking at the next frame to be de-queued with
DQBUF/SYNC (sync_tail).

It also wasn't looking in the right spot.  It was looking at the file handle's
copy of the buffer status, rather than the driver core copy.  The interrupt
routine marks frames as done in the driver core copy, the file handle copy
isn't updated.  So even if poll() looked at the right frame, it would never
see it transition to done and return POLLIN.

The compressed capture code has this same problem, looking in fh->jpg_buffers
when it should have used zr->jpg_buffers.

There was some logic to detect when there was no current capture in process
nor any frames queued and try to return an error, which ends up being a bad
idea.  It's possible to call select() from one thread while no capture is in
process, or no frames queued, and then start a capture or queue frames from
another thread.

The buffer state variables are protected by a spin lock, which the code wasn't
acquiring.  That is fixed too.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-30 16:26:24 -03:00
..
acorn
acpi ACPI: restore CONFIG_ACPI_SLEEP 2007-07-29 16:53:59 -07:00
amba
ata
atm
auxdisplay
base Introduce CONFIG_SUSPEND for suspend-to-Ram and standby 2007-07-29 16:45:38 -07:00
block Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n 2007-07-29 17:37:45 -07:00
bluetooth
cdrom
char Remove fs.h from mm.h 2007-07-29 17:09:29 -07:00
clocksource
connector
cpufreq
crypto
dio
dma
edac drivers/edac: fix pasemi kconfig depends 2007-07-26 11:35:18 -07:00
eisa
fc4
firewire
firmware
hid
hwmon
i2c Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION 2007-07-29 16:45:38 -07:00
ide drivers/ misc __iomem annotations 2007-07-26 11:11:57 -07:00
ieee1394 raw1394 __user annotation 2007-07-26 11:11:57 -07:00
infiniband Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2007-07-29 17:22:03 -07:00
input Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6 2007-07-28 19:33:04 -07:00
isdn
kvm KVM: disable writeback for 0x0f 0x01 instructions. 2007-07-25 14:31:27 +03:00
leds
lguest Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n 2007-07-29 17:37:45 -07:00
macintosh
mca
md
media V4L/DVB (5887): zr36067: Fix poll() operation 2007-07-30 16:26:24 -03:00
message Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2007-07-29 17:22:03 -07:00
mfd
misc Pull auto-load-modules into release branch 2007-07-25 01:36:53 -04:00
mmc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc 2007-07-26 14:00:56 -07:00
mtd sun userflash is PCI-dependent 2007-07-26 11:11:56 -07:00
net setup and detect 2nd phy on MCF5275 in FEC driver 2007-07-30 10:52:09 -07:00
nubus
of
oprofile
parisc
parport
pci ACPI: restore CONFIG_ACPI_SLEEP 2007-07-29 16:53:59 -07:00
pcmcia
pnp ACPI: restore CONFIG_ACPI_SLEEP 2007-07-29 16:53:59 -07:00
power
ps3
rapidio
rtc Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6 2007-07-28 19:33:04 -07:00
s390 [S390] Fix sclp_vt220 error handling. 2007-07-27 12:29:20 +02:00
sbus [SPARC64]: Fix conflicts in SBUS/PCI/EBUS/ISA DMA handling. 2007-07-30 00:27:34 -07:00
scsi Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2007-07-29 17:22:03 -07:00
serial m68knommu: fix workqueues in 68328 serial driver 2007-07-25 11:05:01 -07:00
sh
sn
spi fixup s3c24xx build after arch moves 2007-07-26 11:35:16 -07:00
tc
telephony
uio
usb
video [SPARC]: Mark SBUS framebuffer ioctls as IGNORE in compat_ioctl.c 2007-07-30 00:27:36 -07:00
w1 drivers/ misc __iomem annotations 2007-07-26 11:11:57 -07:00
xen xenbus_xs.c: fix a use-after-free 2007-07-26 11:35:17 -07:00
zorro
Kconfig
Makefile