From: Zhang Rui <rui.zhang@intel.com>
To: Len Brown <lenb@kernel.org>
Cc: "Li, Shaohua" <shaohua.li@intel.com>,
"linux-acpi@vger" <linux-acpi@vger.kernel.org>
Subject: Re: sysfs regression on Supermicro X7DB8+
Date: Fri, 22 Dec 2006 11:12:25 +0800 [thread overview]
Message-ID: <1166757145.12505.78.camel@localhost.localdomain> (raw)
In-Reply-To: <200612211454.04757.lenb@kernel.org>
> > > What is "PNPIDNON" (below) supposed to mean?
> > >
> > For devices with PNPID, we use PNPID:instance_no as the bus_id.
> > But for others without PNPID, we set PNPIDNON:instance_no as their
> > bus_id instead.
>
> There must be a better way to name a device that has no PNPid than PNPIDNON:#
>
> How about "device:#"?
Sounds good. Will do.
> Also, this for the first time exposes the internal fake ones
>
> /* _HID definitions */
>
> #define ACPI_POWER_HID "ACPI_PWR"
> #define ACPI_PROCESSOR_HID "ACPI_CPU"
> #define ACPI_SYSTEM_HID "ACPI_SYS"
> #define ACPI_THERMAL_HID "ACPI_THM"
> #define ACPI_BUTTON_HID_POWERF "ACPI_FPB"
> #define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB"
>
> If we are going to expose these, then we should spend a moment to think about how
> understandable they'll be appearing in the file system. ACPI_FSB doesn't bring
> "Fixed Function Sleep Button" to mind when I see it...
>
> Any reason we can't re-use "ACPI0007" for ACPI_PROCESSOR_HID
> It is already reserved in the spec.
>
> BTW. anybody know what PNP0C08 is supposed to be?
> Seems it is reserved OS use to describe generic ACPI resources
> that are not associated with a particular device.
>
> Note that while I don't think we are constrained here, standard PNP-id's must be of the form AAA####
> where the A's are letters and the #'s are hex. ACPI-id's must be of the form ACPI####
> where #'s are again hex. It would be nice if we could work within those constraints
> and not conflict with the standard in case something is expecting those formats.
> eg. IBM specific devices are IBM####, Toshiba are TOS####.
> But the down-side is that the #### doesn't tell the reader much -- particularly
> if it is non-standard.
All these PNPids are from BIOS, and we expose them to userspace
directly.
Now all ACPI devices are registered before any ACPI driver is found. So
how can we recognize the platform specific devices?
> But if we are not going to stay within the standard format and we are going to blow the 8-character
> convention, then I vote for strings that actually make sense to human,
> say something like this:
>
> #define ACPI_POWER_HID "power_resource"
> #define ACPI_PROCESSOR_HID "processor"
> #define ACPI_SYSTEM_HID "system"
> #define ACPI_THERMAL_HID "thermal"
> #define ACPI_BUTTON_HID_POWERF "button_power_fixed"
> #define ACPI_BUTTON_HID_SLEEPF "button_sleep_fixed"
That's true. I'll convert these fake PNPids to more interesting strings.
Then I have an idea about the other ones. We can also convert the PNPids
reserved in the spec to such kind of strings.
E.g. "PNP0C0D,PNP0C0C,PNP0C0E" "button"
"ACPI0003" "ac_adapter"
"PNP0C0A" "battery"
....
We can use an array to maintain the name mapping between PNPid and
bus_id.
Like this:
struct acpi_name_mapping {
char PNPid[9]; /*both fake PNPids and PNPids reserved by the spec*/
char bus_id[20]; /* names expose to userspace */
int instance_no;
}
static struct acpi_name_mapping acpi_name_mapping_table[] = {
{"PNP0C0A", "battery",0},
{"ACPI_PWER_HID", "powe_resource",0},
....
NULL,
};
Then we can expose such kind of strings to userspace instead of PNPids.
Though it's more friendly, the load is heavy.
The problem is whether it's worth doing.
next prev parent reply other threads:[~2006-12-22 3:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-21 8:41 sysfs regression on Supermicro X7DB8+ Len Brown
2006-12-21 9:28 ` Len Brown
2006-12-21 9:50 ` Zhang Rui
2006-12-21 19:54 ` Len Brown
2006-12-22 3:12 ` Zhang Rui [this message]
2006-12-22 4:10 ` Bjorn Helgaas
2006-12-22 4:51 ` Len Brown
2006-12-22 5:09 ` 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=1166757145.12505.78.camel@localhost.localdomain \
--to=rui.zhang@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=shaohua.li@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.