public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Vitaly Wool <vwool@dev.rtsoft.ru>
Cc: Arjan van de Ven <arjan@infradead.org>, linux-kernel@vger.kernel.org
Subject: Re: [RFC] SPI core -- revisited
Date: Mon, 27 Jun 2005 10:20:47 +0100	[thread overview]
Message-ID: <20050627102047.B10822@flint.arm.linux.org.uk> (raw)
In-Reply-To: <42BFC348.5040709@dev.rtsoft.ru>; from vwool@dev.rtsoft.ru on Mon, Jun 27, 2005 at 01:13:44PM +0400

On Mon, Jun 27, 2005 at 01:13:44PM +0400, Vitaly Wool wrote:
> Arjan van de Ven wrote:
> >how is that??
>
> These functions are not exactly *wrappers*, there's some little 
> additional logic inside.
> spi-pnx0105_atmel.c uses spi_pnx_msg_buff_t structure to embed physical 
> and virtual address and length of the memory area allocated by 
> consistent_alloc, so if we just get rid of the alloc/free functions, 
> we'll copy wrong data from the userspace and nothing'll work.
> 
> Let's look at it from another point. When a read request comes from the 
> userspace to spi-dev, spi-dev should allocate  memory and copy the user 
> data in there. The problem is it is not (and shouldn't be) aware whether 
> the transfer is gonna be DMA or not so spi-dev can't choose 
> theappropriate method of memory allocation. Therefore it's reasonable to 
> let algorithm provide routines to do that.

Sorry, this isn't making sense.  Are you implying that you want to use
DMA to copy data from user to kernel space?  Or something else?

In any case, I do hope that you are aware that copy_to_user/copy_from_user
have rather important side effects other than just copying data?  They
cause page faults which ensure that the user space pages are paged in
and/or copied if written to as appropriate.

In another post, you mention that this patch was not provided for review.
However, it _is_ effectively provided for review because it's an
illustration of _how_ the interfaces are used - and we're reviewing
the interfaces provided by the SPI core.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  reply	other threads:[~2005-06-27  9:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26 19:36 [RFC] SPI core -- revisited dpervushin
2005-06-26 20:49 ` Alexey Dobriyan
2005-06-26 20:59   ` Arjan van de Ven
2005-06-27  3:37     ` Vitaly Wool
2005-06-27  8:28       ` Arjan van de Ven
2005-06-27  9:13         ` Vitaly Wool
2005-06-27  9:20           ` Russell King [this message]
2005-06-27 10:20             ` Vitaly Wool
2005-06-28 16:49               ` Greg KH
2005-06-27  3:39   ` Vitaly Wool
  -- strict thread matches above, loose matches on Subject: below --
2005-06-23 12:18 dmitry pervushin
2005-06-23 15:50 ` Jamey Hicks
2005-06-23 16:43   ` Russell King
2005-06-24 12:56     ` Jamey Hicks
2005-06-23 21:59 ` Jean Delvare
2005-06-24  0:35 ` Greg KH

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=20050627102047.B10822@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vwool@dev.rtsoft.ru \
    /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