[linux-dvb] Updated Mantis VP-2033 remote control patch for Manu's jusst.de Mantis branch

Markus Rechberger mrechberger at gmail.com
Sat May 17 01:21:27 CEST 2008

Hi Pauli,

On 5/17/08, Pauli Borodulin <pauli at borodulin.fi> wrote:
> Heya!
> Since there has been some direct requests for this via email, I'm
> posting a updated version of Kristian Slavov's original remote control
> patch[1] for Manu's jusst.de Mantis branch. The new version is
> functionally the same as the one I posted in March[2].
> I have adapted the patch for the current driver tree and moved ir_codes
> back to ir-keymaps.c & ir-common.h to follow the standard kernel
> procedure for the IR stuff. The patch is against the current driver tree
> (cd1fc4c7f1d8).
> [1] http://www.linuxtv.org/pipermail/linux-dvb/2007-April/017279.html
> [2] http://www.linuxtv.org/pipermail/linux-dvb/2008-March/024301.html
> Regards,
> Pauli Borodulin
+int mantis_rc_exit(struct mantis_pci *mantis)
 +        mmwrite(mmread(MANTIS_INT_MASK) & (~MANTIS_INT_IRQ1),
 +        cancel_delayed_work(&mantis->ir.rc_query_work);
 +        input_unregister_device(mantis->ir.rc_dev);
 +        dprintk(verbose, MANTIS_DEBUG, 1, "RC unregistered");
 +        return 0;

this might be dangerous when unloading the driver because the callback
function might still be running after cancel_delayed_work.
I ran into that problem a while ago and it could lock up the whole input system.

There's also a note in the kernelheaders:
 * Kill off a pending schedule_delayed_work().  Note that the work callback
 * function may still be running on return from cancel_delayed_work().  Run
 * flush_scheduled_work() to wait on it.


More information about the linux-dvb mailing list