Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Dec 19, 2008
2 parents 929096f + 3e3d0e9 commit eae34c6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion drivers/pci/hotplug/acpiphp.h
Expand Up @@ -113,7 +113,7 @@ struct acpiphp_slot {

u8 device; /* pci device# */

u32 sun; /* ACPI _SUN (slot unique number) */
unsigned long long sun; /* ACPI _SUN (slot unique number) */
u32 flags; /* see below */
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/hotplug/acpiphp_core.c
Expand Up @@ -337,7 +337,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;

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,
acpiphp_slot->bridge->pci_bus,
Expand Down
4 changes: 2 additions & 2 deletions drivers/pci/hotplug/acpiphp_glue.c
Expand Up @@ -255,13 +255,13 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)

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),
bridge->pci_bus->number, slot->device);
retval = acpiphp_register_hotplug_slot(slot);
if (retval) {
if (retval == -EBUSY)
warn("Slot %d already registered by another "
warn("Slot %llu already registered by another "
"hotplug driver\n", slot->sun);
else
warn("acpiphp_register_hotplug_slot failed "
Expand Down
5 changes: 0 additions & 5 deletions drivers/pci/hotplug/ibmphp_core.c
Expand Up @@ -1402,10 +1402,6 @@ static int __init ibmphp_init(void)
goto error;
}

/* lock ourselves into memory with a module
* count of -1 so that no one can unload us. */
module_put(THIS_MODULE);

exit:
return rc;

Expand All @@ -1423,4 +1419,3 @@ static void __exit ibmphp_exit(void)
}

module_init(ibmphp_init);
module_exit(ibmphp_exit);
23 changes: 12 additions & 11 deletions drivers/pci/hotplug/pciehp_core.c
Expand Up @@ -432,18 +432,19 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
goto err_out_release_ctlr;
}

/* Check if slot is occupied */
t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);

t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
if (value && pciehp_force) {
rc = pciehp_enable_slot(t_slot);
if (rc) /* -ENODEV: shouldn't happen, but deal with it */
value = 0;
}
if ((POWER_CTRL(ctrl)) && !value) {
rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/
if (rc)
goto err_out_free_ctrl_slot;
t_slot->hpc_ops->get_adapter_status(t_slot, &value);
if (value) {
if (pciehp_force)
pciehp_enable_slot(t_slot);
} else {
/* Power off slot if not occupied */
if (POWER_CTRL(ctrl)) {
rc = t_slot->hpc_ops->power_off_slot(t_slot);
if (rc)
goto err_out_free_ctrl_slot;
}
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/pcie/aer/aerdrv_core.c
Expand Up @@ -252,7 +252,7 @@ static void report_resume(struct pci_dev *dev, void *data)

if (!dev->driver ||
!dev->driver->err_handler ||
!dev->driver->err_handler->slot_reset)
!dev->driver->err_handler->resume)
return;

err_handler = dev->driver->err_handler;
Expand Down

0 comments on commit eae34c6

Please sign in to comment.