public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@hansjkoch.de>
To: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>,
	mst@redhat.com, Greg KH <gregkh@suse.de>,
	tglx@linutronix.de, linux-pci@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: extra large DMA buffer for PCI-E device under UIO
Date: Tue, 22 Nov 2011 17:05:38 +0100	[thread overview]
Message-ID: <20111122160538.GB15508@local> (raw)
In-Reply-To: <4498E0C9-B5E9-44B5-8868-140D6416100E@gmail.com>

On Tue, Nov 22, 2011 at 10:24:17AM -0500, Jean-Francois Dagenais wrote:
[...]
> >> 
> >> So please submit a patch, that will make it easier to help you out.
> > 
> > Yes, please do. The more different drivers we have under /drivers/uio, the
> > better. Didn't you use one of the existing drivers as a template for yours?
> Of course, and I am making contributions to the kernel as well (ds1wm,  w1_ds2408,
> ad714x, and more to be merged contribs to blackfin list drivers) because I strongly
> believe in the community aspect of Linux.

I don't doubt that, sorry if I gave that impression. My only concern is that in the
past few years (UIO is in mainline since 2.6.23) less than 1% of the drivers ever
appeared on LKML. That means that, with quite high probability, everybody writing
a new UIO driver will reinvent the wheel. Over the years, I met lots of people
(e.g. at conferences) who wrote a UIO driver for all kinds of devices, even with
different sorts of DMA handling. All of them said "oh, my driver is of no interest
to the public", and never posted it although I strongly encouraged them to do so.

Consequently, everybody has to do the same work again and again, which is just a
waste of rare engineering powers.

> 
> So in the spirit of making the driver more generic, I would like to make this patch
> something along the lines of a generic uio/pci based large DMA acquisition device
> driver. Or maybe even complementing the existing uio_generic_pci.c?

Adding DMA requires changes to the UIO core to be something more than a crude
workaround. Probably a new device like /dev/uio_dma0 for a /dev/uio0. Feel free
to make suggestions.

> 
> The problem is that there are device specific aspects that the "generic" driver would
> need to take into account, e.g. to map BARx or not, or in our case, there are MFDs
> embedded in the firmware (xilinx's ds1wm core, and soon, xilinx's spi core). Furthermore,
> I want the FPGA to be an irq expander since the cores generate interrupts, and a
> couple of balls on the FPGA are irq signals from external i2c chips.

That should not be much of a problem, unless the FPGA generates more than one
physical interrupt.

> 
> I don't yet see any way to specify like a setup callback function that could reach a
> platform module when uio_pci_generic is probing.
> 
> I am thinking this through as I write here...
> 
> My other persona (C++ programmer) suggests that conceptually, uio_pci_generic is
> a "base class" and the other more firmware specific items would be in a derived module.
> In that sense, maybe uio_pci_generic could export it's symbols? So it can be used as
> uio core functionnality?
> 
> So I would still have a module which would contain the specific MFD registration and IRQ
> functionnality, but the BARx and large DMA mapping would reside in uio_pci_generic...

If we want more UIO core functionality, we should integrate it into the UIO core,
and not just hack a driver.

Thanks,
Hans


  parent reply	other threads:[~2011-11-22 16:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 21:16 extra large DMA buffer for PCI-E device under UIO Jean-Francois Dagenais
2011-11-18 22:08 ` Greg KH
2011-11-21 15:31   ` Jean-Francois Dagenais
2011-11-21 17:36     ` Greg KH
2011-11-21 18:17       ` Hans J. Koch
     [not found]         ` <4A52B447-8E21-43F6-A38E-711E36F89A34@gmail.com>
2011-11-21 19:29           ` Hans J. Koch
2011-11-22 15:24         ` Jean-Francois Dagenais
2011-11-22 15:35           ` Michael S. Tsirkin
2011-11-22 16:54             ` Jean-Francois Dagenais
2011-11-22 17:27               ` Matthew Wilcox
2011-11-22 17:40                 ` Michael S. Tsirkin
2011-11-22 17:37               ` Michael S. Tsirkin
2011-11-22 17:54                 ` Hans J. Koch
2011-11-22 18:40                   ` Michael S. Tsirkin
2011-11-22 18:52                     ` Hans J. Koch
2011-11-22 19:50                       ` Jean-Francois Dagenais
2011-11-23  8:20                       ` Michael S. Tsirkin
2011-11-22 16:05           ` Hans J. Koch [this message]
2011-11-22 19:57   ` Jean-Francois Dagenais
2013-01-23  2:00     ` Jean-François Dagenais
2011-11-18 22:27 ` Hans J. Koch
2011-11-21 15:10   ` Jean-Francois Dagenais
2011-11-21 15:47     ` Rolf Eike Beer
2011-11-21 16:01       ` Jean-Francois Dagenais

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=20111122160538.GB15508@local \
    --to=hjk@hansjkoch.de \
    --cc=gregkh@suse.de \
    --cc=jeff.dagenais@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=tglx@linutronix.de \
    /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