mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Magnus Damm" <magnus.damm@gmail.com>
To: "Hans J. Koch" <hjk@linutronix.de>
Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
	lethal@linux-sh.org, gregkh@suse.de,
	"Uwe Kleine-König" <Uwe.Kleine-Koenig@digi.com>
Subject: Re: [PATCH 01/03] uio: Add enable_irq() callback
Date: Fri, 23 May 2008 10:24:42 +0900	[thread overview]
Message-ID: <aec7e5c30805221824l5ecf0b53i1e1cce7c1c815912@mail.gmail.com> (raw)
In-Reply-To: <20080522201829.GE3226@local>

Hi Hans,

On Fri, May 23, 2008 at 5:18 AM, Hans J. Koch <hjk@linutronix.de> wrote:
> On Wed, May 21, 2008 at 08:58:24PM +0900, Magnus Damm wrote:
>> On Tue, May 20, 2008 at 7:51 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> > Add enable_irq() callback to struct uio_info. This callback is needed by
>> > the uio_platform driver so interrupts can be enabled before blocking.
>>
>> We can most likely use a single uio platform driver if this patch is
>> acceptable. Any NAKs?
>
> Yes. Your approach only allows enabling interrupts, but not disabling
> them. And I don't like that it is not possible for generic userspace
> tools to find out if a UIO device has this auto-irq-enabling capability
> or not.

Thanks for your effort. I understand that you need to enable and
disable interrupts from user space, but that's a bit different from
what I want to do. I just want interrupts to be enabled before I do
read() or poll().

Also, adding the capability of disabling and enabling interrupts from
user space seems a bit error prone to me. Mainly since user space then
needs to know that the interrupt handler in kernel space can cope with
such changes. Not such a clean interface IMO. OTOH you may need that
to cope with some broken hardware.

But why does user space need to know if the auto-irq-enabling function
is there or not? If the user is interfacing to the wrong kernel UIO
driver with wrong behavior then he has obviously done something wrong.
Knowing if auto-irq-enabling is there from user space isn't going to
save users from themselves. They can and will mix and match things in
all sorts of wrong ways anyway.

> I just posted a patch that allows enabling _and_ disabling of irqs from
> userspace by writing 0 or 1 to /dev/uioX. I've CCed you, could you
> please test? If this doesn't do what you need, please let me know.

I'm sure your patch or the ioctl suggestion both allow re-enabling
interrupts from user space. That's great, but both of them add extra
syscall overhead compared to my suggestion. They also make the user
space interface in user space part of the driver a bit more
complicated.

I do understand that you don't want to mess up your UIO kernel
callbacks by introducing just merging new ones all the time. OTOH, my
patch is just a few lines. Is introducing one extra syscall good
enough performance wise?

Thanks for your help!

/ magnus

  reply	other threads:[~2008-05-23  1:24 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 [this message]
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 ` [PATCH 00/03][RFC] Reusable UIO Platform Driver Hans J. Koch
2008-05-21  3:31   ` 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=aec7e5c30805221824l5ecf0b53i1e1cce7c1c815912@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=Uwe.Kleine-Koenig@digi.com \
    --cc=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®