RE: working files from Interupt routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

  Thanks for your reply.

I can’t use Tasklet because I called this function from Netfilter hook function. Is there any way to solve this problem?

 

With Thanks & Regards,
K. Lekshmanan


From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Martin Candurra
Sent: Thursday, January 17, 2008 10:34 PM
To: Matthias Kaehlcke
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: working files from Interupt routine

 

Writing to a file probably puts the process to sleep. That is not possible if you are in an interrupt context,

even if you could, the idea of an interrupt handler is to be as quick as possible.

 

You have to use Tasklets for what you want to do. You can check how to use it from Linux Device Drivers book.

 

Regards.



 

On 1/17/08, Matthias Kaehlcke <matthias@xxxxxxxxxxxx> wrote:

El Thu, Jan 17, 2008 at 05:49:32PM +0530 Kathiresan, Lekshmanan ha dit:

>
>          I have written code to create ordinary file from Linux kernel
>    module. This code is working fine in normal execution, but its hangs when
>    this function called from hook function or ISR.
>
>    Please advice me, what should I do to solve this problem.
>
>        Suppose if I remove variable arguments from this function. Its give
>    error "Failed to write". This problem comes only when I call from hook or
>    ISR.

Writing a file from an ISR doesn't sound like a good idea to me. I
suppose your problem is that your code blocks in vfs_write() or one of
the other calls that might block. I think you'd do better writing to a
(preallocated) buffer and write this buffer in a non-atomic context
where sleeping is allowed.

--
Matthias Kaehlcke
Linux System Developer
Barcelona

    The assumption that what currently exists must necessarily
     exist is the acid that corrodes all visionary thinking
                                                                .''`.
   using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                               `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ

 


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux