linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@linutronix.de>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-kernel@vger.kernel.org, lethal@linux-sh.org,
	hjk@linutronix.de, gregkh@suse.de, linux-sh@vger.kernel.org,
	Uwe.Kleine-Koenig@digi.com
Subject: Re: [PATCH 00/03][RFC] Reusable UIO Platform Driver
Date: Tue, 20 May 2008 21:07:13 +0000	[thread overview]
Message-ID: <20080520210713.GE3220@local> (raw)
In-Reply-To: <20080520105132.1474.73941.sendpatchset@rx1.opensource.se>

On Tue, May 20, 2008 at 07:51:32PM +0900, Magnus Damm wrote:

Hi Magnus,

> These patches implement a reusable UIO platform driver. 

Uwe Kleine-Koenig already submitted such a framework:

http://lkml.org/lkml/2008/5/20/94

It's his third version, and it looks good. I presume you didn't know
about his work. The main difference is that he leaves interrupt handling
to platform code. That might look strange (it did to me first), but it
has the advantage that you can put hardware dependent stuff in your
board support (which depends on hardware anyway).

Could you have a look at his patch and tell me if that does what you
need?

> This driver
> can be used to export hardware to user space, as long as the device
> is a) memory mapped and b) equipped with an unique IRQ.
> 
> The uio_platform driver gets all information through platform data,
> including address window information and IRQ number. The driver also
> supports assigning a contiguous piece of memory to each instance.
> This may be useful when the exported hardware blocks can bus master
> but requires physically contiguous memory.
> 
> There are not many surprises in the code if you are familiar with UIO,
> except for the interrupt handling. All UIO kernel drivers that I've
> seen so far have hardware specific interrupt acknowledge code in the
> interrupt handler. The uio_platform driver is different.
> 
> The interrupt handling code in uio_platform assumes the device is the
> only user of the assigned interrupt. 

Uwe's approach doesn't have this limitation.

> This may be rare in the PC world
> but for SuperH almost all interrupt sources are unique. Having an
> unique interrupt for the device allows the code to use disable_irq()
> and enable_irq() in kernel space and leave actual interrupt acknowledge
> to user space. That way we have no hardware specific code in the kernel.
> 
> Interrupts are of course serviced in kernel space by the uio_platform
> driver, but the uio_platform interrupt handler will simply disable the
> IRQ until next read() or poll() syscall. The uio_platform kernel driver
> assumes that the user space driver has taken care of acknowledging
> the interrupt before doing read() and waiting for events again. If no
> acknowledge has happened then an interrupt will occur again (since it's
> still pending) and the kernel interrupt handler will disable the IRQ
> again and unblock the user space process.
> 
> The last patch contains SuperH specific code that exports various
> multimedia acceleration blocks to userspace. The following processors
> and hardware blocks are exported for now:
> 
> sh7343: VPU
> sh7722: VPU, VEU
> sh7723: VPU, VEU, VEU
> 
> If anyone is interested then I have a proof of concept vidix driver
> for mplayer that is interfacing using UIO to the VEU on a sh7722 to
> provide accelerated color space conversion and stretching.

This sounds quite interesting. Unfortunately, I'm not familiar with the
SuperH architecture. Could you also do this with Uwe's approach?

I'm about to sign-off Uwe's patch, and we'll possibly have that in
mainline soon. I don't mind having a second "generic platform" driver,
but you'll need to have good technical arguments.

Thanks,
Hans


  parent reply	other threads:[~2008-05-20 21:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20 10:51 [PATCH 00/03][RFC] Reusable UIO Platform Driver Magnus Damm
2008-05-20 10:51 ` [PATCH 01/03] uio: Add enable_irq() callback Magnus Damm
2008-05-21 11:58   ` Magnus Damm
2008-05-22 20:18     ` Hans J. Koch
2008-05-23  1:24       ` Magnus Damm
2008-05-23  8:43         ` Hans J. Koch
2008-05-20 10:51 ` [PATCH 02/03] uio: Add uio_platform driver Magnus Damm
2008-05-20 10:51 ` [PATCH 03/03] sh: Export sh7343/sh7722/sh7723 VPU/VEU blocks Magnus Damm
2008-05-20 21:07 ` Hans J. Koch [this message]
2008-05-21  3:31   ` [PATCH 00/03][RFC] Reusable UIO Platform Driver Magnus Damm
2008-05-21  6:49     ` Uwe Kleine-König
2008-05-21  7:49       ` Paul Mundt
2008-05-21  8:05         ` Uwe Kleine-König
2008-05-21  8:22           ` Magnus Damm
2008-05-21  8:50             ` Uwe Kleine-König
2008-05-21  8:09       ` Magnus Damm
2008-05-21  9:25         ` Uwe Kleine-König
2008-05-21 10:50           ` Magnus Damm
2008-05-21 11:04             ` Uwe Kleine-König
2008-05-21 11:56               ` Magnus Damm
2008-05-21 12:09                 ` Uwe Kleine-König

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=20080520210713.GE3220@local \
    --to=hjk@linutronix.de \
    --cc=Uwe.Kleine-Koenig@digi.com \
    --cc=gregkh@suse.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.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;
as well as URLs for NNTP newsgroup(s).