mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael E Brown <Michael_E_Brown@dell.com>
To: Kyle Moffett <mrmacman_g4@mac.com>,
	Doug Warzecha <Douglas_Warzecha@dell.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support
Date: Mon, 15 Aug 2005 23:58:43 -0500	[thread overview]
Message-ID: <1124168323.10755.179.camel@soltek.michaels-house.net> (raw)

I am not subscribed to linux-kernel. Please cc me (and Doug) on all
replies. Sorry if I'm breaking peoples threading, but I am cut-and-
pasting this from web archives, since this wasn't cc-d to me
originally. 

>On Aug 15, 2005, at 19:38:49, Doug Warzecha wrote:
>> On Mon, Aug 15, 2005 at 04:23:37PM -0400, Kyle Moffett wrote:
>>> Why can't you just implement the system management actions in the  
>>> kernel
>>> driver?
>>
>> We want to minimize the amount of code in the kernel and avoid  
>> having to
>> update the driver each time a new system management command is added.
>
> One of the recent trends in kernel driver development is to make as much
> as possible accessible through standard tools (like with echo and cat  
> via sysfs).

Where it makes sense. Everything can be taken too far, and I believe
that you are taking this past the point of sanity. Are you also to
advocate that X stop mmap()-ing /dev/mem to manipulate PCI memory-space
of the video cards, but rather we should have a kernel driver that
makes every register of each PCI card available as a file in sysfs so
that we can re-write X as a big bash script? Let me know how that works
out.

>
>> The libsmbios project is being updated to use this code.  http:// 
>> linux.dell.com/libsmbios/main/.  Using the libsmbios code, you
>> will be able to set all of the options in BIOS F2 screen from Linux
>> userspace.  Also, libsmbios is looking at implementing a few other  
>> things
>> like fan status.  Libsmbios is 100% open-source (OSL/GPL dual  
>> license).
>
>  From my point of view, this driver could use sysfs almost entirely  
> and put
> all of the hardware-manipulation code completely in kernel space, along
> with the hardware detection code.  You could have plain-text files in
> /sys/bus/platform/dellbios/ that have all of the BIOS F2 options  
> accessible
> to the admin from the command line, without special tools.  (You could
> always add an extra program that presents a BIOS-like interface)

Conservatively counting, I see just about 350 different BIOS options in
my current list, plus about 60 different (unrelated) SMI calls. We are
talking about several tens of thousands of lines of code in the kernel
to surface each of these in the kernel along with all of the necessary
BIOS-bug-workaround and platform detection code. This is not pretty,
nor easy code. I, personally, do not want to be responsible for the
parsing bug that causes a root hole here. 

In userspace, I can easily stick all of the cross-references into an
XML file, along with the workarounds and bug-fixes, which makes the
code a bit tighter. We have one project here at Dell that implemented
an all C (userspace) equivalent of what you are talking about, and they
ended up writing a code generation script that took XML definitions of
each option and generated the resulting C code. They still ended up
with a huge bucketload of code. We don't have the same conveniences in
kernel-land. All the nice toys are userspace.

>> The method of generating a host control SMI is not exactly the same  
>> for
>> each PowerEdge system listed in dcdbas.txt.  host_control_smi_type  
>> tells
>> the driver how to generate the host control SMI for the system in use.
>> I'll update dcdbas.txt with the SMI type value associated with the  
>> systems
>> listed in that file.
>
> This is an _excellent_ reason why more of this should be in the kernel.
> What happens if the wrong SMI is used?  Shouldn't it be relatively easy
> for the kernel to determine the correct SMI itself?

No, this is an _EXCELLENT_ reason why _LESS_ of this should be in the
kernel. Why should we have to duplicate a _TON_ of code inside the
kernel to figure out which platform we are on, and then look up in a
table which method to use for that platform? We have a _MUCH_ nicer
programming environment available to us in userspace where we can use
things like libsmbios to look up the platform type, then look in an
easily-updateable text file which smi type to use. In general, plugging
the wrong value here is a no-op.

What you are advocating is that we bloat the kernel beyond belief just
so you can use echo and cat. I thought that we were trying to remove
extra stuff from the kernel. I thought this was the reasoning behind
initramfs and things like irqbalanced.

-- 
Michael



             reply	other threads:[~2005-08-16  4:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-16  4:58 Michael E Brown [this message]
2005-08-16  5:36 ` Valdis.Kletnieks
2005-08-16  6:10   ` Michael E Brown
2005-08-16  6:45     ` Valdis.Kletnieks
2005-08-16 12:15   ` Andrey Panin
     [not found] <4277B1B44843BA48B0173B5B0A0DED4352817E@ausx3mps301.aus.amer.dell.com.suse.lists.linux.kernel>
     [not found] ` <DEFA2736-585A-4F84-9262-C3EB53E8E2A0@mac.com.suse.lists.linux.kernel>
     [not found]   ` <1124161828.10755.87.camel@soltek.michaels-house.net.suse.lists.linux.kernel>
     [not found]     ` <20050816081622.GA22625@kroah.com.suse.lists.linux.kernel>
     [not found]       ` <1124199265.10755.310.camel@soltek.michaels-house.net.suse.lists.linux.kernel>
     [not found]         ` <20050816203706.GA27198@kroah.com.suse.lists.linux.kernel>
     [not found]           ` <4277B1B44843BA48B0173B5B0A0DED43528192@ausx3mps301.aus.amer.dell.com.suse.lists.linux.kernel>
2005-08-17  0:23             ` Andi Kleen
2005-08-17  0:41               ` Michael E Brown
  -- strict thread matches above, loose matches on Subject: below --
2005-08-16 23:47 Michael_E_Brown
2005-08-17  5:33 ` Matt Domsch
2005-08-17  7:32   ` Kyle Moffett
2005-08-16  5:19 Michael E Brown
2005-08-16  5:35 ` Chris Wedgwood
2005-08-16  5:50   ` Michael E Brown
2005-08-16  4:09 Michael E Brown
2005-08-16  5:17 ` Valdis.Kletnieks
2005-08-16  5:30   ` Michael E Brown
2005-08-15 22:58 Michael_E_Brown
2005-08-16  1:29 ` Kyle Moffett
2005-08-16  3:10   ` Michael E Brown
2005-08-16  5:59     ` Nathan Lutchansky
2005-08-16  8:16     ` Greg KH
2005-08-16 13:34       ` Michael E Brown
2005-08-16 20:31         ` Pavel Machek
2005-08-16 20:37         ` Greg KH
2005-08-16 23:11           ` Michael_E_Brown
2005-08-16 23:23             ` Greg KH
2005-08-15 20:05 Doug Warzecha
2005-08-15 20:23 ` Kyle Moffett
2005-08-15 23:38   ` Doug Warzecha
2005-08-16  1:44     ` Kyle Moffett
2005-08-16  2:43     ` Valdis.Kletnieks
2005-08-16  4:34   ` Chris Wedgwood
2005-08-16  4:55     ` Kyle Moffett
2005-08-16  5:14       ` Chris Wedgwood
2005-08-16  5:52 ` Greg KH
2005-08-17  0:02   ` Doug Warzecha

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=1124168323.10755.179.camel@soltek.michaels-house.net \
    --to=michael_e_brown@dell.com \
    --cc=Douglas_Warzecha@dell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    /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®