[Linux-parport] calling request_resource

John Heim john at johnheim.net
Sat Feb 25 18:40:43 EST 2012


I’m sorry this is a little off topic but I’m pretty desperate. I need to find out where I can get help fixing a bug in a kernel module for a serial device. The bug is in the driver for a speech synthesizer. I’ve already emailed the original developer and he is not interested in continuing to work on the driver.  I’m blind and I need my hardware speech synthesizer to work. 

I’ve traced the bug to code that calls the function request_resource. The code for the request_region function says its copyright Linus Torvalds so I’m guessing its part of the linux core functions. Below is a code snippet that is like the code that is failing. An error code of –16 is always returned.  According to the comments in the driver module, this code is supposed to “steal” the serial port.   But it gets the -16 error code and errors out.  

int error;
struct resource myres;
myres.name = "ltlk";
myres.start = 0x3F8;
    myres.end = 0x3FF;
    myres.flags = IORESOURCE_BUSY;
    error = request_resource (&ioport_resource, &myres);

The actual code is in drivers/staging/speakup/synth.c. Its not exactly like the code snippet above but it does exactly the same thing. I pasted this code into the module, recompiled the kernel, and it has all the same values and has the same result. So if anyone could tell me what’s wrong with the above code, I could probably fix the real code.But if you want to look at the real code its in the kernel code in drivers/staging/speakup/synth.c.

The code in the driver module has not changed. They must have changed something elsewhere in the kernel code that broke this module. I don’t know exactly when it started happening but it was sometime after 2.6.32 and before 2.6.37.  The problem applies only to 64 bit hardware but it doesn’t matter if the kernel is compiled for 686 or amd64. So, for example, I can get speech with the 32-bit version of the  grml live CD on a 32 bit machine but not on a 64 bit machine. And I can’t get speech at all with the 64 bit grml CD. Same is true for stock debian kernels and kernels I compile myself.  But a 2.6.32-amd64 stock debian kernel does work. 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-parport/attachments/20120225/2eb0c86d/attachment.html>


More information about the Linux-parport mailing list