public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, Eric Piel <eric.piel@altlinux.org>,
	Ben Collins <ben.collins@ubuntu.com>
Subject: Re: [RFC] Include ACPI DSDT from INITRD patch into mainline
Date: Sat, 2 Dec 2006 19:15:19 +0300	[thread overview]
Message-ID: <20061202191519.a25282ad.vsu@altlinux.ru> (raw)
In-Reply-To: <1165055432.3233.151.camel@laptopd505.fenrus.org>

[-- Attachment #1: Type: text/plain, Size: 2129 bytes --]

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.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2006-12-02 16:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-01 18:36 [RFC] Include ACPI DSDT from INITRD patch into mainline Ben Collins
2006-12-01 18:56 ` Alan
2006-12-01 19:35   ` Ben Collins
2006-12-01 19:45     ` Arjan van de Ven
2006-12-01 21:01       ` Ben Collins
2006-12-01 21:49         ` Arjan van de Ven
2006-12-01 22:35           ` Ben Collins
2006-12-02  7:45             ` Arjan van de Ven
2006-12-04 10:58               ` Stefan Seyfried
2006-12-01 19:53     ` Alan
2006-12-01 20:58       ` Ben Collins
2006-12-01 21:55         ` Alan
2006-12-01 22:01           ` Arkadiusz Miskiewicz
2006-12-01 22:17             ` Alan
2006-12-02 10:28               ` Arjan van de Ven
2006-12-02 12:50             ` Acer smart battery (was Re: [RFC] Include ACPI DSDT from INITRD patch into mainline) Pavel Machek
2006-12-02 17:34               ` Arkadiusz Miskiewicz
2006-12-02 18:58                 ` Pavel Machek
2006-12-02  0:21         ` [RFC] Include ACPI DSDT from INITRD patch into mainline Dave Jones
2006-12-02 10:25           ` Arjan van de Ven
2006-12-02 10:30 ` Arjan van de Ven
2006-12-02 11:11   ` Jan Engelhardt
2006-12-02 16:15   ` Sergey Vlasov [this message]

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=20061202191519.a25282ad.vsu@altlinux.ru \
    --to=vsu@altlinux.ru \
    --cc=arjan@infradead.org \
    --cc=ben.collins@ubuntu.com \
    --cc=eric.piel@altlinux.org \
    --cc=linux-kernel@vger.kernel.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