Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: New ACPI power resource code for testing



(BTW, why is this only on port-i386? Shouldn't this be wider, either current-users or at least port-amd64?)

One possible way out of this mess:

Define acpi_power.c as a needs-flag (or needs-count) file, and include
the generated header file.  Then you can use #if <foo> preprocessor
directives to determine if you have the power device configured. If yes, then feel free to call the initialization code and to register the consumers; if not defined, but you find that you want to register a consumer, report it using aprint_error_dev()


On Sun, 7 Mar 2010, Jukka Ruohonen wrote:

On Sun, Mar 07, 2010 at 06:28:25AM -0800, Paul Goyette wrote:
I'm thinking more of people who want to compile their own kernels and
keep the memory footprint to a minimum.  They should be able to compile
the acpitz device without the acpipower.  The typical(?) situation would
be to boot up a generic kernel and examine the device tree, then create
a custom config file.  With the proposed acpipower, a system might not
have any acpipoer devices attach, but the code would still be required.

Somehow, it just seems counter-intuitive to me that device support code
is required for a device that is not present.  If the code is required,
then in my opinion it should not be represented as a configurable
device.

Perhaps a compromise would be to split the interface-handling code (namely
getting and setting the power state) and the device-specific code. This way
you would have the best of both worlds; you could have acpitz(4) but compile
the whole kernel without power resource code. This of course may cripple the
functionality. Either way, keeping memory footprint at minimum and
unconditionally compiling things to the kernel are kind of conflicting
goals (not that it matters with this tiny bit of code).

Actually, it would be best to move the power state etc. -flags to the acpi
device node structure. The same thing should perhaps be done to all ACPI
code (e.g. wakedevs) that deals with the device nodes but maintains local
data structures.

Nota bene: there is already a well-known implicit dependency built-in to the
whole acpi(4) subsystem; practically each and every driver already depends
on acpiec(4).

- Jukka.


-------------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:      |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul at whooppee.com   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index