All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ninja <Ninja15@gmx.de>
To: linux-media@vger.kernel.org
Subject: Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2)
Date: Mon, 14 Nov 2011 00:17:56 +0100	[thread overview]
Message-ID: <4EC05024.6050509@gmx.de> (raw)

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


             reply	other threads:[~2011-11-13 23:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-13 23:17 Ninja [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-13 23:29 Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2) 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EC05024.6050509@gmx.de \
    --to=ninja15@gmx.de \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.