Re: pci-express hotplug

From: Alex Chiang
Date: Mon Oct 26 2009 - 22:48:51 EST


* Jens Axboe <jens.axboe@xxxxxxxxxx>:
> > > acpiphp: enable_slot - physical_slot = 1
> > > acpiphp_glue: acpiphp_enable_slot: Slot status is not ACPI_STA_ALL
> > > acpiphp: enable_slot - physical_slot = 2
> > > acpiphp_glue: acpiphp_enable_slot: Slot status is not ACPI_STA_ALL
> > > acpiphp: enable_slot - physical_slot = 6
> > > acpiphp_glue: acpiphp_enable_slot: Slot status is not ACPI_STA_ALL
> > > acpiphp: enable_slot - physical_slot = 7
> > > acpiphp_glue: acpiphp_enable_slot: Slot status is not ACPI_STA_ALL
> >
> > Hm, so for some reason, firmware on your machine is telling us
> > that it doesn't think cards are present and/or enabled.
> >
> > Unfortunately, I don't know why your firmware would be saying
> > that. We could add some more debug printks to see what firmware
> > thinks about your system... Or we could just wait and see what
> > happens after you get your hardware replaced.

Let's try and find out why firmware is telling us that we didn't
get ACPI_STA_ALL.

Can you please apply this debug patch and send the output? Again,
please modprobe with debug=1.

Thanks,
/ac

---
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 58d25a1..2caa447 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -797,9 +797,13 @@ static int power_on_slot(struct acpiphp_slot *slot)
struct list_head *l;
int retval = 0;

+ printk("%s\n", __func__);
+
/* if already enabled, just skip */
- if (slot->flags & SLOT_POWEREDON)
+ if (slot->flags & SLOT_POWEREDON) {
+ printk(" slot %ld already powered on\n", slot->sun);
goto err_exit;
+ }

list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling);
@@ -813,6 +817,8 @@ static int power_on_slot(struct acpiphp_slot *slot)
goto err_exit;
} else
break;
+ } else {
+ printk(" no _PS0\n");
}
}

@@ -1122,11 +1128,14 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot)
struct list_head *l;
struct acpiphp_func *func;

+ printk("%s\n", __func__);
+
list_for_each (l, &slot->funcs) {
func = list_entry(l, struct acpiphp_func, sibling);

if (func->flags & FUNC_HAS_STA) {
status = acpi_evaluate_integer(func->handle, "_STA", NULL, &sta);
+ printk(" FUNC_HAS_STA status %d _STA %#lx\n", status, sta);
if (ACPI_SUCCESS(status) && sta)
break;
} else {
@@ -1134,6 +1143,7 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot)
PCI_DEVFN(slot->device,
func->function),
PCI_VENDOR_ID, &dvid);
+ printk(" reading config space dvid %#lx\n", dvid);
if (dvid != 0xffffffff) {
sta = ACPI_STA_ALL;
break;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/