public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martyn Welch <martyn.welch@gefanuc.com>
To: "Emilio G. Cota" <cota@braap.org>
Cc: Greg K-H <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	Sebastien Dugue <sebastien.dugue@bull.net>
Subject: Re: [patch 1/5] Staging: VME Framework for the Linux Kernel
Date: Tue, 11 Aug 2009 09:29:02 +0100	[thread overview]
Message-ID: <4A812BCE.3010003@gefanuc.com> (raw)
In-Reply-To: <20090810193849.GA3055@braap.org>

Emilio G. Cota wrote:
> Martyn Welch wrote:
>   
>> That's one reason for the helper function. If VME bridges are added  
>> which sit of on other buses then vme_alloc_consistent can be extended to  
>> support this without requiring VME device drivers to be altered to  
>> reflect the fact that pci_alloc_consistent might not work for all VME  
>> bridges.
>>     
>
> But it corresponds to the bridge's code (not to the generic layer) to
> know whether the bridge sits on top of PCI or not; hence my comment.
>
>   
>> The DMA controller in the tsi-148 can do PCI to PCI; PCI to VME; VME to  
>> PCI; VME to VME; Patterns to  VME and Patterns to PCI transfers. How do  
>> you specify all those options without providing a structure where over  
>> 50% of the fields aren't used for any given transfer?
>>     
>
> I think a struct where not _every_ field is *always* used is fine.
> However requiring your drivers to know about what your bridge
> looks like is a mistake; just give them something thin that doesn't
> assume anything about what's behind it, and if it's not supported,
> return an appropriate error message.
>   

That's what the API does - how does it require the driver writer to know 
about what the bridge look like. All that it requires is the the 
hardware supports the transfer mode that the driver requests, however 
that's always going to be an issue with multiple devices with different 
properties.

>> Every bridge I have seen is capable of link-list execution. The API  
>> provides the ability to do scatter-gather style DMA transfers, this  
>> could be used as part of a "zero-copy" type driver for high speed VME  
>> capture devices. How would you support the link-list execution with a  
>> single call?
>>     
>
> Let me say it again: "Drivers should know *nothing* about the
> underlying bridge".
> They should work with *any* bridge; or do we care about the PCI
> bridge we're plug our PCI device on when writing a driver for it?
>
>   

Again: what part of the API I have defined forces the driver to know 
about the underlying bridge?

>> I was also looking at the ability to queue DMA transfers if the  
>> controller was currently busy - if the consensus is that this is  
>> overkill I will happily remove this.
>>     
>
> AFAICT the tsi148 has several DMA channels; in our driver we just
> try to find a free channel to proceed with the transfer; if there
> aren't any then we return EBUSY.
>   

Where as I request a DMA channel - a resource is returned, the driver 
does not need to know which one, he has the resource structure which 
refers to it. It treats the DMA engines as a resource, just as it treats 
the windows, both master and slave as resources.

> Drawing an analogy with current 'streaming DMA' transfers, we're
> told we should check whether they failed or not, so I think
> trying to be too clever here it's not worth it.
>
>   
Yes - my driver checks to see of the transfer has succeeded, I don't see 
quite what this has to do with the API. How's the API being clever?
>> I implemented it using param array, I agree that the arguments might get
>> quite long with 10 devices, especially if multiple parameters are
>> required, but I don't see why it shouldn't work.
>>     
>
> The fact that 'it works' doesn't make it less ugly or messy.
> When referring to code, these two words usually mean "there's
> a better way"; so let's just find it.
>
> E.
>   
If there's a better way to do this then fine - I'm happy to use it, 
however I'm not quite sure how this relates to the API, core VME code or 
low-level drivers. I think it's up to the authors of the VME device 
drivers themselves how they approach this. The API uses the standard 
bind-table approach as best as I could. If you can think of a better 
approach to this, patches will be welcome.

Martyn

-- 
Martyn Welch MEng MPhil MIET (Principal Software Engineer)   T:+44(0)1327322748
GE Fanuc Intelligent Platforms Ltd,        |Registered in England and Wales
Tove Valley Business Park, Towcester,      |(3828642) at 100 Barbirolli Square,
Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB  VAT:GB 927559189

  reply	other threads:[~2009-08-11 12:14 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090803205657.964064732@mini.kroah.org>
2009-08-03 21:00 ` [patch 0/5] [ANNOUNCE] VME Bus drivers and framework for Linux Greg K-H
2009-08-03 21:01   ` [patch 1/5] Staging: VME Framework for the Linux Kernel Greg K-H
2009-08-08 23:01     ` Emilio G. Cota
2009-08-10 12:44       ` Martyn Welch
2009-08-10 14:14         ` Emilio G. Cota
2009-08-10 15:31           ` Emilio G. Cota
2009-08-10 16:40             ` Martyn Welch
2009-08-10 19:50               ` Emilio G. Cota
2009-08-11  8:02                 ` Martyn Welch
2009-08-11  8:43                   ` Emilio G. Cota
2009-08-10 15:53           ` Martyn Welch
2009-08-10 16:26             ` Shawn Bohrer
2009-08-10 19:38             ` Emilio G. Cota
2009-08-11  8:29               ` Martyn Welch [this message]
2009-08-11 14:49                 ` Emilio G. Cota
2009-08-11 15:10                   ` Martyn Welch
2009-08-11 15:36                     ` Emilio G. Cota
2009-08-11 15:41                       ` Martyn Welch
2009-08-11 15:42                         ` Emilio G. Cota
2009-08-11 16:38                           ` Martyn Welch
2009-08-11 20:48                             ` Emilio G. Cota
2009-08-12  9:54                             ` Emilio G. Cota
2009-08-12  9:59                               ` Martyn Welch
2009-08-12 10:09                                 ` Emilio G. Cota
2009-08-12 10:19                                   ` Martyn Welch
2009-08-11  4:54         ` Mike Frysinger
2009-08-11  7:48           ` Martyn Welch
2009-08-10 16:30       ` Greg KH
2009-08-10 14:52     ` [PATCH] Staging: vme: fix {master,slave}_get check bug Emilio G. Cota
2009-08-10 16:50       ` Martyn Welch
2009-08-03 21:01   ` [patch 2/5] Staging: vme: add VME userspace driver Greg K-H
2009-08-08 23:22     ` Emilio G. Cota
2009-08-09 12:17       ` Emilio G. Cota
2009-08-10 13:13         ` Martyn Welch
2009-08-10 15:26           ` Emilio G. Cota
2009-08-10 16:29             ` Greg KH
2009-08-10 16:30             ` Martyn Welch
2009-08-10 20:36               ` Emilio G. Cota
2009-08-11  9:03                 ` Martyn Welch
2009-08-11  9:40                   ` Emilio G. Cota
2009-08-11 12:46                     ` Martyn Welch
2009-08-11 21:01                       ` Emilio G. Cota
2009-08-12  8:17                         ` Martyn Welch
2009-08-12  9:39                           ` Emilio G. Cota
2009-08-12  9:57                             ` Martyn Welch
2009-08-12 11:20                               ` Emilio G. Cota
2009-08-12 12:19                                 ` Martyn Welch
2009-08-10 16:28         ` Greg KH
2009-08-10 20:05           ` Emilio G. Cota
2009-08-10 21:09             ` Greg KH
2009-08-11  7:04               ` Emilio G. Cota
2009-08-03 21:01   ` [patch 3/5] Staging: vme: add Universe I/II bridge driver Greg K-H
2009-08-03 23:00     ` Jiri Slaby
2009-08-03 21:01   ` [patch 4/5] Staging: vme: add Tundra TSI148 VME-PCI Bridge driver Greg K-H
2009-08-03 22:50     ` Jiri Slaby
2009-08-03 22:55       ` Jiri Slaby
2009-08-05 16:33       ` [PATCH] Staging: Correct tsi-148 VME interrupt free routine Martyn Welch
2009-08-05 16:38         ` [PATCH v2] " Martyn Welch
2009-08-05 21:53           ` Jiri Slaby
2009-08-06  7:20             ` Martyn Welch
2009-08-09  0:09     ` [patch 4/5] Staging: vme: add Tundra TSI148 VME-PCI Bridge driver Emilio G. Cota
2009-08-11 14:59       ` [patch 4/5] Staging: vme: add Tundra TSI148 VME-PCI Bridgedriver Martyn Welch
2009-08-03 21:01   ` [patch 5/5] Staging: vme: add TODO file Greg K-H
2009-08-04  7:56   ` [patch 0/5] [ANNOUNCE] VME Bus drivers and framework for Linux Martyn Welch
2009-08-08 22:25   ` Emilio G. Cota

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=4A812BCE.3010003@gefanuc.com \
    --to=martyn.welch@gefanuc.com \
    --cc=cota@braap.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastien.dugue@bull.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