Cc: <pcihpd-discuss@...>, Gary Hade <garyhade@...>, Matthew Wilcox <matthew@...>, <gregkh@...>, <kristen.c.accardi@...>, <lenb@...>, <rick.jones2@...>, <linux-kernel@...>, <linux-pci@...>, <linux-acpi@...>
Hi Kenji-san,
I have been thinking about this problem for quite a bit, and
think that there are no good solutions...
* Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>:
If I/O unit A or B can never appear while the system is turned on
(aka not hotpluggable), then it is incorrect to present them in
the current namespace.
There is nothing illegal about evaluating _SUN for an object that
returns 0x0 for _STA.
Also, when you say "non-existing", I think of the ACPI CA
exception code AE_NOT_EXIST which means "absent from
the namespace", and is the reason why my code works on both HP
and IBM machines. It does not mean "_STA == 0x0".
I did some experiments on HP low-end ia64 (ACPI 1.0b only) and
our mid-range and high-end ia64 platforms (ACPI 2.0c). Checking
for _STA before evaluating _SUN leads to the same result for me:
we only detect populated slots.
I think that the real issue is not 1.0 vs 2.0, but the semantics
that our different firmware teams have placed on _STA. Again,
- HP firmware thinks _STA should give status of the card
- Fujitsu firmware thinks _STA should give status of the slot
So we are at an impasse. :(
I did some experiments to see if I could write a quick hack, like
- do not register a slot if we've already seen this _SUN
But it broke my reference counting, and I don't think it would be
robust enough if users wanted to modprobe/rmmod pci_slot and
acpiphp/pciehp in random order.
I do not agree that _SUN should return a repeating, non-compliant
value even if _STA says the device is not present. A truly
non-existent device is one that does not appear in the namespace.
If you cannot hotplug an I/O unit on your machine, then your
firmware shouldn't be presenting those devices in the namespace.
I think the best option would be for your firmware to return the
actual value of _SUN if I/O unit A and/or B was plugged in. That
way, nothing special has to happen when the units are hotplugged
-- they'll already have correct entries in sysfs. If they are
never hotplugged, it shouldn't be confusing for the user, since
they will never actually get any devices in those slots anyway.
What happens if you try to load acpiphp on your system today?
Does it work, or do you get the same messages about trying to
create multiple entries in sysfs with the same name?
Do you have any better ideas for detecting all physical slots in
a system, regardless of whether they are populated?
Thanks.
/ac
--