From: "Leon Woestenberg" <leon.woestenberg@gmail.com>
To: "Hans J. Koch" <hjk@linutronix.de>
Cc: "Uwe Kleine-König" <Uwe.Kleine-Koenig@digi.com>,
linux-kernel@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@suse.de>,
"Jan Altenberg" <jan.altenberg@linutronix.de>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Magnus Damm" <magnus.damm@gmail.com>
Subject: Re: [PATCH 1/1] UIO: Add a write() function to enable/disable interrupts
Date: Sat, 24 May 2008 02:02:12 +0200 [thread overview]
Message-ID: <c384c5ea0805231702x5c37cccawcfcdb800141c2aeb@mail.gmail.com> (raw)
In-Reply-To: <20080523224359.GA3190@local>
Hello,
On Sat, May 24, 2008 at 12:43 AM, Hans J. Koch <hjk@linutronix.de> wrote:
> On Fri, May 23, 2008 at 10:44:42PM +0200, Leon Woestenberg wrote:
>>
>> Shouldn't this be more future-proof, what if we need to abuse write()
>> for something else in the future?
>
> We don't. I'm thinking about letting the function fail if irq_on is not
> 0 or 1, just to stop any ideas of abusing write().
>
We don't want to be future-proof?
With kernel UIO and userspace driver in seperate source repositories,
expect serious API drift in the longer term. I.e. the UIO interface
must be backwards and forwards proof IMHO.
> read() and write() only deal with irq handling, all data exchange with the
> device is done through mapped memory.
>
*Currently*, read() and write() only deal with irq handling.
In the future you might want to add a second control. I cannot think
of what that should be now, much like it was not foreseen a write()
call was needed.
>> I would suggest a check for ppos to be 0 (zero) as well, just to be
>> sure and future-proof and backwards-safe.
>
> write() is only for enabling/disabling irqs, there's only one possible
> value of count, and we don't have a seek function. So why check ppos?
>
So that *if* we have a second write()able location (again, for
something I cannot foresee now), you at least check that the userspace
proper wants to enable/disable the interrupt.
AFAIK, POSIX pwrite() does not require a seek() implementation in the
driver, but will come in with a different ppos.
Idea and patch looks fine, I just wanted to bring this up so that it
is considered.
Regards,
--
Leon
next prev parent reply other threads:[~2008-05-24 0:02 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-22 19:22 [PATCH 0/1] " Hans J. Koch
2008-05-22 19:26 ` [PATCH 1/1] " Hans J. Koch
2008-05-22 19:47 ` Tom Spink
2008-05-22 20:08 ` Hans J. Koch
2008-05-22 20:26 ` Tom Spink
2008-05-23 5:41 ` Uwe Kleine-König
2008-05-23 8:51 ` Hans J. Koch
2008-05-23 11:48 ` Tom Spink
2008-05-23 11:58 ` Uwe Kleine-König
2008-05-23 12:00 ` Tom Spink
2008-05-23 12:14 ` Hans J. Koch
2008-05-23 12:20 ` Tom Spink
2008-05-23 13:01 ` Hans J. Koch
2008-05-23 5:55 ` Uwe Kleine-König
2008-05-23 8:44 ` Hans J. Koch
2008-05-23 9:10 ` Uwe Kleine-König
2008-05-23 10:03 ` Hans J. Koch
2008-05-23 10:56 ` Uwe Kleine-König
2008-05-23 11:55 ` Hans J. Koch
2008-05-23 12:03 ` Uwe Kleine-König
2008-05-23 18:36 ` Randy Dunlap
2008-05-23 22:49 ` Hans-Jürgen Koch
2008-06-04 6:30 ` Uwe Kleine-König
2008-06-04 7:05 ` Thomas Gleixner
2008-05-23 20:44 ` Leon Woestenberg
2008-05-23 22:43 ` Hans J. Koch
2008-05-24 0:02 ` Leon Woestenberg [this message]
2008-05-24 4:43 ` Greg KH
2008-05-24 22:20 ` Hans J. Koch
2008-05-24 22:22 ` Thomas Gleixner
2008-05-24 22:34 ` Tom Spink
2008-05-24 22:46 ` Thomas Gleixner
2008-05-24 23:00 ` Tom Spink
2008-05-27 17:55 ` Greg KH
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=c384c5ea0805231702x5c37cccawcfcdb800141c2aeb@mail.gmail.com \
--to=leon.woestenberg@gmail.com \
--cc=Uwe.Kleine-Koenig@digi.com \
--cc=gregkh@suse.de \
--cc=hjk@linutronix.de \
--cc=jan.altenberg@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.damm@gmail.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
all inboxes | Powered by JetHome®