From: Luca Tettamanti <kronos.it@gmail.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: Thomas Renninger <trenn@suse.de>,
Hans de Goede <hdegoede@redhat.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] ACPI: add "auto" to acpi_enforce_resources
Date: Mon, 2 Feb 2009 12:38:24 +0100 [thread overview]
Message-ID: <68676e00902020338o7326ff7dx4efadf94ed534acf@mail.gmail.com> (raw)
In-Reply-To: <20090202101103.1208c035@hyperion.delvare>
On Mon, Feb 2, 2009 at 10:11 AM, Jean Delvare <khali@linux-fr.org> wrote:
> On Sun, 1 Feb 2009 22:22:43 +0100, Luca Tettamanti wrote:
>> --- a/drivers/acpi/osl.c
>> +++ b/drivers/acpi/osl.c
>> @@ -1063,7 +1063,10 @@ __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
>> * in arbitrary AML code and can interfere with legacy drivers.
>> * acpi_enforce_resources= can be set to:
>> *
>> - * - strict (2)
>> + * - auto (2)
>> + * -> detect possible conflicts with ACPI drivers and switch to
>> + * strict if needed, otherwise act like lax
>> + * - strict (3)
>> * -> further driver trying to access the resources will not load
>> * - lax (default) (1)
>> * -> further driver trying to access the resources will load, but you
>> @@ -1073,11 +1076,12 @@ __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
>> * -> ACPI Operation Region resources will not be registered
>> *
>> */
>> -#define ENFORCE_RESOURCES_STRICT 2
>> +#define ENFORCE_RESOURCES_STRICT 3
>> +#define ENFORCE_RESOURCES_AUTO 2
>> #define ENFORCE_RESOURCES_LAX 1
>> #define ENFORCE_RESOURCES_NO 0
>
> I don't see any reason to change ENFORCE_RESOURCES_STRICT from 2 to 3.
> Just add ENFORCE_RESOURCES_AUTO as 3 and that's it, makes your patch
> smaller.
There's an unspoken reason ;-) The options are ordered by
"strictness", I was experimenting with an API to export the parameter,
in order to move the code to a separate quirk file. Since it's not
relevant in this patch I'll back out the change.
>> +static int acpi_res_quick_check_hid(const struct dmi_system_id *d)
>> +{
>> + acpi_status ret;
>> + bool found = false;
>> + char *hid;
>> +
>> + if (!d->driver_data)
>> + goto strict;
>> +
>> + hid = d->driver_data;
>> + ret = acpi_get_devices(hid, acpi_res_quick_check_hid_cb,
>> + NULL, (void **)&found);
>> +
>> + if (ret == AE_OK && found)
>> + goto strict;
>> +
>> + return 0;
>> +strict:
>> + printk(KERN_DEBUG "ACPI: detected %s system: "
>> + "enforcing strict resource checking\n", d->ident);
>
> Should be pr_debug().
Actually I was considering raising the level to info, it might make
easier to explain to the users why they cannot load their favorite
driver anymore.
>> + return 1;
>> +}
>> +
>> +/* The following systems have ACPI drivers that might overlap the
>> + * functionality of native drivers (mostly in hwmon subsys). If
>> + * acpi_enforce_resources is set to auto the following table is
>> + * used to enforce strict checking in matching systems, in order
>> + * to avoid conflicts.
>> + * Note that driver_data and the acpi_res_quick_check_hid callback
>> + * are used to further refine the match, checking for the presence
>> + * of the given HID (driver_data) in the DSDT. Both fields are
>> + * optional for DMI-only rules.
>> + */
>> +static const struct dmi_system_id resource_quirks[] = {
>
> You must include <linux/dmi.h> for this.
Right, it's included indirectly from somewhere...
> I think it's better to tag this structure as __initdata than const, so
> that it is cleaned up after initialization. Then I guess you can also
> tag acpi_res_quick_check_hid_cb() and acpi_res_quick_check_hid() as
> __init so the runtime memory overhead is zero.
Ok, will do.
Luca
next prev parent reply other threads:[~2009-02-02 11:38 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-25 21:05 Luca Tettamanti
2009-01-26 8:37 ` Hans de Goede
2009-01-29 10:30 ` Thomas Renninger
2009-01-29 15:16 ` Luca Tettamanti
2009-01-29 16:29 ` Thomas Renninger
2009-01-29 18:58 ` Hans de Goede
2009-01-29 21:31 ` Jean Delvare
2009-01-30 14:29 ` Thomas Renninger
2009-02-01 21:22 ` Luca Tettamanti
2009-02-02 9:11 ` Jean Delvare
2009-02-02 11:38 ` Luca Tettamanti [this message]
2009-02-02 17:22 ` [PATCH 1/2] RFC: ACPI: Interface for ACPI drivers to place quirk code which gets executed early Thomas Renninger
2009-02-02 20:22 ` Luca Tettamanti
2009-02-03 13:08 ` Thomas Renninger
2009-02-03 13:45 ` Luca Tettamanti
2009-02-03 14:19 ` Jean Delvare
2009-02-04 13:37 ` Thomas Renninger
2009-02-02 17:22 ` [PATCH 2/2] RFC: ACPI: Set enforce_resources to strict if a ATK0110 device is found in namespace Thomas Renninger
2009-02-02 20:29 ` Luca Tettamanti
2009-02-02 11:38 ` [PATCH] ACPI: add "auto" to acpi_enforce_resources Thomas Renninger
2009-01-29 21:15 ` Luca Tettamanti
2009-02-04 5:52 ` Len Brown
2009-02-04 6:05 ` Matthew Garrett
2009-02-04 8:37 ` Hans de Goede
2009-02-04 13:17 ` Matthew Garrett
2009-02-04 13:26 ` Jean Delvare
2009-02-04 14:20 ` Matthew Garrett
2009-02-10 13:57 ` Jean Delvare
2009-02-10 14:08 ` Matthew Garrett
2009-02-10 15:32 ` Hans de Goede
2009-02-10 16:24 ` Jean Delvare
2009-02-27 13:27 ` Pavel Machek
2009-03-24 12:39 ` Luca Tettamanti
2009-03-24 13:21 ` Hans de Goede
2009-03-24 13:43 ` Jean Delvare
2009-03-24 14:29 ` Hans de Goede
2009-03-29 20:16 ` Luca Tettamanti
2009-03-29 20:33 ` Pavel Machek
2009-03-29 20:55 ` Jean Delvare
2009-03-29 22:01 ` Luca Tettamanti
2009-03-30 7:36 ` Jean Delvare
2009-04-02 22:59 ` Len Brown
2009-04-03 9:40 ` Jean Delvare
2009-02-12 12:44 ` Jean Delvare
2009-04-02 22:45 ` polling (Re: [PATCH] ACPI: add "auto" to acpi_enforce_resources) Len Brown
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=68676e00902020338o7326ff7dx4efadf94ed534acf@mail.gmail.com \
--to=kronos.it@gmail.com \
--cc=hdegoede@redhat.com \
--cc=khali@linux-fr.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=trenn@suse.de \
/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®