Re: [comedi] Fail to use out-of-tree comedi on debian

Ian Abbott <[email protected]> Tue, 30 Sep 2025 14:25:38 +0100
Newsgroups gmane.linux.comedi
Organization MEV Ltd.
Message-ID <[email protected]>
On 30/09/2025 13:36, Ian Abbott wrote:
> On 30/09/2025 09:02, C=C3=A9dric Boudinet wrote:
>> Hello
>>
>> I would like to improve the comedi driver for the dt9812 card.
>> I a working on debian Trixie. I tried to rebuild and install using=20
>> dkms with the master version from git (https://github.com/Linux-=20
>> Comedi/ comedi/blob/master/INSTALL.md#running-comedi).
>> The build process and install works fine (modinfo loads comedi.ko.xz=20
>> and dt9812.ko.xz from /lib/modules/6.12.48+deb13-amd64/updates/dkms/).
>>
>> However when I plug the iocard, dmesg shows the following errors:
[snip]
>> And no /dev/comedi0 is created. Do you know where the problem is=20
>> coming from? Should I rebuild comedilib as well? Or maybe should I=20
>> rebuilt from the debian kernel source?
>>
>> Bests
>> Cedric
>=20
> I guess the cause is indicated by this message:
>=20
> [ 1108.696688] transfer buffer is on stack
>=20
> The Linux kernel in-tree Comedi USB drivers allocate USB command buffers=
=20
> from kmalloc memory, due to stack memory not being supported on some=20
> architectures for DMA.=C2=A0 I guess "some architectures" now includes=20
> x86-64, which it never used to.

I've pushed a commit to the Comedi GitHub repo to hopefully correct this=20
problem, based on code in the Linux kernel in-tree version of the driver=20
to replace the on-stack buffers with temporary kmalloc'ed buffers=20
(actually kzalloc to zero-fill the allocated buffers).

Please let me know if it works if you get the chance to test it.

There may be similar problems in the other out-of-tree USB Comedi=20
drivers, but I'm looking into that now.

--=20
-=3D( Ian Abbott <[email protected]> || MEV Ltd. is a company  )=3D-
-=3D( registered in England & Wales.  Regd. number: 02862268.  )=3D-
-=3D( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=3D-
-=3D( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=3D-

--=20
You received this message because you are subscribed to the Google Groups "=
Comedi: Linux Control and Measurement Device Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/comedi_list=
/a0435bf0-d901-41e0-90cd-49313fe1ff8a%40mev.co.uk.