lkml.org 
[lkml]   [2006]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] Include ACPI DSDT from INITRD patch into mainline
On Sat, 02 Dec 2006 11:30:32 +0100 Arjan van de Ven wrote:

> On Fri, 2006-12-01 at 13:36 -0500, Ben Collins wrote:
> > I'd be willing to bet that most distros have this patch in their kernel.
> > One of those things we can't really live without.
> >
> > What I haven't understood is why it isn't included in the mainline
> > kernel yet.
>
> it's not that hard ;)
>
> replacing the DSDT code *while it's live* is just a bad idea.

But the suggested patch does not do this.

> The kernel already has a facility to override the DSDT, but that one
> does it *from the start*. Sounds like that one should be used or
> maybe enhanced a little to make it more distro friendly if something
> is lacking.

The patch replaces the DSDT with the binary from initramfs in the same
acpi_os_table_override() function as the currently available
CONFIG_ACPI_CUSTOM_DSDT does:

@@ -226,13 +291,20 @@ acpi_os_table_override(struct acpi_table
if (!existing_table || !new_table)
return AE_BAD_PARAMETER;

+ *new_table = NULL;
+
#ifdef CONFIG_ACPI_CUSTOM_DSDT
if (strncmp(existing_table->signature, "DSDT", 4) == 0)
*new_table = (struct acpi_table_header *)AmlCode;
- else
- *new_table = NULL;
-#else
- *new_table = NULL;
+#endif
+#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
+ if (strncmp(existing_table->signature, "DSDT", 4) == 0) {
+ struct acpi_table_header* initrd_table = acpi_find_dsdt_initrd();
+ if (initrd_table) {
+ *new_table = initrd_table;
+ acpi_must_unregister_table = TRUE;
+ }
+ }
#endif
return AE_OK;
}

However, this patch slightly changes initialization order of some
kernel parts:

- The call to populate_rootfs() is moved before calls to
smp_prepare_cpus(max_cpus), do_pre_smp_initcalls(), smp_init(),
sched_init_smp() and cpuset_init_smp().

- The call to acpi_early_init() is moved from start_kernel() (where
it is done just before rest_init()) to rest_init(), where it is now
preceded by lock_kernel(), set_cpus_allowed(current, CPU_MASK_ALL),
child_reaper = current and the moved populate_rootfs().

Not sure if this reordering is safe in theory, but it works for many
users of the patch.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-12-02 17:21    [W:0.090 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site