Re: [Pcihpd-discuss] RE: [RFC/Patch 0/12] ACPI based root bridge hot-add

2005-04-01 Thread Tom Duffy
On Thu, 2005-03-31 at 14:03 -0800, Rajesh Shah wrote:
> Does this patch help?

YES!  I can now power down the slot, see it gone from pci list, reenable
it, etc.  Awesome.  Thank you.

[EMAIL PROTECTED] ~]# lspci -s 08:00
08:00.0 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
08:00.1 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
[EMAIL PROTECTED] ~]# cd /sys/bus/pci/slots/4/
[EMAIL PROTECTED] 4]# cat power
1
[EMAIL PROTECTED] 4]# echo 0 > power
[EMAIL PROTECTED] 4]# lspci -s 08:00
[EMAIL PROTECTED] 4]# cat power
0
[EMAIL PROTECTED] 4]# echo 1 > power
[EMAIL PROTECTED] 4]# lspci -s 08:00
08:00.0 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
08:00.1 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)



signature.asc
Description: This is a digitally signed message part


Re: [Pcihpd-discuss] RE: [RFC/Patch 0/12] ACPI based root bridge hot-add

2005-04-01 Thread Tom Duffy
On Thu, 2005-03-31 at 14:03 -0800, Rajesh Shah wrote:
 Does this patch help?

YES!  I can now power down the slot, see it gone from pci list, reenable
it, etc.  Awesome.  Thank you.

[EMAIL PROTECTED] ~]# lspci -s 08:00
08:00.0 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
08:00.1 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
[EMAIL PROTECTED] ~]# cd /sys/bus/pci/slots/4/
[EMAIL PROTECTED] 4]# cat power
1
[EMAIL PROTECTED] 4]# echo 0  power
[EMAIL PROTECTED] 4]# lspci -s 08:00
[EMAIL PROTECTED] 4]# cat power
0
[EMAIL PROTECTED] 4]# echo 1  power
[EMAIL PROTECTED] 4]# lspci -s 08:00
08:00.0 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
08:00.1 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)



signature.asc
Description: This is a digitally signed message part


Re: [Pcihpd-discuss] RE: [RFC/Patch 0/12] ACPI based root bridge hot-add

2005-03-31 Thread Rajesh Shah
On Wed, Mar 23, 2005 at 03:03:16PM -0800, Tom Duffy wrote:
> 
> I have updated to Wilcox's rewrite, Rajesh's stuff, and Dely's latest
> patch.  Still seeing these:
> 
> [EMAIL PROTECTED] ~]# modprobe acpiphp
> acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
> acpiphp: Slot [4] registered
> acpiphp: Slot [3] registered
> 
> [EMAIL PROTECTED] ~]# cd /sys/bus/pci/slots/4
> 
> [EMAIL PROTECTED] 4]# echo 0 > power
> 
> This *does* take this slot off line.  Before, I see in lscpi

Note that the current code also attempts to physically eject the
card when you power it off like this. 

> After, these are gone.
> 
> [EMAIL PROTECTED] 4]# cat power
> 1
> 
> Hrm, this should be 0.
> 
The code invokes an ACPI _STAtus method to report the power state.
It can get confused if that reports that the device is still
present. The code does keep internal info about the power state
of each slot, but it doesn't use it to report power state.

> [EMAIL PROTECTED] 4]# echo 1 > power
> acpiphp_glue: No new device found
> 
If the firmware had a working _EJ0 method for this slot, the
card has been physically ejected.

Does this patch help? It decouples power changes from physical
ejection. With this, you can use the sysfs power control file
to repeatedly power a device on and off. You have to use an
acpi button press to actually physically eject it. Patch 
applies on 2.6.12-rc1-mm4 on top of the acpiphp re-write
plus all the other new patches.

---

Current acpiphp code does not distinguish between the physical
presence and power state of a device/slot. That is, if a device
has to be disabled, it also tries to physically ejects the device.
This patch decouples power state from physical presence. You can
now echo to the corresponding sysfs power control file to 
repeatedly enable and disable a device without having to
physically re-insert it. 

Signed-off-by: Rajesh Shah <[EMAIL PROTECTED]>

---

 linux-2.6.12-rc1-mm4-rshah1/drivers/pci/hotplug/acpiphp_glue.c |   69 
+-
 1 files changed, 38 insertions(+), 31 deletions(-)

diff -puN drivers/pci/hotplug/acpiphp_glue.c~acpiphp-decouple-power-eject 
drivers/pci/hotplug/acpiphp_glue.c
--- 
linux-2.6.12-rc1-mm4/drivers/pci/hotplug/acpiphp_glue.c~acpiphp-decouple-power-eject
2005-03-31 13:10:24.846754032 -0800
+++ linux-2.6.12-rc1-mm4-rshah1/drivers/pci/hotplug/acpiphp_glue.c  
2005-03-31 13:12:20.483471366 -0800
@@ -592,8 +592,6 @@ static int power_off_slot(struct acpiphp
acpi_status status;
struct acpiphp_func *func;
struct list_head *l;
-   struct acpi_object_list arg_list;
-   union acpi_object arg;
 
int retval = 0;
 
@@ -615,27 +613,6 @@ static int power_off_slot(struct acpiphp
}
}
 
-   list_for_each (l, >funcs) {
-   func = list_entry(l, struct acpiphp_func, sibling);
-
-   /* We don't want to call _EJ0 on non-existing functions. */
-   if (func->flags & FUNC_HAS_EJ0) {
-   /* _EJ0 method take one argument */
-   arg_list.count = 1;
-   arg_list.pointer = 
-   arg.type = ACPI_TYPE_INTEGER;
-   arg.integer.value = 1;
-
-   status = acpi_evaluate_object(func->handle, "_EJ0", 
_list, NULL);
-   if (ACPI_FAILURE(status)) {
-   warn("%s: _EJ0 failed\n", __FUNCTION__);
-   retval = -1;
-   goto err_exit;
-   } else
-   break;
-   }
-   }
-
/* TBD: evaluate _STA to check if the slot is disabled */
 
slot->flags &= (~SLOT_POWEREDON);
@@ -782,6 +759,39 @@ static unsigned int get_slot_status(stru
 }
 
 /**
+ * acpiphp_eject_slot - physically eject the slot
+ */
+static int acpiphp_eject_slot(struct acpiphp_slot *slot)
+{
+   acpi_status status;
+   struct acpiphp_func *func;
+   struct list_head *l;
+   struct acpi_object_list arg_list;
+   union acpi_object arg;
+
+   list_for_each (l, >funcs) {
+   func = list_entry(l, struct acpiphp_func, sibling);
+
+   /* We don't want to call _EJ0 on non-existing functions. */
+   if ((func->flags & FUNC_HAS_EJ0)) {
+   /* _EJ0 method take one argument */
+   arg_list.count = 1;
+   arg_list.pointer = 
+   arg.type = ACPI_TYPE_INTEGER;
+   arg.integer.value = 1;
+
+   status = acpi_evaluate_object(func->handle, "_EJ0", 
_list, NULL);
+   if (ACPI_FAILURE(status)) {
+   warn("%s: _EJ0 failed\n", __FUNCTION__);
+   return -1;
+   } else
+   break;
+   }
+   }
+   return 0;
+}
+
+/**
  * 

Re: [Pcihpd-discuss] RE: [RFC/Patch 0/12] ACPI based root bridge hot-add

2005-03-31 Thread Rajesh Shah
On Wed, Mar 23, 2005 at 03:03:16PM -0800, Tom Duffy wrote:
 
 I have updated to Wilcox's rewrite, Rajesh's stuff, and Dely's latest
 patch.  Still seeing these:
 
 [EMAIL PROTECTED] ~]# modprobe acpiphp
 acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
 acpiphp: Slot [4] registered
 acpiphp: Slot [3] registered
 
 [EMAIL PROTECTED] ~]# cd /sys/bus/pci/slots/4
 
 [EMAIL PROTECTED] 4]# echo 0  power
 
 This *does* take this slot off line.  Before, I see in lscpi

Note that the current code also attempts to physically eject the
card when you power it off like this. 

 After, these are gone.
 
 [EMAIL PROTECTED] 4]# cat power
 1
 
 Hrm, this should be 0.
 
The code invokes an ACPI _STAtus method to report the power state.
It can get confused if that reports that the device is still
present. The code does keep internal info about the power state
of each slot, but it doesn't use it to report power state.

 [EMAIL PROTECTED] 4]# echo 1  power
 acpiphp_glue: No new device found
 
If the firmware had a working _EJ0 method for this slot, the
card has been physically ejected.

Does this patch help? It decouples power changes from physical
ejection. With this, you can use the sysfs power control file
to repeatedly power a device on and off. You have to use an
acpi button press to actually physically eject it. Patch 
applies on 2.6.12-rc1-mm4 on top of the acpiphp re-write
plus all the other new patches.

---

Current acpiphp code does not distinguish between the physical
presence and power state of a device/slot. That is, if a device
has to be disabled, it also tries to physically ejects the device.
This patch decouples power state from physical presence. You can
now echo to the corresponding sysfs power control file to 
repeatedly enable and disable a device without having to
physically re-insert it. 

Signed-off-by: Rajesh Shah [EMAIL PROTECTED]

---

 linux-2.6.12-rc1-mm4-rshah1/drivers/pci/hotplug/acpiphp_glue.c |   69 
+-
 1 files changed, 38 insertions(+), 31 deletions(-)

diff -puN drivers/pci/hotplug/acpiphp_glue.c~acpiphp-decouple-power-eject 
drivers/pci/hotplug/acpiphp_glue.c
--- 
linux-2.6.12-rc1-mm4/drivers/pci/hotplug/acpiphp_glue.c~acpiphp-decouple-power-eject
2005-03-31 13:10:24.846754032 -0800
+++ linux-2.6.12-rc1-mm4-rshah1/drivers/pci/hotplug/acpiphp_glue.c  
2005-03-31 13:12:20.483471366 -0800
@@ -592,8 +592,6 @@ static int power_off_slot(struct acpiphp
acpi_status status;
struct acpiphp_func *func;
struct list_head *l;
-   struct acpi_object_list arg_list;
-   union acpi_object arg;
 
int retval = 0;
 
@@ -615,27 +613,6 @@ static int power_off_slot(struct acpiphp
}
}
 
-   list_for_each (l, slot-funcs) {
-   func = list_entry(l, struct acpiphp_func, sibling);
-
-   /* We don't want to call _EJ0 on non-existing functions. */
-   if (func-flags  FUNC_HAS_EJ0) {
-   /* _EJ0 method take one argument */
-   arg_list.count = 1;
-   arg_list.pointer = arg;
-   arg.type = ACPI_TYPE_INTEGER;
-   arg.integer.value = 1;
-
-   status = acpi_evaluate_object(func-handle, _EJ0, 
arg_list, NULL);
-   if (ACPI_FAILURE(status)) {
-   warn(%s: _EJ0 failed\n, __FUNCTION__);
-   retval = -1;
-   goto err_exit;
-   } else
-   break;
-   }
-   }
-
/* TBD: evaluate _STA to check if the slot is disabled */
 
slot-flags = (~SLOT_POWEREDON);
@@ -782,6 +759,39 @@ static unsigned int get_slot_status(stru
 }
 
 /**
+ * acpiphp_eject_slot - physically eject the slot
+ */
+static int acpiphp_eject_slot(struct acpiphp_slot *slot)
+{
+   acpi_status status;
+   struct acpiphp_func *func;
+   struct list_head *l;
+   struct acpi_object_list arg_list;
+   union acpi_object arg;
+
+   list_for_each (l, slot-funcs) {
+   func = list_entry(l, struct acpiphp_func, sibling);
+
+   /* We don't want to call _EJ0 on non-existing functions. */
+   if ((func-flags  FUNC_HAS_EJ0)) {
+   /* _EJ0 method take one argument */
+   arg_list.count = 1;
+   arg_list.pointer = arg;
+   arg.type = ACPI_TYPE_INTEGER;
+   arg.integer.value = 1;
+
+   status = acpi_evaluate_object(func-handle, _EJ0, 
arg_list, NULL);
+   if (ACPI_FAILURE(status)) {
+   warn(%s: _EJ0 failed\n, __FUNCTION__);
+   return -1;
+   } else
+   break;
+   }
+   }
+   return 0;
+}
+
+/**
  * acpiphp_check_bridge - re-enumerate 

Re: [Pcihpd-discuss] RE: [RFC/Patch 0/12] ACPI based root bridge hot-add

2005-03-23 Thread Tom Duffy
On Tue, 2005-03-22 at 19:13 -0800, Dely Sy wrote:
> I just did a test of Rajesh's latest patch on 2.6.11.5 with
> Wilcox's acpiphp rewrite and the following patch.  Hot-plug of 
> PCI Express card worked fine on my i386 system

I have updated to Wilcox's rewrite, Rajesh's stuff, and Dely's latest
patch.  Still seeing these:

[EMAIL PROTECTED] 4]# uname -a
Linux intlhotp-1 2.6.11andro #5 SMP Wed Mar 23 12:00:56 PST 2005 x86_64
x86_64 x86_64 GNU/Linux

[EMAIL PROTECTED] ~]# modprobe acpiphp
acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
acpiphp: Slot [4] registered
acpiphp: Slot [3] registered

[EMAIL PROTECTED] ~]# cd /sys/bus/pci/slots/4

[EMAIL PROTECTED] 4]# echo 0 > power

This *does* take this slot off line.  Before, I see in lscpi
08:00.0 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
08:00.1 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
After, these are gone.

[EMAIL PROTECTED] 4]# cat power
1

Hrm, this should be 0.

[EMAIL PROTECTED] 4]# echo 1 > power
acpiphp_glue: No new device found

There is a card plugged into that slot.

Here is some info from the BIOS:

[EMAIL PROTECTED] 4]# dmidecode
# dmidecode 2.2
SMBIOS 2.3 present.
91 structures occupying 3496 bytes.
Table at 0x000FCA80.
Handle 0x
DMI type 0, 20 bytes.
BIOS Information
Vendor: American Megatrends Inc.
Version: SE7520AF20.86B.P.03.00.0085.092420041113
Release Date: 09/24/2004



Handle 0x0002
DMI type 2, 15 bytes.
Base Board Information
Manufacturer: Intel
Product Name: SE7520AF2HP
Version: FRU Ver 0.3



Handle 0x0034
DMI type 9, 13 bytes.
System Slot Information
Designation: Slot 4 (PCI_Express x8)
Type: 64-bit PCI
Current Usage: Available
Length: Short
ID: 3
Characteristics:
3.3 V is provided
Opening is shared
PME signal is supported

Any ideas?

Thanks,

-tduffy


signature.asc
Description: This is a digitally signed message part


Re: [Pcihpd-discuss] RE: [RFC/Patch 0/12] ACPI based root bridge hot-add

2005-03-23 Thread Tom Duffy
On Tue, 2005-03-22 at 19:13 -0800, Dely Sy wrote:
 I just did a test of Rajesh's latest patch on 2.6.11.5 with
 Wilcox's acpiphp rewrite and the following patch.  Hot-plug of 
 PCI Express card worked fine on my i386 system

I have updated to Wilcox's rewrite, Rajesh's stuff, and Dely's latest
patch.  Still seeing these:

[EMAIL PROTECTED] 4]# uname -a
Linux intlhotp-1 2.6.11andro #5 SMP Wed Mar 23 12:00:56 PST 2005 x86_64
x86_64 x86_64 GNU/Linux

[EMAIL PROTECTED] ~]# modprobe acpiphp
acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
acpiphp: Slot [4] registered
acpiphp: Slot [3] registered

[EMAIL PROTECTED] ~]# cd /sys/bus/pci/slots/4

[EMAIL PROTECTED] 4]# echo 0  power

This *does* take this slot off line.  Before, I see in lscpi
08:00.0 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
08:00.1 Ethernet controller: Intel Corp.: Unknown device 105f (rev 03)
After, these are gone.

[EMAIL PROTECTED] 4]# cat power
1

Hrm, this should be 0.

[EMAIL PROTECTED] 4]# echo 1  power
acpiphp_glue: No new device found

There is a card plugged into that slot.

Here is some info from the BIOS:

[EMAIL PROTECTED] 4]# dmidecode
# dmidecode 2.2
SMBIOS 2.3 present.
91 structures occupying 3496 bytes.
Table at 0x000FCA80.
Handle 0x
DMI type 0, 20 bytes.
BIOS Information
Vendor: American Megatrends Inc.
Version: SE7520AF20.86B.P.03.00.0085.092420041113
Release Date: 09/24/2004

snip

Handle 0x0002
DMI type 2, 15 bytes.
Base Board Information
Manufacturer: Intel
Product Name: SE7520AF2HP
Version: FRU Ver 0.3

snip

Handle 0x0034
DMI type 9, 13 bytes.
System Slot Information
Designation: Slot 4 (PCI_Express x8)
Type: 64-bit PCI
Current Usage: Available
Length: Short
ID: 3
Characteristics:
3.3 V is provided
Opening is shared
PME signal is supported

Any ideas?

Thanks,

-tduffy


signature.asc
Description: This is a digitally signed message part