mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Knut Petersen <Knut_Petersen@t-online.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: lenb@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Fix Aopen i915GMm-hfs hwmon support
Date: Wed, 09 Sep 2009 23:17:04 +0200	[thread overview]
Message-ID: <4AA81B50.9060300@t-online.de> (raw)

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

Hi Linus!

Hwmon support is broken for the Aopen i915GMm-hfs. The
reason is the default value ENFORCE_RESOURCES_STRICT
for acpi_enforce_resources in drivers/acpi/osl.c.

The use of ENFORCE_RESOURCES_LAX is proven to be ok
by more than 30000 hours of uptime on my i915GMm-hfs.

Of course, it would be possible to tell all users of that board
to add a cmdline parameter to restore hwmon support, but
I believe that it is a good idea to do things automatically that
can be done that way. And we should only break things if
it is really necessary.

The attached trivial patch looks for the i915GMm-hfs board
during init and changes the default to lax ACPI resource
checking only for that board. I think this is reasonable, and
probably a number of other boards could also be handled
that way.

There is a high probability that for lots of people 2.6.31 will
be their first kernel using strict resource enforcement, as
2.6.31 will be used by a number of distributions.

Because of that I believe this patch should be included in
kernel 2.6.31.

cu,
 Knut

[-- Attachment #2: acpiosl.patch --]
[-- Type: text/x-patch, Size: 1348 bytes --]

--- linux-2.6.31-rc9-git3/drivers/acpi/osl.c	2009-09-06 01:38:12.000000000 +0200
+++ linux-2.6.31-rc9-git3-kp/drivers/acpi/osl.c	2009-09-09 18:41:51.000000000 +0200
@@ -1113,6 +1113,8 @@
  *   - no               (0)
  *     -> ACPI Operation Region resources will not be registered
  *
+ *     We do detect some special boards and switch to lax checking
+ *     as we do not want to break support of sensors.
  */
 #define ENFORCE_RESOURCES_STRICT 2
 #define ENFORCE_RESOURCES_LAX    1
@@ -1120,8 +1122,30 @@
 
 static unsigned int acpi_enforce_resources = ENFORCE_RESOURCES_STRICT;
 
+static int enforce_resources_lax(const struct dmi_system_id *d)
+{
+
+	printk(KERN_NOTICE "ACPI: %s detected: "
+		"using lax resource checking\n", d->ident);
+	acpi_enforce_resources = ENFORCE_RESOURCES_LAX;
+	return 0;
+}
+
+static struct dmi_system_id osl_dmi_table[] __initdata = {
+	{
+		.callback = enforce_resources_lax,
+		.ident = "AOpen i915GMm-HFS",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
+			DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
+		},
+	},
+	{}
+};
+
 static int __init acpi_enforce_resources_setup(char *str)
 {
+
 	if (str == NULL || *str == '\0')
 		return 0;
 
@@ -1421,3 +1445,11 @@
 }
 
 #endif
+
+static int __init acpi_osl_init(void)
+{
+	dmi_check_system(osl_dmi_table);
+	return 0;
+}
+
+module_init(acpi_osl_init);

                 reply	other threads:[~2009-09-09 21:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4AA81B50.9060300@t-online.de \
    --to=knut_petersen@t-online.de \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

Powered by JetHome