Re: [PATCH 4/4] ACPI PCI slot detection driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gary Hade
Date: Thursday, March 13, 2008 - 7:16 pm

Hi Alex/Kenji-san,

Time for my 2 cents.

On Wed, Mar 12, 2008 at 09:24:10PM -0600, Alex Chiang wrote:
Agreed. 

Based on my review of ACPI spec 3.0b I would add:
  1. For a specific device that has only _STA and _SUN methods,
     _SUN can be run and it's results can be trusted irrespective
     of the _STA return value.
  2. For a specific device that has _STA, _INI, and _SUN methods,
     _SUN can be run and it's results can be trusted even if
    _INI is not run because the device is absent.  If the device
    is present and _INI is run then _SUN cannot be run until
    after _INI is run.

  See ACPI spec 3.0b "6.1.8 _SUN (Slot User Number)" which
  says nothing about a required presence of the device.

Agreed.


I checked this on the IBM x3850 and it appears to be true.  I 
instrumented register_slot() in drivers/pci/hotplug/acpiphp_glue.c
to print _STA and _SUN returns and got the following results with
slot 1 (PCI-X) populated, slot 2 (PCI-X) vacant, slot 3 (PCIe) vacant,
slot 4 (PCIe) populated, slot 5 (PCIe) vacant, and slot 6 (PCIe)
populated.  When a card is present _STA returns non-zero status
for all functions, otherwise it returns zero.  None of the SxFy
devices have an _INI method.

acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
acpiphp_glue: found PCI host-bus bridge with hot-pluggable slots
acpiphp_glue: register_slot: \_SB_.VP02.S1F0 sta=0 sun=1
acpiphp_glue: found ACPI PCI Hotplug slot 1 at PCI 0000:02:01
acpiphp: Slot [1] registered
acpiphp_glue: register_slot: \_SB_.VP02.S1F1 sta=0 sun=1
acpiphp_glue: register_slot: \_SB_.VP02.S1F2 sta=0 sun=1
acpiphp_glue: register_slot: \_SB_.VP02.S1F3 sta=0 sun=1
acpiphp_glue: register_slot: \_SB_.VP02.S1F4 sta=0 sun=1
acpiphp_glue: register_slot: \_SB_.VP02.S1F5 sta=0 sun=1
acpiphp_glue: register_slot: \_SB_.VP02.S1F6 sta=0 sun=1
acpiphp_glue: register_slot: \_SB_.VP02.S1F7 sta=0 sun=1
acpiphp_glue: found PCI host-bus bridge with hot-pluggable slots
acpiphp_glue: register_slot: \_SB_.VP03.S2F0 sta=f sun=2
acpiphp_glue: found ACPI PCI Hotplug slot 2 at PCI 0000:06:01
acpiphp: Slot [2] registered
acpiphp_glue: register_slot: \_SB_.VP03.S2F1 sta=f sun=2
acpiphp_glue: register_slot: \_SB_.VP03.S2F2 sta=f sun=2
acpiphp_glue: register_slot: \_SB_.VP03.S2F3 sta=f sun=2
acpiphp_glue: register_slot: \_SB_.VP03.S2F4 sta=f sun=2
acpiphp_glue: register_slot: \_SB_.VP03.S2F5 sta=f sun=2
acpiphp_glue: register_slot: \_SB_.VP03.S2F6 sta=f sun=2
acpiphp_glue: register_slot: \_SB_.VP03.S2F7 sta=f sun=2
acpiphp_glue: found PCI-to-PCI bridge at PCI 0000:0a:00.0
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F0 sta=0 sun=3
acpiphp_glue: found ACPI PCI Hotplug slot 3 at PCI 0000:0b:00
acpiphp: Slot [3] registered
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F1 sta=0 sun=3
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F2 sta=0 sun=3
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F3 sta=0 sun=3
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F4 sta=0 sun=3
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F5 sta=0 sun=3
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F6 sta=0 sun=3
acpiphp_glue: register_slot: \_SB_.VP04.CALG.E3F7 sta=0 sun=3
acpiphp_glue: found PCI-to-PCI bridge at PCI 0000:0f:00.0
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F0 sta=f sun=4
acpiphp_glue: found ACPI PCI Hotplug slot 4 at PCI 0000:10:00
acpiphp: Slot [4] registered
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F1 sta=f sun=4
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F2 sta=f sun=4
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F3 sta=f sun=4
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F4 sta=f sun=4
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F5 sta=f sun=4
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F6 sta=f sun=4
acpiphp_glue: register_slot: \_SB_.VP05.CALG.E4F7 sta=f sun=4
acpiphp_glue: found PCI-to-PCI bridge at PCI 0000:14:00.0
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F0 sta=0 sun=5
acpiphp_glue: found ACPI PCI Hotplug slot 5 at PCI 0000:15:00
acpiphp: Slot [5] registered
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F1 sta=0 sun=5
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F2 sta=0 sun=5
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F3 sta=0 sun=5
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F4 sta=0 sun=5
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F5 sta=0 sun=5
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F6 sta=0 sun=5
acpiphp_glue: register_slot: \_SB_.VP06.CALG.E5F7 sta=0 sun=5
acpiphp_glue: found PCI-to-PCI bridge at PCI 0000:19:00.0
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F0 sta=f sun=6
acpiphp_glue: found ACPI PCI Hotplug slot 6 at PCI 0000:1a:00
acpiphp: Slot [6] registered
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F1 sta=f sun=6
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F2 sta=f sun=6
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F3 sta=f sun=6
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F4 sta=f sun=6
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F5 sta=f sun=6
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F6 sta=f sun=6
acpiphp_glue: register_slot: \_SB_.VP07.CALG.E6F7 sta=f sun=6
acpiphp_glue: Bus 0000:1a has 1 slot
acpiphp_glue: Bus 0000:15 has 1 slot
acpiphp_glue: Bus 0000:10 has 1 slot
acpiphp_glue: Bus 0000:0b has 1 slot
acpiphp_glue: Bus 0000:06 has 1 slot
acpiphp_glue: Bus 0000:02 has 1 slot
acpiphp_glue: Total 6 slots


I am not convinced that this a correct interpretation.  I believe
that the ACPI spec indicates that it is legal to call _SUN and
trust it's results no matter what _STA returns.  I believe the
only constraint on running _SUN is that it be run after _INI is run
if _INI exists for the same device and _STA for that device
indicates that it should be run.

Gary

-- 
Gary Hade
System x Enablement
IBM Linux Technology Center
503-578-4503  IBM T/L: 775-4503
garyhade@us.ibm.com
http://www.ibm.com/linux/ltc

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/4, v7] PCI, ACPI: Physical PCI slot objects, Alex Chiang, (Thu Feb 28, 5:23 pm)
[PATCH 1/4] Remove path attribute from sgi_hotplug, Alex Chiang, (Thu Feb 28, 5:26 pm)
[PATCH 2/4] Construct one fakephp slot per pci slot, Alex Chiang, (Thu Feb 28, 5:27 pm)
[PATCH 3/4] Introduce pci_slot, Alex Chiang, (Thu Feb 28, 5:28 pm)
[PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Thu Feb 28, 5:29 pm)
Re: [PATCH 3/4] Introduce pci_slot, Greg KH, (Fri Feb 29, 10:24 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Greg KH, (Fri Feb 29, 10:25 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Matthew Wilcox, (Sat Mar 1, 7:43 am)
Re: [PATCH 1/4] Remove path attribute from sgi_hotplug, Jesse Barnes, (Mon Mar 3, 11:48 am)
Re: [PATCH 1/4] Remove path attribute from sgi_hotplug, Prarit Bhargava, (Mon Mar 3, 11:54 am)
Re: [PATCH 3/4] Introduce pci_slot, Alex Chiang, (Mon Mar 3, 1:56 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Greg KH, (Mon Mar 3, 10:49 pm)
Re: [PATCH 3/4] Introduce pci_slot, Greg KH, (Mon Mar 3, 10:58 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Jesse Barnes, (Tue Mar 4, 11:18 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Greg KH, (Tue Mar 4, 12:30 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Jesse Barnes, (Tue Mar 4, 1:02 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kristen Carlson Accardi, (Tue Mar 4, 1:12 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Tue Mar 4, 3:58 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Tue Mar 4, 4:09 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Greg KH, (Tue Mar 4, 4:15 pm)
[PATCH 3/4, v8] Introduce pci_slot, Alex Chiang, (Tue Mar 4, 4:30 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Tue Mar 4, 4:46 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Tue Mar 4, 6:11 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Wed Mar 5, 1:20 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Matthew Wilcox, (Wed Mar 5, 1:34 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Wed Mar 5, 7:07 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Tue Mar 11, 6:10 am)
[PATCH 3/(3+1)] ACPI PCI slot detection driver, Kenji Kaneshige, (Tue Mar 11, 6:13 am)
Re: [PATCH 3/(3+1)] ACPI PCI slot detection driver, Kenji Kaneshige, (Tue Mar 11, 6:17 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Matthew Wilcox, (Tue Mar 11, 6:28 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Jesse Barnes, (Tue Mar 11, 9:56 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kristen Carlson Accardi, (Tue Mar 11, 11:04 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Tue Mar 11, 12:14 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kristen Carlson Accardi, (Tue Mar 11, 4:34 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Tue Mar 11, 9:08 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Tue Mar 11, 10:51 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Wed Mar 12, 3:50 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Wed Mar 12, 4:33 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Wed Mar 12, 5:59 am)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Wed Mar 12, 8:24 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Gary Hade, (Thu Mar 13, 7:16 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Kenji Kaneshige, (Thu Mar 13, 10:34 pm)
Re: [PATCH 4/4] ACPI PCI slot detection driver, Alex Chiang, (Tue Mar 18, 1:49 pm)