Re: copy to/from user with irq disabled

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

 



Le Thu, 7 Feb 2008 18:19:07 +0200,
"Ramagudi Naziir" <naziirr@xxxxxxxxx> a écrit :

> in  iw_handler.h... and tried to understand why it is a problem..

This is a problem because copy_to_user() and copy_from_user() can
block. So you're not allowed to use them in an atomic context
(interrupt handler or tasklet).

From Linux Device Drivers, chapter 3, speaking about copy_to_user() and
copy_from_user() :

«
Although these functions behave like normal memcpy functions, a little
extra care must be used when accessing user space from kernel code. The
user pages being addressed might not be currently present in memory,
and the virtual memory sub- system can put the process to sleep while
the page is being transferred into place. This happens, for example,
when the page must be retrieved from swap space.
»

Sincerly,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)

Attachment: signature.asc
Description: PGP signature


[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