From: Jonathan Buzzard <jonathan@buzzard.me.uk>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Charles@schwieters.org, linux-acpi@vger.kernel.org, john@neggie.net
Subject: Re: experimental patch for toshiba_acpi
Date: Thu, 26 Feb 2009 00:22:29 +0000 [thread overview]
Message-ID: <49A5E0C5.8090700@buzzard.me.uk> (raw)
In-Reply-To: <20090225175923.GB7836@srcf.ucam.org>
Matthew Garrett wrote:
> On Wed, Feb 25, 2009 at 05:53:39PM +0000, Jonathan Buzzard wrote:
>> On Wed, 2009-02-25 at 17:28 +0000, Matthew Garrett wrote:
>>> The same argument encourages us to put rfkill and brightness control
>>> support in a userland tool, despite the existing kernel interfaces for
>>> controlling them. We could replace almost every driver in platform/x86
>>> with a generic driver that allowed arbitrary ACPI methods to be called
>>> and gave access to EC bits. The reason we haven't done this is because
>>> that's what the kernel is there for.
>> Quite correct they should be removed. The first step of which is to
>> provide a generic interface to the HCI.
>
> Yeah. No.
Yeah, yes
>
>> You do it, test it then maintain it then. To claim that maintaining this
>> in kernel space is as easy as users space is patently ludicrous.
>
> How so? C is C. Whether you do it in userspace or kernel space, all you
> have to do is make a function call with the appropriate arguments.
>
No it is not. C that is running in kernel space is not the same as C
that is runing in user space. The potential for a bug to have security
implications is *far* higher. If you start pushing hundreds of lines of
string parsing into the kernel that just got a whole lot more likely.
Then one has to go through the whole rigmarole of submitting patches to
various kernel developers and hoping that it gets in the next kernel. As
opposed to releasing your own user land code, that might not even be in
C, it could be C++, Perl, Python whatever takes your fancy when ever it
takes your fancy.
Finally I speak from actual experience on this matter. The very early
versions of the toshiba drive did everything via a proc interface. It
sucked, was buggy and hundreds of lines long. I then stripped it down
wrote a wrapper to the HCI, reduced the amount of kernel code by an
order of magnitude.
>> A "proper" kernel driver as you put it is is completely inappropriate.
>> You want to unnecessarily pollute the kernel with hundreds of lines of
>> code for no actual gain in functionality.
>
> Yes. I want a proper kernel driver.
>
Well write it yourself, because I certainly am not. In the meantime
there is perfectly good method that allows lots of existing code to just
work. The only thing I am likely to do is update the toshiba driver so
it detects whether ACPI is enabled and uses ACPI methods if that is the
case.
I would be interested in what on earth makes you thing putting hundreds
of lines of code into a "proper" kernel driver as you put it is better
as it is simply not the Unix way.
JAB.
--
Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk
Fife, United Kingdom.
next prev parent reply other threads:[~2009-02-26 0:32 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-25 14:54 experimental patch for toshiba_acpi Charles
2009-02-25 15:24 ` Matthew Garrett
2009-02-25 16:18 ` Jonathan Buzzard
2009-02-25 16:51 ` Matthew Garrett
2009-02-25 17:12 ` Jonathan Buzzard
2009-02-25 17:28 ` Matthew Garrett
2009-02-25 17:53 ` Jonathan Buzzard
2009-02-25 17:59 ` Matthew Garrett
2009-02-25 20:18 ` Charles
2009-02-26 0:22 ` Jonathan Buzzard [this message]
2009-02-26 8:39 ` Richard Hughes
2009-02-26 10:34 ` Jonathan Buzzard
2009-02-26 12:52 ` Richard Hughes
2009-02-26 13:27 ` Jonathan Buzzard
2009-02-26 13:59 ` Richard Hughes
2009-02-26 15:49 ` Jonathan Buzzard
2009-02-25 17:33 ` Azael Avalos
2009-02-26 13:12 ` John Belmonte
2009-02-26 14:03 ` Richard Hughes
2009-02-26 15:51 ` Jonathan Buzzard
2009-02-26 16:01 ` Matthew Garrett
2009-02-27 16:49 ` Richard Hughes
2009-02-27 17:18 ` Jonathan Buzzard
2009-02-28 15:19 ` Henrique de Moraes Holschuh
2009-03-13 1:17 ` Len Brown
2009-03-14 0:37 ` Charles
2009-03-14 7:02 ` Andrey Borzenkov
2009-03-14 12:05 ` Matthew Garrett
-- strict thread matches above, loose matches on Subject: below --
2009-02-27 21:15 Andrey Borzenkov
2009-02-27 21:31 ` Charles
2009-02-28 6:13 ` Andrey Borzenkov
2009-02-28 18:00 ` Charles
2009-03-01 7:00 ` Andrey Borzenkov
2009-03-01 10:31 ` Charles
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=49A5E0C5.8090700@buzzard.me.uk \
--to=jonathan@buzzard.me.uk \
--cc=Charles@schwieters.org \
--cc=john@neggie.net \
--cc=linux-acpi@vger.kernel.org \
--cc=mjg59@srcf.ucam.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