From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Drasko DRASKOVIC <drasko.draskovic@gmail.com>,
Grant Likely <grant.likely@secretlab.ca>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][GPIO] Add IRQ edge setter to gpiolib
Date: Tue, 9 Oct 2012 13:27:33 +0100 [thread overview]
Message-ID: <20121009122733.GD4625@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CACRpkdb+txD9hfhs7pfnzmDuU59VXEdzJc86z=tdy2yqYBCqOg@mail.gmail.com>
On Tue, Oct 09, 2012 at 02:00:34PM +0200, Linus Walleij wrote:
> On Fri, Oct 5, 2012 at 3:16 PM, Drasko DRASKOVIC
> <drasko.draskovic@gmail.com> wrote:
> > [Me]
> >> If I understand correctly the below more or less exports
> >> struct irq_chip to userspace,
> >> trying to hide it by instead exposing a property of the
> >> containing struct gpio_chip and it worries me.
> >
> > No, it should not.
>
> You are exporting all of the defines from irq.h,
> IRQ_TYPE_NONE, IRQ_TYPE_EDGE_FALLING, etc
> to userspace. These are defined in <linux/irq.h> and that file
> has this comment on top:
>
> /*
> * Please do not include this file in generic code. There is currently
> * no requirement for any architecture to implement anything held
> * within this file.
> *
> * Thanks. --rmk
> */
>
> And that comment is even only about generic *KERNEL* code,
> userspace is way, way more than that.
It is always worth remembering this simple fact:
If you export something from the kernel to userspace, it becomes part
of the kernel's userspace API. Userspace APIs are more stable than
the kernel, some suggest that the userspace API should be maintained
for 10 years. Are you willing to set in stone for years part of the
kernel internal structures without putting a lot of thought into how
you export the data?
If you haven't spent a significant amount of time thinking about how you're
going to export something - and thinking about whether it should even be
exported, then you haven't done enough to outweigh the pain of having it
exported.
next prev parent reply other threads:[~2012-10-09 12:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-05 12:20 Drasko DRASKOVIC
2012-10-05 12:40 ` Linus Walleij
2012-10-05 13:16 ` Drasko DRASKOVIC
2012-10-07 23:47 ` Drasko DRASKOVIC
2012-10-09 12:00 ` Linus Walleij
2012-10-09 12:27 ` Russell King - ARM Linux [this message]
2012-10-09 14:22 ` Drasko DRASKOVIC
2012-10-11 16:26 ` Linus Walleij
2012-11-30 11:30 ` Grant Likely
-- strict thread matches above, loose matches on Subject: below --
2012-10-05 10:45 Drasko DRASKOVIC
2012-10-05 11:09 ` Drasko DRASKOVIC
2012-10-05 11:50 ` Mark Brown
2012-10-05 12:15 ` Drasko DRASKOVIC
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=20121009122733.GD4625@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=drasko.draskovic@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®