public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Tom Brown <sa212+emis@cyconix.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Yong Zhang <yong.zhang@windriver.com>
Subject: Re: Question: how to copy to user space from a tasklet
Date: Fri, 15 Oct 2010 10:59:40 +0200	[thread overview]
Message-ID: <201010151059.40757.arnd@arndb.de> (raw)
In-Reply-To: <4CB7ED67.2000407@s5r6.in-berlin.de>

On Friday 15 October 2010 07:57:59 Stefan Richter wrote:
> Tom Brown wrote:
> > [Sorry to have to ask this here - I can't find any driver-specific
> > newsgroup or mailing lists - are there any??]
> 
> linux-newbie perhaps.
> 
> > I have a driver which needs to copy device data direct to user space
> > from a tasklet.
> 
> One way would be to use mmap() to allocate the DMA buffer and insert it into
> the user address space before DMA commences.  An additional poll/read/write
> based protocol or so can be used for buffer management during DMA.

Agreed, that would be best, it's a lot easier than the way Tom describes
the driver to work today.

Just for completeness: doing DMA to random user address would require the
process to register the area using some home grown interface, so that the
driver can do get_user_pages/kmap on all of them and subsequently pass
around an array of pages, while keeping track of ulimits and coherency
with the existing kernel mappings. Don't do that.

	Arnd

  reply	other threads:[~2010-10-15  9:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 10:43 Question: how to copy to user space from a tasklet Tom Brown
2010-10-15  2:15 ` Yong Zhang
2010-10-15  5:57 ` Stefan Richter
2010-10-15  8:59   ` Arnd Bergmann [this message]
2010-10-18 15:45   ` Tom Brown
2010-10-18 17:01     ` Stefan Richter
2010-10-18 18:02       ` Tom Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010151059.40757.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sa212+emis@cyconix.com \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=yong.zhang@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox