diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2010-01-20 16:06:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:55 -0500 |
commit | b1ec9532341fafacfce8b1951c5f388eae014e16 (patch) | |
tree | 96618beaf2c3dd333418d7b7566cb64a14e1a201 /drivers | |
parent | 589816c61b74d8f16218a5ffdb95b1bf1897f65c (diff) |
V4L/DVB: ngene: Workaround for command timeout
Implement workaround for comamnd timeout.
Use FW15 and avoid switching DMA on and off.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/ngene/ngene-core.c | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c index 15d91f2ac5f9..fd665912dec3 100644 --- a/drivers/media/dvb/ngene/ngene-core.c +++ b/drivers/media/dvb/ngene/ngene-core.c | |||
@@ -59,6 +59,8 @@ MODULE_PARM_DESC(debug, "Print debugging information."); | |||
59 | 59 | ||
60 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 60 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
61 | 61 | ||
62 | #define COMMAND_TIMEOUT_WORKAROUND | ||
63 | |||
62 | #define dprintk if (debug) printk | 64 | #define dprintk if (debug) printk |
63 | 65 | ||
64 | #define DEVICE_NAME "ngene" | 66 | #define DEVICE_NAME "ngene" |
@@ -258,6 +260,27 @@ static irqreturn_t irq_handler(int irq, void *dev_id) | |||
258 | /* nGene command interface **************************************************/ | 260 | /* nGene command interface **************************************************/ |
259 | /****************************************************************************/ | 261 | /****************************************************************************/ |
260 | 262 | ||
263 | static void dump_command_io(struct ngene *dev) | ||
264 | { | ||
265 | u8 buf[8], *b; | ||
266 | |||
267 | ngcpyfrom(buf, HOST_TO_NGENE, 8); | ||
268 | printk(KERN_ERR "host_to_ngene (%04x): %02x %02x %02x %02x %02x %02x %02x %02x\n", | ||
269 | HOST_TO_NGENE, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); | ||
270 | |||
271 | ngcpyfrom(buf, NGENE_TO_HOST, 8); | ||
272 | printk(KERN_ERR "ngene_to_host (%04x): %02x %02x %02x %02x %02x %02x %02x %02x\n", | ||
273 | NGENE_TO_HOST, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); | ||
274 | |||
275 | b = dev->hosttongene; | ||
276 | printk(KERN_ERR "dev->hosttongene (%p): %02x %02x %02x %02x %02x %02x %02x %02x\n", | ||
277 | b, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]); | ||
278 | |||
279 | b = dev->ngenetohost; | ||
280 | printk(KERN_ERR "dev->ngenetohost (%p): %02x %02x %02x %02x %02x %02x %02x %02x\n", | ||
281 | b, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]); | ||
282 | } | ||
283 | |||
261 | static int ngene_command_mutex(struct ngene *dev, struct ngene_command *com) | 284 | static int ngene_command_mutex(struct ngene *dev, struct ngene_command *com) |
262 | { | 285 | { |
263 | int ret; | 286 | int ret; |
@@ -310,6 +333,7 @@ static int ngene_command_mutex(struct ngene *dev, struct ngene_command *com) | |||
310 | printk(KERN_ERR DEVICE_NAME | 333 | printk(KERN_ERR DEVICE_NAME |
311 | ": Command timeout cmd=%02x prev=%02x\n", | 334 | ": Command timeout cmd=%02x prev=%02x\n", |
312 | com->cmd.hdr.Opcode, dev->prev_cmd); | 335 | com->cmd.hdr.Opcode, dev->prev_cmd); |
336 | dump_command_io(dev); | ||
313 | return -1; | 337 | return -1; |
314 | } | 338 | } |
315 | if (com->cmd.hdr.Opcode == CMD_FWLOAD_FINISH) | 339 | if (com->cmd.hdr.Opcode == CMD_FWLOAD_FINISH) |
@@ -856,7 +880,10 @@ static void *tsin_exchange(void *priv, void *buf, u32 len, u32 clock, u32 flags) | |||
856 | struct ngene_channel *chan = priv; | 880 | struct ngene_channel *chan = priv; |
857 | 881 | ||
858 | 882 | ||
859 | dvb_dmx_swfilter(&chan->demux, buf, len); | 883 | #ifdef COMMAND_TIMEOUT_WORKAROUND |
884 | if (chan->users > 0) | ||
885 | #endif | ||
886 | dvb_dmx_swfilter(&chan->demux, buf, len); | ||
860 | return 0; | 887 | return 0; |
861 | } | 888 | } |
862 | 889 | ||
@@ -891,11 +918,6 @@ static void set_transfer(struct ngene_channel *chan, int state) | |||
891 | int ret; | 918 | int ret; |
892 | 919 | ||
893 | /* | 920 | /* |
894 | if (chan->running) | ||
895 | return; | ||
896 | */ | ||
897 | |||
898 | /* | ||
899 | printk(KERN_INFO DEVICE_NAME ": st %d\n", state); | 921 | printk(KERN_INFO DEVICE_NAME ": st %d\n", state); |
900 | msleep(100); | 922 | msleep(100); |
901 | */ | 923 | */ |
@@ -962,7 +984,10 @@ static int ngene_start_feed(struct dvb_demux_feed *dvbdmxfeed) | |||
962 | struct ngene_channel *chan = dvbdmx->priv; | 984 | struct ngene_channel *chan = dvbdmx->priv; |
963 | 985 | ||
964 | if (chan->users == 0) { | 986 | if (chan->users == 0) { |
965 | set_transfer(chan, 1); | 987 | #ifdef COMMAND_TIMEOUT_WORKAROUND |
988 | if (!chan->running) | ||
989 | #endif | ||
990 | set_transfer(chan, 1); | ||
966 | /* msleep(10); */ | 991 | /* msleep(10); */ |
967 | } | 992 | } |
968 | 993 | ||
@@ -977,7 +1002,9 @@ static int ngene_stop_feed(struct dvb_demux_feed *dvbdmxfeed) | |||
977 | if (--chan->users) | 1002 | if (--chan->users) |
978 | return chan->users; | 1003 | return chan->users; |
979 | 1004 | ||
1005 | #ifndef COMMAND_TIMEOUT_WORKAROUND | ||
980 | set_transfer(chan, 0); | 1006 | set_transfer(chan, 0); |
1007 | #endif | ||
981 | 1008 | ||
982 | return 0; | 1009 | return 0; |
983 | } | 1010 | } |
@@ -1683,6 +1710,11 @@ static void release_channel(struct ngene_channel *chan) | |||
1683 | struct ngene_info *ni = dev->card_info; | 1710 | struct ngene_info *ni = dev->card_info; |
1684 | int io = ni->io_type[chan->number]; | 1711 | int io = ni->io_type[chan->number]; |
1685 | 1712 | ||
1713 | #ifdef COMMAND_TIMEOUT_WORKAROUND | ||
1714 | if (chan->running) | ||
1715 | set_transfer(chan, 0); | ||
1716 | #endif | ||
1717 | |||
1686 | tasklet_kill(&chan->demux_tasklet); | 1718 | tasklet_kill(&chan->demux_tasklet); |
1687 | 1719 | ||
1688 | if (io & (NGENE_IO_TSIN | NGENE_IO_TSOUT)) { | 1720 | if (io & (NGENE_IO_TSIN | NGENE_IO_TSOUT)) { |
@@ -1887,7 +1919,7 @@ static struct ngene_info ngene_info_mps2 = { | |||
1887 | .tuner_config = {&tuner_mps2_0, &tuner_mps2_1}, | 1919 | .tuner_config = {&tuner_mps2_0, &tuner_mps2_1}, |
1888 | .lnb = {0x0b, 0x08}, | 1920 | .lnb = {0x0b, 0x08}, |
1889 | .tsf = {3, 3}, | 1921 | .tsf = {3, 3}, |
1890 | .fw_version = 17, | 1922 | .fw_version = 15, |
1891 | }; | 1923 | }; |
1892 | 1924 | ||
1893 | static struct ngene_info ngene_info_satixs2 = { | 1925 | static struct ngene_info ngene_info_satixs2 = { |
@@ -1900,7 +1932,7 @@ static struct ngene_info ngene_info_satixs2 = { | |||
1900 | .tuner_config = {&tuner_mps2_0, &tuner_mps2_1}, | 1932 | .tuner_config = {&tuner_mps2_0, &tuner_mps2_1}, |
1901 | .lnb = {0x0b, 0x08}, | 1933 | .lnb = {0x0b, 0x08}, |
1902 | .tsf = {3, 3}, | 1934 | .tsf = {3, 3}, |
1903 | .fw_version = 17, | 1935 | .fw_version = 15, |
1904 | }; | 1936 | }; |
1905 | 1937 | ||
1906 | /****************************************************************************/ | 1938 | /****************************************************************************/ |