[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-12-14 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following changeset:

01/01: Add support for yet another DvbWorld, TeVii and Prof USB devices
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=ab7f084779b0


 Kconfig  |8 -
 dw2102.c |  456 ++-
 2 files changed, 315 insertions(+), 149 deletions(-)

Thanks,
Igor

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-12-14 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following changeset:

01/01: Add Prof 7500 DVB-S2 USB card
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=a05b1d723aac


 dvb-usb/dw2102.c |   94 ++-
 frontends/stv0900.h  |2 +
 frontends/stv0900_core.c |   87 +++
 frontends/stv0900_priv.h |   11 +
 frontends/stv0900_reg.h  |6 +++
 frontends/stv0900_sw.c   |   44 ++
 6 files changed, 226 insertions(+), 18 deletions(-)

Thanks,
Igor


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-12-13 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following changeset:

01/01: Add support for yet another DvbWorld, TeVii and Prof USB devices
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=ab7f084779b0


 Kconfig  |8 -
 dw2102.c |  456 ++-
 2 files changed, 315 insertions(+), 149 deletions(-)

Thanks,
Igor



--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-11-27 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following changeset:

01/01: Add support for yet another DvbWorld, TeVii and Prof USB devices
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=ab7f084779b0


 Kconfig  |8 -
 dw2102.c |  456 ++-
 2 files changed, 315 insertions(+), 149 deletions(-)

Thanks,
Igor


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-11-24 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following changeset:

01/01: TeVii S470 and TBS 6920 fixes
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=05e8056afc59


 b/linux/drivers/media/dvb/frontends/ds3000.c   | 1367 +
 b/linux/drivers/media/dvb/frontends/ds3000.h   |   45 
 b/linux/drivers/media/video/cx23885/cx23885-f300.c |  177 ++
 b/linux/drivers/media/video/cx23885/cx23885-f300.h |2 
 linux/drivers/media/dvb/frontends/Kconfig  |7 
 linux/drivers/media/dvb/frontends/Makefile |1 
 linux/drivers/media/video/cx23885/Kconfig  |2 
 linux/drivers/media/video/cx23885/Makefile |2 
 linux/drivers/media/video/cx23885/cx23885-cards.c  |   14 
 linux/drivers/media/video/cx23885/cx23885-core.c   |   20 
 linux/drivers/media/video/cx23885/cx23885-dvb.c|   38 
 linux/drivers/media/video/cx23885/cx23885.h|1 
 12 files changed, 1647 insertions(+), 29 deletions(-)

Thanks,
Igor


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-10-07 Thread Mauro Carvalho Chehab
Em Wed, 7 Oct 2009 00:33:10 +0300
Igor M. Liplianin liplia...@me.by escreveu:

 On 5 октября 2009 16:23:32 Mauro Carvalho Chehab wrote:
  Em Wed, 23 Sep 2009 20:47:17 +0300
 
  Igor M. Liplianin liplia...@me.by escreveu:
   Mauro,
  
   Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits
  
   for the following 2 changesets:
  
   01/02: Add support for TBS-likes remotes
   http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=c
  4e209d7decc
 
  +   { 0x1a, KEY_SHUFFLE},   /* snapshot */
 
  Snapshot should use KEY_CAMERA instead. Please see the API reference at:
  http://linuxtv.org/downloads/v4l-dvb-apis/ch17s01.html
 I will change and resend.
 
 
   02/02: Add support for TeVii remotes
   http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=4
  71f55ec066a
 
  Some keys here also seem weird to my eyes:
 
  +   { 0x41, KEY_AB},
  +   { 0x46, KEY_F1},
  +   { 0x47, KEY_F2},
  +   { 0x5e, KEY_F3},
  +   { 0x5c, KEY_F4},
  +   { 0x52, KEY_F5},
  +   { 0x5a, KEY_F6},
 
  Do you have keys labeled as AB, F1..F6 at the IR?
 Well, definitly yes.
 Howewer, it has labels satellite, provider, transponder, favorites, 
 all
 for F1 .. F5 additionally.
 KEY_AB labeled as A/B.

 
 http://murmansat.ru/dev/b/tevii-s600.jpg

That's funny. Ok, then, it shouldn't be a problem to map it as F1 to F6.

 
 
  Also, I don't like using KEY_POWER for power. Some Linux distros turn the
  computer off with this keycode. It is better to use KEY_POWER2 instead, and
  let the userspace apps (or lirc) to properly associate it to something
  useful, like finishing the media application, instead of turning the
  computer off.
 I will change it too.

Ok, thanks.
 
 
drivers/media/common/ir-keymaps.c |   99
   +- drivers/media/video/cx88/cx88-input.c
   |   26 
include/media/ir-common.h |2
3 files changed, 124 insertions(+), 3 deletions(-)
  
   Thanks,
   Igor
  
   --
   To unsubscribe from this list: send the line unsubscribe linux-media in
   the body of a message to majord...@vger.kernel.org
   More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
  Cheers,
  Mauro
 




Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-10-07 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following 2 changesets:

01/02: Add support for TBS-likes remotes
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=1a461777d5b7

02/02: Add support for TeVii remotes
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=391560bb6ac3


 drivers/media/common/ir-keymaps.c |   95 ++
 drivers/media/video/cx88/cx88-input.c |   26 -
 include/media/ir-common.h |2 
 3 files changed, 122 insertions(+), 1 deletion(-)

Thanks,
Igor

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-10-06 Thread Igor M. Liplianin
On 5 октября 2009 16:23:32 Mauro Carvalho Chehab wrote:
 Em Wed, 23 Sep 2009 20:47:17 +0300

 Igor M. Liplianin liplia...@me.by escreveu:
  Mauro,
 
  Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits
 
  for the following 2 changesets:
 
  01/02: Add support for TBS-likes remotes
  http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=c
 4e209d7decc

 +   { 0x1a, KEY_SHUFFLE},   /* snapshot */

 Snapshot should use KEY_CAMERA instead. Please see the API reference at:
   http://linuxtv.org/downloads/v4l-dvb-apis/ch17s01.html
I will change and resend.


  02/02: Add support for TeVii remotes
  http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=4
 71f55ec066a

 Some keys here also seem weird to my eyes:

 +   { 0x41, KEY_AB},
 +   { 0x46, KEY_F1},
 +   { 0x47, KEY_F2},
 +   { 0x5e, KEY_F3},
 +   { 0x5c, KEY_F4},
 +   { 0x52, KEY_F5},
 +   { 0x5a, KEY_F6},

 Do you have keys labeled as AB, F1..F6 at the IR?
Well, definitly yes.
Howewer, it has labels satellite, provider, transponder, favorites, 
all
for F1 .. F5 additionally.
KEY_AB labeled as A/B.

http://murmansat.ru/dev/b/tevii-s600.jpg


 Also, I don't like using KEY_POWER for power. Some Linux distros turn the
 computer off with this keycode. It is better to use KEY_POWER2 instead, and
 let the userspace apps (or lirc) to properly associate it to something
 useful, like finishing the media application, instead of turning the
 computer off.
I will change it too.


   drivers/media/common/ir-keymaps.c |   99
  +- drivers/media/video/cx88/cx88-input.c
  |   26 
   include/media/ir-common.h |2
   3 files changed, 124 insertions(+), 3 deletions(-)
 
  Thanks,
  Igor
 
  --
  To unsubscribe from this list: send the line unsubscribe linux-media in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html

 Cheers,
 Mauro

-- 
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-10-05 Thread Mauro Carvalho Chehab
Em Wed, 23 Sep 2009 20:47:17 +0300
Igor M. Liplianin liplia...@me.by escreveu:

 Mauro,
 
 Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits
 
 for the following 2 changesets:
 
 01/02: Add support for TBS-likes remotes
 http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=c4e209d7decc

+   { 0x1a, KEY_SHUFFLE},   /* snapshot */

Snapshot should use KEY_CAMERA instead. Please see the API reference at:
http://linuxtv.org/downloads/v4l-dvb-apis/ch17s01.html

 02/02: Add support for TeVii remotes
 http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=471f55ec066a

Some keys here also seem weird to my eyes:

+   { 0x41, KEY_AB},
+   { 0x46, KEY_F1},
+   { 0x47, KEY_F2},
+   { 0x5e, KEY_F3},
+   { 0x5c, KEY_F4},
+   { 0x52, KEY_F5},
+   { 0x5a, KEY_F6},

Do you have keys labeled as AB, F1..F6 at the IR?

Also, I don't like using KEY_POWER for power. Some Linux distros turn the
computer off with this keycode. It is better to use KEY_POWER2 instead, and let
the userspace apps (or lirc) to properly associate it to something useful, like
finishing the media application, instead of turning the computer off.
 
 
  drivers/media/common/ir-keymaps.c |   99 
 +-
  drivers/media/video/cx88/cx88-input.c |   26 
  include/media/ir-common.h |2 
  3 files changed, 124 insertions(+), 3 deletions(-)
 
 Thanks,
 Igor
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html




Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-09-23 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following 2 changesets:

01/02: Add support for TBS-likes remotes
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=c4e209d7decc

02/02: Add support for TeVii remotes
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=471f55ec066a


 drivers/media/common/ir-keymaps.c |   99 +-
 drivers/media/video/cx88/cx88-input.c |   26 
 include/media/ir-common.h |2 
 3 files changed, 124 insertions(+), 3 deletions(-)

Thanks,
Igor

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-09-19 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following changeset:

01/01: Add support for TBS-likes remotes
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=c4e209d7decc


 drivers/media/common/ir-keymaps.c |   42 +-
 drivers/media/video/cx88/cx88-input.c |   24 +++
 include/media/ir-common.h |1 
 3 files changed, 66 insertions(+), 1 deletion(-)

Thanks,
Igor

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-07-22 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following changeset:

01/01: Create card parameters array in SDMC DM1105 driver.
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=b883ce306b98


 dm1105.c |  148 ---
 1 file changed, 133 insertions(+), 15 deletions(-)

Thanks,
Igor

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-06-14 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following 4 changesets:

01/04: Remote control debugging for dw2102 driver based USB cards
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=6d3b1e91f924

02/04: Add keymaps for TeVii and TBS USB DVB-S/S2 cards
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=8ebfde1bb8d1

03/04: Add support for DVBWorld DVB-C USB Cable card.
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=3de9ad52e9af

04/04: Add support for yet another SDMC DM1105 based DVB-S card.
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=2ddb4eb239ff


 dm1105/dm1105.c  |  137 ++
 dvb-usb/dw2102.c |  334 +--
 dvb-usb/dw2102.h |1 
 3 files changed, 388 insertions(+), 84 deletions(-)

Thanks,

Igor
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-03-04 Thread Trent Piepho
On Tue, 3 Mar 2009, Mauro Carvalho Chehab wrote:
 On Mon, 2 Mar 2009 13:31:11 -0800 (PST)
 Trent Piepho xy...@speakeasy.org wrote:

 Hi Trent,

  Here's the latest patch for pluto2.  It's a much simpler chip than cx18.
  I've used atomic operations to design a lockless system.

 Did you have any return about a tester with pluto2? It would be nice to apply
 this fix, since we've reverted the alternative patch.

AFAIK, no one has tested the patch.  The only one I know with pluto2
hardware is Andreas Oberritter.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-03-03 Thread Mauro Carvalho Chehab
On Mon, 2 Mar 2009 13:31:11 -0800 (PST)
Trent Piepho xy...@speakeasy.org wrote:

Hi Trent,

 Here's the latest patch for pluto2.  It's a much simpler chip than cx18.
 I've used atomic operations to design a lockless system.

Did you have any return about a tester with pluto2? It would be nice to apply
this fix, since we've reverted the alternative patch.

Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-03-02 Thread Trent Piepho
On Sat, 28 Feb 2009, Andy Walls wrote:
 On Fri, 2009-02-27 at 21:05 +0200, Igor M. Liplianin wrote:
  On 27 ?? 2009, Igor M. Liplianin liplia...@tut.by wrote:
   On Fri, 27 Feb 2009, Igor M. Liplianin wrote:
01/02: dm1105: not demuxing from interrupt context.
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=6
   faf0753950b
  
   I'm not sure if you considered this, but the default work queue is
   multi-threaded with a kernel thread for each CPU.  This means that if the
   IRQ handler calls schedule_work() while your work function is running then
   you can get a second copy running of your work function running at the 
   same
   time.  It doesn't look like your work function uses atomit_t or locking, 
   so
   I'm guessing it's not safe to run concurrently.
  
   For the pluto2 patch, I created a single threaded work queue.  This avoids
   the concurrency problem and it's not like the demuxer can run in parallel
   anyway.  Having your own work queue also means that you don't have to 
   worry
   about latency from whatever other tasks might be in the default work 
   queue.
  
   Also consider that the work function is queued mutliple times before it
   runs, it will only run once.  I.e.  queuing a work func that's already in
   the queue does nothing (one the function starts to run, it's no longer in
   the queue and can be added again before it's finished).  The pluto2 patch 
   I
   posted didn't take this into account, but I've since fixed it.
 
  I'll return to this :)
  But it complicates things more and more :(

 Yes it does complicate things.  Here are some excerpts from what I had
 to do for cx18.  Perhaps it will help you.  (Or perhaps it will not help
 at all.  The CX23418 chip put alot of requirements on me that drove my
 solution.)

Here's the latest patch for pluto2.  It's a much simpler chip than cx18.
I've used atomic operations to design a lockless system.

If the driver runs out of DMA buffers it will set a stalled flag and not
re-enable DMA by acking the IRQ.  When the work function has run and freed
up some buffers, it will clear the stalled flag and re-enable DMA.  The
device's internal buffer will have to do while the driver is stalled to
avoid an overrun.

diff -r 960985ba30c6 -r 92fadfbb8880 linux/drivers/media/dvb/pluto2/pluto2.c
--- a/linux/drivers/media/dvb/pluto2/pluto2.c   Tue Feb 10 21:31:59 2009 +0100
+++ b/linux/drivers/media/dvb/pluto2/pluto2.c   Fri Feb 27 11:10:56 2009 -0800
@@ -23,6 +23,25 @@
  *
  */

+/*
+ * Internal Buffer:
+ * The device has an internal 4kB buffer than can hold up to 21 TS packets.  If
+ * MSKO is cleared, the device will set OVR and generate an irq if the internal
+ * buffer overflows.
+ *
+ * DMA:
+ * Data will be DMAed to the address in PCAR.  The register will auto-increment
+ * after each transfer and should not be written to during DMA.  NBPACKETS
+ * stores the number of packets transferred during the last DMA operation.  If
+ * DEM is cleared an irq will be generated after DMA and DE (and NBPACKETS)
+ * will be set.  A new DMA transfer will not start until IACK is set, so this
+ * is the time to set PCAR if needed.
+ *
+ * The AFULL almost full function is not supported.  ADEF * 2 is the almost
+ * full trigger point.  Maybe this is also the point at which a DMA operation
+ * is triggered?
+ */
+
 #include linux/i2c.h
 #include linux/i2c-algo-bit.h
 #include linux/init.h
@@ -87,13 +106,28 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr
 #define SLCS_SWC   (0x0001   0)

 #define TS_DMA_PACKETS (8)
-#define TS_DMA_BYTES   (188 * TS_DMA_PACKETS)
+#define TS_DMA_BYTES   (4096)
+#define TS_DMA_BUFFERS (2)

 #define I2C_ADDR_TDA10046  0x10
 #define I2C_ADDR_TUA6034   0xc2
 #define NHWFILTERS 8

 struct pluto {
+   /* DMA buffer, at start so it's page aligned for streaming DMA.  Each
+* buf gets its own page, as streaming DMA operates on page
+* granularity.  We only need 4k (which is usually what page size is)
+* to hold the maximum DMA size of 21 packets.  */
+   u8 dma_buf[TS_DMA_BUFFERS][PAGE_SIZE];
+
+   dma_addr_t dma_addr[TS_DMA_BUFFERS];
+   atomic_t npackets[TS_DMA_BUFFERS];
+   atomic_t dma_buf_num, dmx_buf_num;
+   unsigned long stalled;
+   struct work_struct work;
+   struct workqueue_struct *dmaq;
+   char wqname[16];
+
/* pci */
struct pci_dev *pdev;
u8 __iomem *io_mem;
@@ -116,11 +150,6 @@ struct pluto {

/* irq */
unsigned int overflow;
-
-   /* dma */
-   dma_addr_t dma_addr;
-   u8 dma_buf[TS_DMA_BYTES];
-   u8 dummy[4096];
 };

 static inline struct pluto *feed_to_pluto(struct dvb_demux_feed *feed)
@@ -232,26 +261,36 @@ static void pluto_reset_ts(struct pluto
}
 }

-static void pluto_set_dma_addr(struct pluto *pluto)
-{
-   pluto_writereg(pluto, REG_PCAR, pluto-dma_addr);
+static void 

Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-02-28 Thread Andy Walls
On Fri, 2009-02-27 at 21:05 +0200, Igor M. Liplianin wrote:
 On 27 февраля 2009, Igor M. Liplianin liplia...@tut.by wrote:
  On Fri, 27 Feb 2009, Igor M. Liplianin wrote:
   01/02: dm1105: not demuxing from interrupt context.
   http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=6
  faf0753950b
 
  I'm not sure if you considered this, but the default work queue is
  multi-threaded with a kernel thread for each CPU.  This means that if the
  IRQ handler calls schedule_work() while your work function is running then
  you can get a second copy running of your work function running at the same
  time.  It doesn't look like your work function uses atomit_t or locking, so
  I'm guessing it's not safe to run concurrently.
 
  For the pluto2 patch, I created a single threaded work queue.  This avoids
  the concurrency problem and it's not like the demuxer can run in parallel
  anyway.  Having your own work queue also means that you don't have to worry
  about latency from whatever other tasks might be in the default work queue.
 
  Also consider that the work function is queued mutliple times before it
  runs, it will only run once.  I.e.  queuing a work func that's already in
  the queue does nothing (one the function starts to run, it's no longer in
  the queue and can be added again before it's finished).  The pluto2 patch I
  posted didn't take this into account, but I've since fixed it.
 
 I'll return to this :)
 But it complicates things more and more :(


Yes it does complicate things.  Here are some excerpts from what I had
to do for cx18.  Perhaps it will help you.  (Or perhaps it will not help
at all.  The CX23418 chip put alot of requirements on me that drove my
solution.)


-
cx18-driver.h:
-

struct cx18_epu_work_order {
struct work_struct work;
atomic_t pending;
struct cx18 *cx;
unsigned long flags;
int rpu;
struct cx18_mailbox mb;
...
};

struct cx18 {
...
struct workqueue_struct *work_queue;
struct cx18_epu_work_order epu_work_order[CX18_MAX_EPU_WORK_ORDERS];
...
};



-
cx18-driver.c:
-

static int __devinit cx18_init_struct1(struct cx18 *cx)
{
int i;
...
cx-work_queue = create_singlethread_workqueue(cx-v4l2_dev.name);
if (cx-work_queue == NULL) {
CX18_ERR(Unable to create work hander thread\n);
return -ENOMEM;
}

for (i = 0; i  CX18_MAX_EPU_WORK_ORDERS; i++) {
cx-epu_work_order[i].cx = cx;
...
#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 20)
INIT_WORK(cx-epu_work_order[i].work, cx18_epu_work_handler);
#else
INIT_WORK(cx-epu_work_order[i].work, cx18_epu_work_handler,
  cx-epu_work_order[i].work);
#endif
}
...
}


#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 22)
static void cx18_cancel_epu_work_orders(struct cx18 *cx)
{
int i;
for (i = 0; i  CX18_MAX_EPU_WORK_ORDERS; i++)
cancel_work_sync(cx-epu_work_order[i].work);
}

#endif

static void cx18_remove(struct pci_dev *pci_dev)
{
...
#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 22)
cx18_sw2_irq_disable(cx, IRQ_CPU_TO_EPU_ACK | IRQ_APU_TO_EPU_ACK);

cx18_halt_firmware(cx);

cx18_cancel_epu_work_orders(cx);
#else

flush_workqueue(cx-work_queue);

cx18_sw2_irq_disable(cx, IRQ_CPU_TO_EPU_ACK | IRQ_APU_TO_EPU_ACK);

cx18_halt_firmware(cx);
#endif

destroy_workqueue(cx-work_queue);
...
}



--
cx18-irq.c:
--

static void epu_cmd(struct cx18 *cx, u32 sw1)
{
if (sw1  IRQ_CPU_TO_EPU)
cx18_api_epu_cmd_irq(cx, CPU);
if (sw1  IRQ_APU_TO_EPU)
cx18_api_epu_cmd_irq(cx, APU);
}

irqreturn_t cx18_irq_handler(int irq, void *dev_id)
{
struct cx18 *cx = (struct cx18 *)dev_id;
u32 sw1, sw2, hw2;

sw1 = cx18_read_reg(cx, SW1_INT_STATUS)  cx-sw1_irq_mask;
...
if (sw1)
cx18_write_reg_expect(cx, sw1, SW1_INT_STATUS, ~sw1, sw1);
...
if (sw1)
epu_cmd(cx, sw1);
...
}


--
cx18-mailbox.c:
--

static inline
struct cx18_epu_work_order *alloc_epu_work_order_irq(struct cx18 *cx)
{
int i;
struct cx18_epu_work_order *order = NULL;

for (i = 0; i  CX18_MAX_EPU_WORK_ORDERS; i++) {
/*
 * We only need pending atomic to inspect its contents,
 * and need not do a check and set because:
 * 1. Any work handler thread only clears pending and only
 * on one, particular work order at a time, per handler thread.
 * 2. pending is only set here, and we're serialized because
 * we're called in an IRQ handler context.
 */
 

Re: [PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-02-26 Thread Trent Piepho
On Fri, 27 Feb 2009, Igor M. Liplianin wrote:
 01/02: dm1105: not demuxing from interrupt context.
 http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=6faf0753950b

I'm not sure if you considered this, but the default work queue is
multi-threaded with a kernel thread for each CPU.  This means that if the
IRQ handler calls schedule_work() while your work function is running then
you can get a second copy running of your work function running at the same
time.  It doesn't look like your work function uses atomit_t or locking, so
I'm guessing it's not safe to run concurrently.

For the pluto2 patch, I created a single threaded work queue.  This avoids
the concurrency problem and it's not like the demuxer can run in parallel
anyway.  Having your own work queue also means that you don't have to worry
about latency from whatever other tasks might be in the default work queue.

Also consider that the work function is queued mutliple times before it
runs, it will only run once.  I.e.  queuing a work func that's already in
the queue does nothing (one the function starts to run, it's no longer in
the queue and can be added again before it's finished).  The pluto2 patch I
posted didn't take this into account, but I've since fixed it.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-02-25 Thread Igor M. Liplianin
Mauro,

Please pull from http://mercurial.intuxication.org/hg/v4l-dvb-commits

for the following 2 changesets:

01/02: dm1105: not demuxing from interrupt context.
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=6faf0753950b

02/02: dm1105: infrared remote code is remaked.
http://mercurial.intuxication.org/hg/v4l-dvb-commits?cmd=changeset;node=74fba5b3b3ae


 drivers/media/common/ir-keymaps.c |   38 ++
 drivers/media/dvb/dm1105/dm1105.c |  239 --
 include/media/ir-common.h |1
 3 files changed, 145 insertions(+), 133 deletions(-)

Thanks,
Igor
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://mercurial.intuxication.org/hg/v4l-dvb-commits

2009-01-30 Thread Igor M. Liplianin
Mauro,

Please pull from 
http://mercurial.intuxication.org/hg/v4l-dvb-commits/v4l-dvb-commits

for the following changeset:

01/01: Bug fix: Restore HVR-4000 tuning.
http://mercurial.intuxication.org/hg/v4l-dvb-commits/v4l-dvb-commits?cmd=changeset;node=0d95f94028cb


 cx24116.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Thanks,
Igor
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html