[Rtai] magma patchlinuxcomedi and the quatech_daqp_cs driver

Ian Abbott abbotti at mev.co.uk
Thu Mar 3 13:18:59 CET 2011


In 2.6.37 at least, drivers/staging/comedi/drivers/quatech_daqp_cs.c is
the only comedi pcmcia driver that uses pcmcia_request_irq().
Unfortunately, magma's addons/comedi/patchlinuxcomedi script edits this
to pcmcia_comedi_request_irq(), which doesn't exist so the kernel build
fails at this point.

pcmcia_request_irq() is a wrapper around request_irq() that arranges for
free_irq() to be called automatically by pcmcia_disable_device().
According to the comments for pcmcia_request_irq(), drivers are free to
call request_irq() instead (as long as they use IRQF_SHARED), but then
they need to call free_irq() by themselves.

The only workaround for this I can think of (apart from disabling this
driver in the kernel config) is to patch the quatech_daqp_cs driver to
use request_irq() and free_irq() before running the patchlinuxcomedi
script.  Perhaps this patch could be incorporated in the magma kernel
patches.

This patch would probably work for 2.6.35 and 2.6.36 kernels as well as
2.6.37.  It wouldn't apply to earlier kernels though, due to the large
amount of pcmcia driver API changes that have occurred in the last few
kernel versions.  Anyway, the patch is attached (if attachments are
allowed on this list).

Alternatively, a much simpler (but not real-time) option is to put a
macro in comedi_system.h (created by the patchlinuxcomedi script) to
expand pcmcia_comedi_request_irq back to pcmcia_request_irq.  It would
have the advantage of working for older kernel versions too.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: magma-2.6.37-quatech_daqp_cs-irq.patch
Type: text/x-patch
Size: 1492 bytes
Desc: not available
URL: <http://mail.rtai.org/pipermail/rtai/attachments/20110303/51582ce1/attachment.bin>


More information about the Rtai mailing list