linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Wool <vwool@ru.mvista.com>
To: David Brownell <david-b@pacbell.net>
Cc: Mark Underwood <basicmark@yahoo.com>,
	dmitry pervushin <dpervushin@gmail.com>,
	Andrew Morton <akpm@osdl.org>, Greg KH <greg@kroah.com>,
	osdl.org@ascent.mvista.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [spi-devel-general] Re: SPI
Date: Wed, 23 Nov 2005 12:33:28 +0300	[thread overview]
Message-ID: <43843768.1050405@ru.mvista.com> (raw)
In-Reply-To: <200511221233.16634.david-b@pacbell.net>

David Brownell wrote:

>By the way Vitaly ... I'm still not getting responses directly from you.
>
>Are you pruning me off CC lists, or is there something between us that's
>filtering out posts?  It's certainly hard to respond to comments of yours
>when I can only find them by going through some list archive I wouldn't
>normally read...
>  
>
No, definitely I'm not. I'm just responding with "Reply All" button in 
my Thunderbird, if you wanna know the details.
And I'm quite surprised to hear about the kind of problems you have as 
you're the only one who's having them.

>>>>So for example one way you know that (c) is well met is that it's the same
>>>>approach used in USB (both host and peripheral/gadget sides); that's been
>>>>working well for quite a few years now.  (Despite comments from Dmitry
>>>>and Vitaly to the contrary.)
>>>> 
>>>>
>>>>        
>>>>
>>>Lemme point you out that if somehting is "working" on a limited number 
>>>of platforms within the limited number of use cases, that's not 
>>>necessarily a correct implementation.
>>>      
>>>
>>No, but it's a good indication :).
>>    
>>
>
>And I'm not sure what a "limited number of platforms" etc is supposed
>to suggest.  In terms of platforms supporting USB on Linux, there are
>surely more of them than there are for PCI ... since every PCI platform
>can support USB, and many non-PCI platforms do also.  A better word
>for that DMA support would seem to be "extensive", not "limited".
>
>In fact, the support for non-PCI platforms was one of the things that
>led to the last DMA-related reworks for USB.  The PCI calls wouldn't
>work (of course), but USB needs things like DMA-coherent buffers (for
>transfer and queue head descriptors, used by most controllers) as well
>as bus-neutral DMA operations.  And it even works for things like
>scatterlist merging through IOMMU mappings ... that wide portability
>is **very much** a good indication that (c) is a non-issue with the
>framework I've assembled.
>
>
>Vitaly, you're really going to have to come up with some facts if you
>keep claiming the SPI framework I've posted doesn't support DMA.
>(I'm not going to let you pull a SCO on us here.)  For that matter,
>you might want to consider the fact that Stephen's pxa2xx_spi
>driver disproves your arguments (it includes DMA support).
>  
>
Again, a single working driver cannot disapprove anything.
Evidently enough for anyone more or less familiar with logic, if one 
claims that something is working, he should prove it's working 
everywhere not somewhere; on the other hand, to disapprove this 
statement it's enough to give one example.

However, your latest core should be working on the problematic target as 
opposed to the previous one. I didn't try that but I think it'll work.
The thing is that what we do in the core to provide DMA capabilities 
should be implemented in controller driver in your case.
I can agree that it might be considered an addition to the core and not 
directly included in it, but leaving rather standard operations to the 
controller driver degrades the added value of the core.

>
>  
>
>>>>>>- (A) has some assumptions on buffers that are passed down to spi
>>>>>> functions.
>>>>>>            
>>>>>>
>>>>Make that "requirements"; FWIW they're the same ones that apply to all
>>>>other kernel driver frameworks I've seen:  that buffers be DMA-safe.
>>>>It would not be helpful (IMO) to define different rules; that's also
>>>>called the "Principle of Least Astonishment".  :)
>>>>        
>>>>
>>>Yeah within this requirement it's correct. But that requirement may 
>>>really make the SPI controller driver a lot more complex if
>>>- it has to send something received from the userland
>>>      
>>>
>
>Controller drivers don't deal with userland addresses.  That's the
>responsibility of the layers on top ... e.g. the filesystem or driver
>code that accepts them.  Most just copy to/from userspace, but some
>pay the costs to support direct I/O.
>  
>
Oh no, you've got me wrong. I was tryng to say that an upper level 
driver which copies the data from the userspace should be copying it to 
GFP_DMA buffer, otherwise it won't work or will force the controller 
driver to allocate/copy.
And putting a requirement on the upper level driver to always do GFP_DMA 
kmalloc's might put too high restrictions on the memory usage.
Basically the upper level driver shouldn't give a damn whether the 
buffers should be DMA-able or not since it might be used on different 
platforms w/ and w/o DMA capabilities. Thus, it's going to be either a 
requirement for the upper level drivers that implies the SPI core not 
being transparent to the upper level, or a requirement for each 
controller driver that might be handling this situation to implement the 
same thing we did in the core. Neither of these seems reasonable to me.

>
>  
>
>>>- it needs to timely send some credentials (what is the case for the 
>>>WLAN driver, for instance).
>>>      
>>>
>
>Again, not the responsibility of the lowest level driver.   A WLAN driver
>layered on top could, of course.  That's the way such things are done in
>other driver stacks.
>
>Are you seriously suggesting that an SPI controller driver should have any
>clue whatever about credentials??   Which of the dozens of schemes should
>become that "special", then ... and why??
>
>  
>
I'm afraid that you were not reading my response attentively. 
Credentials are stored in a staic-allocated buffer in the upper level 
driver. Then they are passed down to the SPI core which will fail to 
send the buffer containing the credentials if it's not copied to DMAable 
memory somewhere in between.

Vitaly

  parent reply	other threads:[~2005-11-23  9:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-11 10:11 SPI dmitry pervushin
2005-11-21 20:15 ` SPI Mark Underwood
2005-11-21 20:56   ` SPI Vitaly Wool
2005-11-21 21:23     ` SPI Mark Underwood
2005-11-21 21:27   ` SPI David Brownell
2005-11-22  6:00     ` [spi-devel-general] SPI Vitaly Wool
2005-11-22 19:11       ` Mark Underwood
     [not found]         ` <200511221233.16634.david-b@pacbell.net>
2005-11-23  9:33           ` Vitaly Wool [this message]
2005-11-23 19:05             ` David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2005-09-26 11:12 SPI dmitry pervushin
2005-09-26 12:31 ` SPI Eric Piel
2005-09-26 12:37   ` [spi-devel-general] SPI dmitry pervushin
2005-09-26 16:20 ` SPI Grant Likely
2005-09-27  7:39   ` [spi-devel-general] SPI dmitry pervushin
2005-09-26 16:25 ` SPI Valdis.Kletnieks
2005-09-26 16:46   ` [spi-devel-general] SPI Vitaly Wool
2005-09-27 12:43 ` SPI Greg KH
2005-09-27 14:27   ` [spi-devel-general] SPI dmitry pervushin
2005-09-27 14:35     ` Greg KH
2005-09-27 14:49       ` dmitry pervushin
2005-09-27 14:54         ` Greg KH
2005-09-27 15:19           ` dmitry pervushin

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=43843768.1050405@ru.mvista.com \
    --to=vwool@ru.mvista.com \
    --cc=akpm@osdl.org \
    --cc=basicmark@yahoo.com \
    --cc=david-b@pacbell.net \
    --cc=dpervushin@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osdl.org@ascent.mvista.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).