Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (5578): Workaround for bad hardare/firmware on some pluto2 devices

pluto2_driver: Workaround for pluto2 card reporting wrong number of
received packets and flooding system with interrupts.

This patch constitutes a workaround for a hardware/firmware problem of the
pluto2-based card (e.g., Satelco EasyWatch).

It can happen in rare cases that the card gets into a mode where it
always reports back a number of received packets (nbpackets) which is
larger than the maximum permissible number of packets (TS_DMA_PACKETS).
The workaround that is already in the driver in function pluto_dma_end
reports back zero received packets. In spite of the (in reality) zero
received packets the card continues to generate interrupts at a very
high rate, which can effectively stall the system.

The patch resets the TS logic, which puts the card back into normal
operations.

Signed-off-by: Holger Magnussen <holger@muscate-magnussen.de>
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

holger@muscate-magnussen.de and committed by
Mauro Carvalho Chehab
4d845170 ba70d59b

+8
+8
drivers/media/dvb/pluto2/pluto2.c
··· 293 293 * but no packets have been transfered. 294 294 * [2] Sometimes (actually very often) NBPACKETS stays at zero 295 295 * although one packet has been transfered. 296 + * [3] Sometimes (actually rarely), the card gets into an erroneous 297 + * mode where it continuously generates interrupts, claiming it 298 + * has recieved nbpackets>TS_DMA_PACKETS packets, but no packet 299 + * has been transfered. Only a reset seems to solve this 296 300 */ 297 301 if ((nbpackets == 0) || (nbpackets > TS_DMA_PACKETS)) { 298 302 unsigned int i = 0; 299 303 while (pluto->dma_buf[i] == 0x47) 300 304 i += 188; 301 305 nbpackets = i / 188; 306 + if (i == 0) { 307 + pluto_reset_ts(pluto, 1); 308 + dev_printk(KERN_DEBUG, &pluto->pdev->dev, "resetting TS because of invalid packet counter\n"); 309 + } 302 310 } 303 311 304 312 dvb_dmx_swfilter_packets(&pluto->demux, pluto->dma_buf, nbpackets);