Re: copy_to/from_user and a bottom half

From: Andi Kleen (ak@suse.de)
Date: Thu May 18 2000 - 14:45:02 EDT

  • Next message: egger@suse.de: "Re: Linux on the TI-89/92[+]???"

    Alex Ivchenko <aivchenko@ueidaq.com> writes:

    > Hi,
    >
    > I tried to speed up a driver and moved copy_to_user()
    > from ioctl to the bottom half of interrupt handler.
    >
    > access_ok() returns TRUE (of course, user address is valid), but
    > copy_to_user() couldn't copy anything into the user space.
    >
    > bh is sched like:
    > queue_task(&pd_bh_task, &tq_immediate);
    > mark_bh(IMMEDIATE_BH);
    >
    > and spin_lock_irqsave() is NOT used in bh as well as any other
    > sync stuff.
    >
    > I assumed that if lock is not set kernel could use exception handlers
    > (according to Documentation/exception.txt) to get user space mem page.
    >
    > Could you tell me what is wrong?

    You cannot do that. copy_*_user requires a process context, and
    a bottom half does not have one (or at least not the one you want)

    -Andi

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Thu May 18 2000 - 14:19:11 EDT