[linux-dvb] [PATCH] budget_av / dvb_ca_en50221: fixes ci/cam handling especially on SMP machines

Oliver Endriss o.endriss at gmx.de
Sat Aug 23 22:58:39 CEST 2008

Matthias Dahl wrote:
> Hi Oliver.
> I can happily report that with the following two patches applied, I haven't 
> seen a single case where the cam stopped working due to i/o errors or 
> anything like it.
> The budget_av patch is basically your patch just a bit extended which I 
> thought was necessary to cover all relevant cases. Works just fine.
> The dvb_ca_en50221 patch introduces the concept of slot lock that means, you 
> can either read or write to a slot but concurrent i/o on a slot is no longer 
> allowed. This case was already thought of and partly taken care of but 
> unfortunately due to the missing locking mechanism, it just made the race 
> condition harder to trigger but not impossible... especially on SMP systems 
> where this is easier to hit. That's way I introduced a mutex. I left the 
> original check in there but it actually never should get triggered anymore. 
> Right now actually, if it gets triggered, one could assume the ci/cam is in 
> an undefined state and trigger a reinit, like it's done on a few other 
> places.
> Could you please apply those patches to the dvb tree and maybe get into the 
> official 2.6.27? Those bugs haven been around for quite some time now and 
> without the patches, they are not so hard to trigger.

Finally I had some time to review your patches.

Could you please elaborate why 
- ciintf_slot_ts_enable
- ciintf_slot_shutdown
require locking? I cannot see that.

Ok, although I doubt that it will make any difference, because the
routine will kill tuner and CI interface anyway...

Hm, I think my version was also correct.

Ok. but I need your signed-off-by for this patch.

Btw, wouldn't it be better to remove the locking stuff from budget-av.c,
and do all locking in dvb_ca_en50221.c?

Imho this would be a far better solution (only one mutex, not two).
Could you implement that?


VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/

More information about the linux-dvb mailing list