Commit eae34c67 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI hotplug: ibmphp: Fix module ref count underflow
  PCI hotplug: acpiphp wants a 64-bit _SUN
  PCI: pciehp: fix unexpected power off with pciehp_force
  PCI: fix aer resume sanity check
parents 929096fe 3e3d0e92
...@@ -113,7 +113,7 @@ struct acpiphp_slot { ...@@ -113,7 +113,7 @@ struct acpiphp_slot {
u8 device; /* pci device# */ u8 device; /* pci device# */
u32 sun; /* ACPI _SUN (slot unique number) */ unsigned long long sun; /* ACPI _SUN (slot unique number) */
u32 flags; /* see below */ u32 flags; /* see below */
}; };
......
...@@ -337,7 +337,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot) ...@@ -337,7 +337,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN; slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;
acpiphp_slot->slot = slot; acpiphp_slot->slot = slot;
snprintf(name, SLOT_NAME_SIZE, "%u", slot->acpi_slot->sun); snprintf(name, SLOT_NAME_SIZE, "%llu", slot->acpi_slot->sun);
retval = pci_hp_register(slot->hotplug_slot, retval = pci_hp_register(slot->hotplug_slot,
acpiphp_slot->bridge->pci_bus, acpiphp_slot->bridge->pci_bus,
......
...@@ -255,13 +255,13 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) ...@@ -255,13 +255,13 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
bridge->nr_slots++; bridge->nr_slots++;
dbg("found ACPI PCI Hotplug slot %d at PCI %04x:%02x:%02x\n", dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n",
slot->sun, pci_domain_nr(bridge->pci_bus), slot->sun, pci_domain_nr(bridge->pci_bus),
bridge->pci_bus->number, slot->device); bridge->pci_bus->number, slot->device);
retval = acpiphp_register_hotplug_slot(slot); retval = acpiphp_register_hotplug_slot(slot);
if (retval) { if (retval) {
if (retval == -EBUSY) if (retval == -EBUSY)
warn("Slot %d already registered by another " warn("Slot %llu already registered by another "
"hotplug driver\n", slot->sun); "hotplug driver\n", slot->sun);
else else
warn("acpiphp_register_hotplug_slot failed " warn("acpiphp_register_hotplug_slot failed "
......
...@@ -1402,10 +1402,6 @@ static int __init ibmphp_init(void) ...@@ -1402,10 +1402,6 @@ static int __init ibmphp_init(void)
goto error; goto error;
} }
/* lock ourselves into memory with a module
* count of -1 so that no one can unload us. */
module_put(THIS_MODULE);
exit: exit:
return rc; return rc;
...@@ -1423,4 +1419,3 @@ static void __exit ibmphp_exit(void) ...@@ -1423,4 +1419,3 @@ static void __exit ibmphp_exit(void)
} }
module_init(ibmphp_init); module_init(ibmphp_init);
module_exit(ibmphp_exit);
...@@ -432,18 +432,19 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ ...@@ -432,18 +432,19 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
goto err_out_release_ctlr; goto err_out_release_ctlr;
} }
/* Check if slot is occupied */
t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
t_slot->hpc_ops->get_adapter_status(t_slot, &value);
t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */ if (value) {
if (value && pciehp_force) { if (pciehp_force)
rc = pciehp_enable_slot(t_slot); pciehp_enable_slot(t_slot);
if (rc) /* -ENODEV: shouldn't happen, but deal with it */ } else {
value = 0; /* Power off slot if not occupied */
} if (POWER_CTRL(ctrl)) {
if ((POWER_CTRL(ctrl)) && !value) { rc = t_slot->hpc_ops->power_off_slot(t_slot);
rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ if (rc)
if (rc) goto err_out_free_ctrl_slot;
goto err_out_free_ctrl_slot; }
} }
return 0; return 0;
......
...@@ -252,7 +252,7 @@ static void report_resume(struct pci_dev *dev, void *data) ...@@ -252,7 +252,7 @@ static void report_resume(struct pci_dev *dev, void *data)
if (!dev->driver || if (!dev->driver ||
!dev->driver->err_handler || !dev->driver->err_handler ||
!dev->driver->err_handler->slot_reset) !dev->driver->err_handler->resume)
return; return;
err_handler = dev->driver->err_handler; err_handler = dev->driver->err_handler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment