public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Hughes <hughsient@gmail.com>
To: Jonathan Buzzard <jonathan@buzzard.me.uk>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	Charles@schwieters.org, linux-acpi@vger.kernel.org,
	john@neggie.net
Subject: Re: experimental patch for toshiba_acpi
Date: Thu, 26 Feb 2009 12:52:19 +0000	[thread overview]
Message-ID: <1235652739.3802.72.camel@hughsie-work.lan> (raw)
In-Reply-To: <1235644477.4770.118.camel@penguin.lifesci.dundee.ac.uk>

On Thu, 2009-02-26 at 10:34 +0000, Jonathan Buzzard wrote:
> Yes. You really don't understand the Toshiba Hardware Configuration
> Interface. It is like making a old style BIOS INT 13 call. There are
> potentially 2^16 possible calls, and there is no way to determine what
> calls are valid on what laptop models other than a large lookup table.

You mean there's no way of using dmi matching to do subsets of models?
Is the A20 very much different from the A10?

> You explain to an end user then that they cannot use their new Toshiba
> laptop with their favourite Linux distribution without doing their own
> kernel module, as the lookup table for what HCI calls are valid on their
> laptop is not implemented in the kernel their distribution comes with. 
> 
> Is that the road you are proposing to go down? Because it is completely
> divorced from reality and totally impractical.

So your view of reality is to tell the user to install a userspace
library, and perhaps another daemon, and then patch all the userspace
tools to use your library as well as the kernel interfaces? I don't
think so.

> Why would I put code into the kernel code for changing the ownerstring
> on my laptop. Something I might do a couple of times in the lifetime of
> the laptop?

Why would you want to do that? That's focusing on the couple of people
on the planet using a laptop that know what an ownerstring is.

> What other models of computers have Linux kernel drivers to change the
> BIOS boot order, or any other random model specific BIOS setting?

Leave that to the BIOS. Just because it can be done, doesn't mean it
should be done.

> How do you propose to deal with the dozens of HCI calls and the hundreds
> of models of laptops, with not all HCI calls being valid on all models,
> and with the potential for a HCI call on the wrong laptop to brick it
> and yes this *DOES* happen?

How many different HCI calls are there to increase the backlight
brightness up by one unit?

> Why if I install a distribution of Linux on my new Toshiba laptop should
> I have to install a new kernel module and keep it updated to make some
> change because the table specifying which HCI calls can be made is not
> up to date in my distro's kernel?

Dude, that happens all the time with other kernel modules. You see a
patch on LKML saying "add product ID for foobuzz" and then it gets
picked up by downstream as a patch until a new version is released.

> > > 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.
> > 
> > If the UNIX way is to expose raw devices /proc/toshiba and /dev/toshiba
> > and then use userspace tools to poke random values in them, then get me
> > back to Linux real quick.
> 
> It is not the Unix or Linux way to put huge quantities of code like this
> into the kernel. It is not necessary or desirable, you *will* create
> local privilege escalation bugs if you attempt it.

Will I?

> > The way to do this in the Linux kernel is to
> > use the existing kernel abstractions like backlight and power_supply
> > using a proper kernel driver.
> 
> The problem is your failing to understand the shear depth of possible
> calls to the HCI interface. I am quite sure that a 10,000+ line kernel
> module to implement all the HCI methods would be rejected upstream.
> Somewhere I have an email from Alan Cox from a decade ago telling me
> just that. That is why the current method was developed.

You don't need all of them. You need backlight control, fan control,
battery and maybe a few others. You don't need to interact with the EC
in all possible ways.

> Finally actual code wins. If you want all this in kernel space then stop
> winging and implement it. The fact that nobody has in the last five
> years clearly indicates that there is little will to do so.

Well, I think the onus is on you to provide a proper kernel patch,
rather than just exposing userspace to /dev/toshiba, afterall, that was
the thing that's prompted my mail

Richard.



  reply	other threads:[~2009-02-26 12:53 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
2009-02-26  8:39                 ` Richard Hughes
2009-02-26 10:34                   ` Jonathan Buzzard
2009-02-26 12:52                     ` Richard Hughes [this message]
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=1235652739.3802.72.camel@hughsie-work.lan \
    --to=hughsient@gmail.com \
    --cc=Charles@schwieters.org \
    --cc=john@neggie.net \
    --cc=jonathan@buzzard.me.uk \
    --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