public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2)
@ 2011-11-13 23:17 Ninja
  0 siblings, 0 replies; 7+ messages in thread
From: Ninja @ 2011-11-13 23:17 UTC (permalink / raw)
  To: linux-media

Hi,

I'm using a Technisat Skystar HD2 (DVB-S2) with a CI Module under Ubuntu 
11.04.
As some people already noticed, the mantis_ca_init() is never called to 
initialize the CAM.
Since s2-liplianin used almost the same code, I basically just put the 
mantis_ca_init back in,
which is working quite good. But I hope somebody can help me to remove a 
bug rendering the driver not SMP safe,
since I believe my work around for this makes the driver less reliable.

First of all the description of the bug:
I'm using a dual core cpu and noticed that I don't get all the interrupt 
i should get when writing to/ reading from the card using a function 
which uses "mantis_hif_sbuf_opdone_wait" in "mantis_hif.c".
This leads to the 500 ms timeout. Interesting enough, when reading the 
data despite the timeout, the data is valid and available. Using 
max_cpus=1 parameter when starting ubuntu 11.04 solves the problem; all 
interrupts are received and no timeout occurs.
In addition to this, i think the return value of "msecs_to_jiffies" 
changed with some kernel update an thus "mantis_hif_sbuf_opdone_wait" 
never returns an error.
How hope someone can help figuraing out, why the card send less 
interrupt on SMP enabled machines. I know the core which handles the IRQ 
can change, but even all the IRQs from all core are less than when 
disabling SMP.

Now the description how I added the CI support again:

File mantis_hif.c (workaround for the SMP bug):
- Change the call from msecs_to_jiffies(500) to msecs_to_jiffies(2) in 
function "mantis_hif_sbuf_opdone_wait" (we just get the data after 2 ms, 
regardless if we got the data ready IRQ or not).

File mantis_pci.c:
- Move the function set_direction from mantis_core.c to mantis_pci.c (I 
tried to just add the forward declaration to mantis_core.h, but I 
couldn't get it to work...)
- Add its function declaration to mantis_pci.h (extern void 
mantis_set_direction(struct mantis_pci *mantis, int direction);).
- Add "mantis_set_direction(mantis, 0);" after "mantis->revision = 
pdev->revision;" in function "mantis_pci_init".
- Add "mmwrite(0x00, MANTIS_INT_MASK);" before "err = 
request_irq(pdev->irq,"... in function "mantis_pci_init".

File mantis_ca.c:
- Add the include #include "mantis_pci.h"
- Comment in "mantis_set_direction(mantis, 1);" in function 
"mantis_ts_control" in file mantis_ca.c

File manits_dvb.c:
- Add the function call "mantis_ca_init(mantis);" right before the 
return 0 in function "mantis_dvb_init".
- Add th function call "mantis_ca_exit(mantis);" right before 
"tasklet_kill(&mantis->tasklet);" in function "mantis_dvb_exit".

Regards,
Manuel


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2)
@ 2011-11-13 23:29 Ninja
  2011-12-09 23:57 ` Ninja
  0 siblings, 1 reply; 7+ messages in thread
From: Ninja @ 2011-11-13 23:29 UTC (permalink / raw)
  To: linux-media

Hi,

I'm using a Technisat Skystar HD2 (DVB-S2) with a CI Module under Ubuntu 
11.04.
As some people already noticed, the mantis_ca_init() is never called to 
initialize the CAM.
Since s2-liplianin used almost the same code, I basically just put the 
mantis_ca_init back in,
which is working quite good. But I hope somebody can help me to remove a 
bug rendering the driver not SMP safe,
since I believe my work around for this makes the driver less reliable.

First of all the description of the bug:
I'm using a dual core cpu and noticed that I don't get all the interrupt 
i should get when writing to/ reading from the card using a function 
which uses "mantis_hif_sbuf_opdone_wait" in "mantis_hif.c".
This leads to the 500 ms timeout. Interesting enough, when reading the 
data despite the timeout, the data is valid and available. Using 
max_cpus=1 parameter when starting ubuntu 11.04 solves the problem; all 
interrupts are received and no timeout occurs.
In addition to this, i think the return value of "msecs_to_jiffies" 
changed with some kernel update an thus "mantis_hif_sbuf_opdone_wait" 
never returns an error.
How hope someone can help figuraing out, why the card send less 
interrupt on SMP enabled machines. I know the core which handles the IRQ 
can change, but even all the IRQs from all core are less than when 
disabling SMP.

Now the description how I added the CI support again:

File mantis_hif.c (workaround for the SMP bug):
- Change the call from msecs_to_jiffies(500) to msecs_to_jiffies(2) in 
function "mantis_hif_sbuf_opdone_wait" (we just get the data after 2 ms, 
regardless if we got the data ready IRQ or not).

File mantis_pci.c:
- Move the function set_direction from mantis_core.c to mantis_pci.c (I 
tried to just add the forward declaration to mantis_core.h, but I 
couldn't get it to work...)
- Add its function declaration to mantis_pci.h (extern void 
mantis_set_direction(struct mantis_pci *mantis, int direction);).
- Add "mantis_set_direction(mantis, 0);" after "mantis->revision = 
pdev->revision;" in function "mantis_pci_init".
- Add "mmwrite(0x00, MANTIS_INT_MASK);" before "err = 
request_irq(pdev->irq,"... in function "mantis_pci_init".

File mantis_ca.c:
- Add the include #include "mantis_pci.h"
- Comment in "mantis_set_direction(mantis, 1);" in function 
"mantis_ts_control" in file mantis_ca.c

File manits_dvb.c:
- Add the function call "mantis_ca_init(mantis);" right before the 
return 0 in function "mantis_dvb_init".
- Add th function call "mantis_ca_exit(mantis);" right before 
"tasklet_kill(&mantis->tasklet);" in function "mantis_dvb_exit".

Regards,
Manuel


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2)
@ 2011-11-13 19:30 Ninja
  0 siblings, 0 replies; 7+ messages in thread
From: Ninja @ 2011-11-13 19:30 UTC (permalink / raw)
  To: linux-media

Hi,

I'm using a Technisat Skystar HD2 (DVB-S2) with a CI Module under Ubuntu 
11.04.
As some people already noticed, the mantis_ca_init() is never called to 
initialize the CAM.
Since s2-liplianin used almost the same code, I basically just put the 
mantis_ca_init back in,
which is working quite good. But I hope somebody can help me to remove a 
bug rendering the driver not SMP safe,
since I believe my work around for this makes the driver less reliable.

First of all the description of the bug:
I'm using a dual core cpu and noticed that I don't get all the interrupt 
i should get when writing to/ reading from the card using a function 
which uses "mantis_hif_sbuf_opdone_wait" in "mantis_hif.c".
This leads to the 500 ms timeout. Interesting enough, when reading the 
data despite the timeout, the data is valid and available. Using 
max_cpus=1 parameter when starting ubuntu 11.04 solves the problem; all 
interrupts are received and no timeout occurs.
In addition to this, i think the return value of "msecs_to_jiffies" 
changed with some kernel update an thus "mantis_hif_sbuf_opdone_wait" 
never returns an error.
How hope someone can help figuraing out, why the card send less 
interrupt on SMP enabled machines. I know the core which handles the IRQ 
can change, but even all the IRQs from all core are less than when 
disabling SMP.

Now the description how I added the CI support again:

File mantis_hif.c (workaround for the SMP bug):
- Change the call from msecs_to_jiffies(500) to msecs_to_jiffies(2) in 
function "mantis_hif_sbuf_opdone_wait" (we just get the data after 2 ms, 
regardless if we got the data ready IRQ or not).

File mantis_pci.c:
- Move the function set_direction from mantis_core.c to mantis_pci.c (I 
tried to just add the forward declaration to mantis_core.h, but I 
couldn't get it to work...)
- Add its function declaration to mantis_pci.h (extern void 
mantis_set_direction(struct mantis_pci *mantis, int direction);).
- Add "mantis_set_direction(mantis, 0);" after "mantis->revision = 
pdev->revision;" in function "mantis_pci_init".
- Add "mmwrite(0x00, MANTIS_INT_MASK);" before "err = 
request_irq(pdev->irq,"... in function "mantis_pci_init".

File mantis_ca.c:
- Add the include #include "mantis_pci.h"
- Comment in "mantis_set_direction(mantis, 1);" in function 
"mantis_ts_control" in file mantis_ca.c

File manits_dvb.c:
- Add the function call "mantis_ca_init(mantis);" right before the 
return 0 in function "mantis_dvb_init".
- Add th function call "mantis_ca_exit(mantis);" right before 
"tasklet_kill(&mantis->tasklet);" in function "mantis_dvb_exit".

Regards,
Manuel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-12-16  8:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-13 23:17 Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2) Ninja
  -- strict thread matches above, loose matches on Subject: below --
2011-11-13 23:29 Ninja
2011-12-09 23:57 ` Ninja
2011-12-12 11:08   ` Marko Ristola
2011-12-13 21:30     ` Ninja
2011-12-16  8:10       ` Ninja
2011-11-13 19:30 Ninja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox