diff options
| -rw-r--r-- | drivers/md/bitmap.c | 22 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp.h | 2 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_core.c | 2 | ||||
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 4 | ||||
| -rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 5 | ||||
| -rw-r--r-- | drivers/pci/hotplug/pciehp_core.c | 23 | ||||
| -rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 2 |
7 files changed, 34 insertions, 26 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index ac89a5deaca..ab7c8e4a61f 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
| @@ -208,16 +208,19 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page) | |||
| 208 | */ | 208 | */ |
| 209 | 209 | ||
| 210 | /* IO operations when bitmap is stored near all superblocks */ | 210 | /* IO operations when bitmap is stored near all superblocks */ |
| 211 | static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long index) | 211 | static struct page *read_sb_page(mddev_t *mddev, long offset, |
| 212 | struct page *page, | ||
| 213 | unsigned long index, int size) | ||
| 212 | { | 214 | { |
| 213 | /* choose a good rdev and read the page from there */ | 215 | /* choose a good rdev and read the page from there */ |
| 214 | 216 | ||
| 215 | mdk_rdev_t *rdev; | 217 | mdk_rdev_t *rdev; |
| 216 | struct list_head *tmp; | 218 | struct list_head *tmp; |
| 217 | struct page *page = alloc_page(GFP_KERNEL); | ||
| 218 | sector_t target; | 219 | sector_t target; |
| 219 | 220 | ||
| 220 | if (!page) | 221 | if (!page) |
| 222 | page = alloc_page(GFP_KERNEL); | ||
| 223 | if (!page) | ||
| 221 | return ERR_PTR(-ENOMEM); | 224 | return ERR_PTR(-ENOMEM); |
| 222 | 225 | ||
| 223 | rdev_for_each(rdev, tmp, mddev) { | 226 | rdev_for_each(rdev, tmp, mddev) { |
| @@ -227,7 +230,9 @@ static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long inde | |||
| 227 | 230 | ||
| 228 | target = rdev->sb_start + offset + index * (PAGE_SIZE/512); | 231 | target = rdev->sb_start + offset + index * (PAGE_SIZE/512); |
| 229 | 232 | ||
| 230 | if (sync_page_io(rdev->bdev, target, PAGE_SIZE, page, READ)) { | 233 | if (sync_page_io(rdev->bdev, target, |
| 234 | roundup(size, bdev_hardsect_size(rdev->bdev)), | ||
| 235 | page, READ)) { | ||
| 231 | page->index = index; | 236 | page->index = index; |
| 232 | attach_page_buffers(page, NULL); /* so that free_buffer will | 237 | attach_page_buffers(page, NULL); /* so that free_buffer will |
| 233 | * quietly no-op */ | 238 | * quietly no-op */ |
| @@ -544,7 +549,9 @@ static int bitmap_read_sb(struct bitmap *bitmap) | |||
| 544 | 549 | ||
| 545 | bitmap->sb_page = read_page(bitmap->file, 0, bitmap, bytes); | 550 | bitmap->sb_page = read_page(bitmap->file, 0, bitmap, bytes); |
| 546 | } else { | 551 | } else { |
| 547 | bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, 0); | 552 | bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, |
| 553 | NULL, | ||
| 554 | 0, sizeof(bitmap_super_t)); | ||
| 548 | } | 555 | } |
| 549 | if (IS_ERR(bitmap->sb_page)) { | 556 | if (IS_ERR(bitmap->sb_page)) { |
| 550 | err = PTR_ERR(bitmap->sb_page); | 557 | err = PTR_ERR(bitmap->sb_page); |
| @@ -957,11 +964,16 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) | |||
| 957 | */ | 964 | */ |
| 958 | page = bitmap->sb_page; | 965 | page = bitmap->sb_page; |
| 959 | offset = sizeof(bitmap_super_t); | 966 | offset = sizeof(bitmap_super_t); |
| 967 | read_sb_page(bitmap->mddev, bitmap->offset, | ||
| 968 | page, | ||
| 969 | index, count); | ||
| 960 | } else if (file) { | 970 | } else if (file) { |
| 961 | page = read_page(file, index, bitmap, count); | 971 | page = read_page(file, index, bitmap, count); |
| 962 | offset = 0; | 972 | offset = 0; |
| 963 | } else { | 973 | } else { |
| 964 | page = read_sb_page(bitmap->mddev, bitmap->offset, index); | 974 | page = read_sb_page(bitmap->mddev, bitmap->offset, |
| 975 | NULL, | ||
| 976 | index, count); | ||
| 965 | offset = 0; | 977 | offset = 0; |
| 966 | } | 978 | } |
| 967 | if (IS_ERR(page)) { /* read error */ | 979 | if (IS_ERR(page)) { /* read error */ |
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h index f9e244da30a..9bcb6cbd5aa 100644 --- a/drivers/pci/hotplug/acpiphp.h +++ b/drivers/pci/hotplug/acpiphp.h | |||
| @@ -113,7 +113,7 @@ struct acpiphp_slot { | |||
| 113 | 113 | ||
| 114 | u8 device; /* pci device# */ | 114 | u8 device; /* pci device# */ |
| 115 | 115 | ||
| 116 | u32 sun; /* ACPI _SUN (slot unique number) */ | 116 | unsigned long long sun; /* ACPI _SUN (slot unique number) */ |
| 117 | u32 flags; /* see below */ | 117 | u32 flags; /* see below */ |
| 118 | }; | 118 | }; |
| 119 | 119 | ||
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 95b536a23d2..43c10bd261b 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c | |||
| @@ -337,7 +337,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot) | |||
| 337 | slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN; | 337 | slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN; |
| 338 | 338 | ||
| 339 | acpiphp_slot->slot = slot; | 339 | acpiphp_slot->slot = slot; |
| 340 | snprintf(name, SLOT_NAME_SIZE, "%u", slot->acpi_slot->sun); | 340 | snprintf(name, SLOT_NAME_SIZE, "%llu", slot->acpi_slot->sun); |
| 341 | 341 | ||
| 342 | retval = pci_hp_register(slot->hotplug_slot, | 342 | retval = pci_hp_register(slot->hotplug_slot, |
| 343 | acpiphp_slot->bridge->pci_bus, | 343 | acpiphp_slot->bridge->pci_bus, |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 955aae4071f..3affc6472e6 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
| @@ -255,13 +255,13 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
| 255 | 255 | ||
| 256 | bridge->nr_slots++; | 256 | bridge->nr_slots++; |
| 257 | 257 | ||
| 258 | dbg("found ACPI PCI Hotplug slot %d at PCI %04x:%02x:%02x\n", | 258 | dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n", |
| 259 | slot->sun, pci_domain_nr(bridge->pci_bus), | 259 | slot->sun, pci_domain_nr(bridge->pci_bus), |
| 260 | bridge->pci_bus->number, slot->device); | 260 | bridge->pci_bus->number, slot->device); |
| 261 | retval = acpiphp_register_hotplug_slot(slot); | 261 | retval = acpiphp_register_hotplug_slot(slot); |
| 262 | if (retval) { | 262 | if (retval) { |
| 263 | if (retval == -EBUSY) | 263 | if (retval == -EBUSY) |
| 264 | warn("Slot %d already registered by another " | 264 | warn("Slot %llu already registered by another " |
| 265 | "hotplug driver\n", slot->sun); | 265 | "hotplug driver\n", slot->sun); |
| 266 | else | 266 | else |
| 267 | warn("acpiphp_register_hotplug_slot failed " | 267 | warn("acpiphp_register_hotplug_slot failed " |
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index c892daae74d..633e743442a 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c | |||
| @@ -1402,10 +1402,6 @@ static int __init ibmphp_init(void) | |||
| 1402 | goto error; | 1402 | goto error; |
| 1403 | } | 1403 | } |
| 1404 | 1404 | ||
| 1405 | /* lock ourselves into memory with a module | ||
| 1406 | * count of -1 so that no one can unload us. */ | ||
| 1407 | module_put(THIS_MODULE); | ||
| 1408 | |||
| 1409 | exit: | 1405 | exit: |
| 1410 | return rc; | 1406 | return rc; |
| 1411 | 1407 | ||
| @@ -1423,4 +1419,3 @@ static void __exit ibmphp_exit(void) | |||
| 1423 | } | 1419 | } |
| 1424 | 1420 | ||
| 1425 | module_init(ibmphp_init); | 1421 | module_init(ibmphp_init); |
| 1426 | module_exit(ibmphp_exit); | ||
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index 4b23bc39b11..39cf248d24e 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
| @@ -432,18 +432,19 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ | |||
| 432 | goto err_out_release_ctlr; | 432 | goto err_out_release_ctlr; |
| 433 | } | 433 | } |
| 434 | 434 | ||
| 435 | /* Check if slot is occupied */ | ||
| 435 | t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); | 436 | t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); |
| 436 | 437 | t_slot->hpc_ops->get_adapter_status(t_slot, &value); | |
| 437 | t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */ | 438 | if (value) { |
| 438 | if (value && pciehp_force) { | 439 | if (pciehp_force) |
| 439 | rc = pciehp_enable_slot(t_slot); | 440 | pciehp_enable_slot(t_slot); |
| 440 | if (rc) /* -ENODEV: shouldn't happen, but deal with it */ | 441 | } else { |
| 441 | value = 0; | 442 | /* Power off slot if not occupied */ |
| 442 | } | 443 | if (POWER_CTRL(ctrl)) { |
| 443 | if ((POWER_CTRL(ctrl)) && !value) { | 444 | rc = t_slot->hpc_ops->power_off_slot(t_slot); |
| 444 | rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ | 445 | if (rc) |
| 445 | if (rc) | 446 | goto err_out_free_ctrl_slot; |
| 446 | goto err_out_free_ctrl_slot; | 447 | } |
| 447 | } | 448 | } |
| 448 | 449 | ||
| 449 | return 0; | 450 | return 0; |
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index dfc63d01f20..aac7006949f 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
| @@ -252,7 +252,7 @@ static void report_resume(struct pci_dev *dev, void *data) | |||
| 252 | 252 | ||
| 253 | if (!dev->driver || | 253 | if (!dev->driver || |
| 254 | !dev->driver->err_handler || | 254 | !dev->driver->err_handler || |
| 255 | !dev->driver->err_handler->slot_reset) | 255 | !dev->driver->err_handler->resume) |
| 256 | return; | 256 | return; |
| 257 | 257 | ||
| 258 | err_handler = dev->driver->err_handler; | 258 | err_handler = dev->driver->err_handler; |
