diff options
-rw-r--r-- | MAINTAINERS | 33 | ||||
-rw-r--r-- | arch/x86/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/x86_init.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/x86_init.c | 4 | ||||
-rw-r--r-- | arch/x86/pci/xen.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pci-mvebu.c | 5 | ||||
-rw-r--r-- | drivers/pci/iov.c | 1 | ||||
-rw-r--r-- | drivers/pci/msi.c | 19 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 38 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_core.c | 2 | ||||
-rw-r--r-- | drivers/pci/remove.c | 4 | ||||
-rw-r--r-- | drivers/pci/setup-bus.c | 16 | ||||
-rw-r--r-- | include/linux/kexec.h | 3 | ||||
-rw-r--r-- | include/linux/msi.h | 4 | ||||
-rw-r--r-- | include/linux/pci.h | 30 | ||||
-rw-r--r-- | kernel/kexec.c | 4 | ||||
-rw-r--r-- | kernel/workqueue.c | 32 |
17 files changed, 135 insertions, 66 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 8285ed4676b6..624e6516fdd3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -6449,19 +6449,52 @@ F: drivers/pci/ | |||
6449 | F: include/linux/pci* | 6449 | F: include/linux/pci* |
6450 | F: arch/x86/pci/ | 6450 | F: arch/x86/pci/ |
6451 | 6451 | ||
6452 | PCI DRIVER FOR IMX6 | ||
6453 | M: Richard Zhu <r65037@freescale.com> | ||
6454 | M: Shawn Guo <shawn.guo@linaro.org> | ||
6455 | L: linux-pci@vger.kernel.org | ||
6456 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | ||
6457 | S: Maintained | ||
6458 | F: drivers/pci/host/*imx6* | ||
6459 | |||
6460 | PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support) | ||
6461 | M: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
6462 | M: Jason Cooper <jason@lakedaemon.net> | ||
6463 | L: linux-pci@vger.kernel.org | ||
6464 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | ||
6465 | S: Maintained | ||
6466 | F: drivers/pci/host/*mvebu* | ||
6467 | |||
6452 | PCI DRIVER FOR NVIDIA TEGRA | 6468 | PCI DRIVER FOR NVIDIA TEGRA |
6453 | M: Thierry Reding <thierry.reding@gmail.com> | 6469 | M: Thierry Reding <thierry.reding@gmail.com> |
6454 | L: linux-tegra@vger.kernel.org | 6470 | L: linux-tegra@vger.kernel.org |
6471 | L: linux-pci@vger.kernel.org | ||
6455 | S: Supported | 6472 | S: Supported |
6456 | F: Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt | 6473 | F: Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt |
6457 | F: drivers/pci/host/pci-tegra.c | 6474 | F: drivers/pci/host/pci-tegra.c |
6458 | 6475 | ||
6476 | PCI DRIVER FOR RENESAS R-CAR | ||
6477 | M: Simon Horman <horms@verge.net.au> | ||
6478 | L: linux-pci@vger.kernel.org | ||
6479 | L: linux-sh@vger.kernel.org | ||
6480 | S: Maintained | ||
6481 | F: drivers/pci/host/*rcar* | ||
6482 | |||
6459 | PCI DRIVER FOR SAMSUNG EXYNOS | 6483 | PCI DRIVER FOR SAMSUNG EXYNOS |
6460 | M: Jingoo Han <jg1.han@samsung.com> | 6484 | M: Jingoo Han <jg1.han@samsung.com> |
6461 | L: linux-pci@vger.kernel.org | 6485 | L: linux-pci@vger.kernel.org |
6486 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | ||
6487 | L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers) | ||
6462 | S: Maintained | 6488 | S: Maintained |
6463 | F: drivers/pci/host/pci-exynos.c | 6489 | F: drivers/pci/host/pci-exynos.c |
6464 | 6490 | ||
6491 | PCI DRIVER FOR SYNOPSIS DESIGNWARE | ||
6492 | M: Mohit Kumar <mohit.kumar@st.com> | ||
6493 | M: Jingoo Han <jg1.han@samsung.com> | ||
6494 | L: linux-pci@vger.kernel.org | ||
6495 | S: Maintained | ||
6496 | F: drivers/pci/host/*designware* | ||
6497 | |||
6465 | PCMCIA SUBSYSTEM | 6498 | PCMCIA SUBSYSTEM |
6466 | P: Linux PCMCIA Team | 6499 | P: Linux PCMCIA Team |
6467 | L: linux-pcmcia@lists.infradead.org | 6500 | L: linux-pcmcia@lists.infradead.org |
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 947b5c417e83..0de52c5bf9a2 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -104,7 +104,7 @@ extern void pci_iommu_alloc(void); | |||
104 | struct msi_desc; | 104 | struct msi_desc; |
105 | int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | 105 | int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); |
106 | void native_teardown_msi_irq(unsigned int irq); | 106 | void native_teardown_msi_irq(unsigned int irq); |
107 | void native_restore_msi_irqs(struct pci_dev *dev, int irq); | 107 | void native_restore_msi_irqs(struct pci_dev *dev); |
108 | int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, | 108 | int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, |
109 | unsigned int irq_base, unsigned int irq_offset); | 109 | unsigned int irq_base, unsigned int irq_offset); |
110 | #else | 110 | #else |
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index 0f1be11e43d2..e45e4da96bf1 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h | |||
@@ -181,7 +181,7 @@ struct x86_msi_ops { | |||
181 | u8 hpet_id); | 181 | u8 hpet_id); |
182 | void (*teardown_msi_irq)(unsigned int irq); | 182 | void (*teardown_msi_irq)(unsigned int irq); |
183 | void (*teardown_msi_irqs)(struct pci_dev *dev); | 183 | void (*teardown_msi_irqs)(struct pci_dev *dev); |
184 | void (*restore_msi_irqs)(struct pci_dev *dev, int irq); | 184 | void (*restore_msi_irqs)(struct pci_dev *dev); |
185 | int (*setup_hpet_msi)(unsigned int irq, unsigned int id); | 185 | int (*setup_hpet_msi)(unsigned int irq, unsigned int id); |
186 | u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag); | 186 | u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag); |
187 | u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag); | 187 | u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag); |
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index 021783b1f46a..e48b674639cc 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c | |||
@@ -136,9 +136,9 @@ void arch_teardown_msi_irq(unsigned int irq) | |||
136 | x86_msi.teardown_msi_irq(irq); | 136 | x86_msi.teardown_msi_irq(irq); |
137 | } | 137 | } |
138 | 138 | ||
139 | void arch_restore_msi_irqs(struct pci_dev *dev, int irq) | 139 | void arch_restore_msi_irqs(struct pci_dev *dev) |
140 | { | 140 | { |
141 | x86_msi.restore_msi_irqs(dev, irq); | 141 | x86_msi.restore_msi_irqs(dev); |
142 | } | 142 | } |
143 | u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag) | 143 | u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag) |
144 | { | 144 | { |
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 5eee4959785d..103e702ec5a7 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
@@ -337,7 +337,7 @@ out: | |||
337 | return ret; | 337 | return ret; |
338 | } | 338 | } |
339 | 339 | ||
340 | static void xen_initdom_restore_msi_irqs(struct pci_dev *dev, int irq) | 340 | static void xen_initdom_restore_msi_irqs(struct pci_dev *dev) |
341 | { | 341 | { |
342 | int ret = 0; | 342 | int ret = 0; |
343 | 343 | ||
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index c269e430c760..2aa7b77c7c88 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c | |||
@@ -447,6 +447,11 @@ static int mvebu_sw_pci_bridge_read(struct mvebu_pcie_port *port, | |||
447 | *value = 0; | 447 | *value = 0; |
448 | break; | 448 | break; |
449 | 449 | ||
450 | case PCI_INTERRUPT_LINE: | ||
451 | /* LINE PIN MIN_GNT MAX_LAT */ | ||
452 | *value = 0; | ||
453 | break; | ||
454 | |||
450 | default: | 455 | default: |
451 | *value = 0xffffffff; | 456 | *value = 0xffffffff; |
452 | return PCIBIOS_BAD_REGISTER_NUMBER; | 457 | return PCIBIOS_BAD_REGISTER_NUMBER; |
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 1fe2d6fb19d5..68311ec849ee 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c | |||
@@ -441,6 +441,7 @@ static int sriov_init(struct pci_dev *dev, int pos) | |||
441 | 441 | ||
442 | found: | 442 | found: |
443 | pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, ctrl); | 443 | pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, ctrl); |
444 | pci_write_config_word(dev, pos + PCI_SRIOV_NUM_VF, 0); | ||
444 | pci_read_config_word(dev, pos + PCI_SRIOV_VF_OFFSET, &offset); | 445 | pci_read_config_word(dev, pos + PCI_SRIOV_VF_OFFSET, &offset); |
445 | pci_read_config_word(dev, pos + PCI_SRIOV_VF_STRIDE, &stride); | 446 | pci_read_config_word(dev, pos + PCI_SRIOV_VF_STRIDE, &stride); |
446 | if (!offset || (total > 1 && !stride)) | 447 | if (!offset || (total > 1 && !stride)) |
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 3fcd67a16677..51bf0400a889 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -116,7 +116,7 @@ void __weak arch_teardown_msi_irqs(struct pci_dev *dev) | |||
116 | return default_teardown_msi_irqs(dev); | 116 | return default_teardown_msi_irqs(dev); |
117 | } | 117 | } |
118 | 118 | ||
119 | void default_restore_msi_irqs(struct pci_dev *dev, int irq) | 119 | static void default_restore_msi_irq(struct pci_dev *dev, int irq) |
120 | { | 120 | { |
121 | struct msi_desc *entry; | 121 | struct msi_desc *entry; |
122 | 122 | ||
@@ -134,9 +134,9 @@ void default_restore_msi_irqs(struct pci_dev *dev, int irq) | |||
134 | write_msi_msg(irq, &entry->msg); | 134 | write_msi_msg(irq, &entry->msg); |
135 | } | 135 | } |
136 | 136 | ||
137 | void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq) | 137 | void __weak arch_restore_msi_irqs(struct pci_dev *dev) |
138 | { | 138 | { |
139 | return default_restore_msi_irqs(dev, irq); | 139 | return default_restore_msi_irqs(dev); |
140 | } | 140 | } |
141 | 141 | ||
142 | static void msi_set_enable(struct pci_dev *dev, int enable) | 142 | static void msi_set_enable(struct pci_dev *dev, int enable) |
@@ -262,6 +262,15 @@ void unmask_msi_irq(struct irq_data *data) | |||
262 | msi_set_mask_bit(data, 0); | 262 | msi_set_mask_bit(data, 0); |
263 | } | 263 | } |
264 | 264 | ||
265 | void default_restore_msi_irqs(struct pci_dev *dev) | ||
266 | { | ||
267 | struct msi_desc *entry; | ||
268 | |||
269 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
270 | default_restore_msi_irq(dev, entry->irq); | ||
271 | } | ||
272 | } | ||
273 | |||
265 | void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg) | 274 | void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg) |
266 | { | 275 | { |
267 | BUG_ON(entry->dev->current_state != PCI_D0); | 276 | BUG_ON(entry->dev->current_state != PCI_D0); |
@@ -430,7 +439,7 @@ static void __pci_restore_msi_state(struct pci_dev *dev) | |||
430 | 439 | ||
431 | pci_intx_for_msi(dev, 0); | 440 | pci_intx_for_msi(dev, 0); |
432 | msi_set_enable(dev, 0); | 441 | msi_set_enable(dev, 0); |
433 | arch_restore_msi_irqs(dev, dev->irq); | 442 | arch_restore_msi_irqs(dev); |
434 | 443 | ||
435 | pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); | 444 | pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); |
436 | msi_mask_irq(entry, msi_capable_mask(control), entry->masked); | 445 | msi_mask_irq(entry, msi_capable_mask(control), entry->masked); |
@@ -455,8 +464,8 @@ static void __pci_restore_msix_state(struct pci_dev *dev) | |||
455 | control |= PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL; | 464 | control |= PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL; |
456 | pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, control); | 465 | pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, control); |
457 | 466 | ||
467 | arch_restore_msi_irqs(dev); | ||
458 | list_for_each_entry(entry, &dev->msi_list, list) { | 468 | list_for_each_entry(entry, &dev->msi_list, list) { |
459 | arch_restore_msi_irqs(dev, entry->irq); | ||
460 | msix_mask_irq(entry, entry->masked); | 469 | msix_mask_irq(entry, entry->masked); |
461 | } | 470 | } |
462 | 471 | ||
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 9042fdbd7244..25f0bc659164 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/cpu.h> | 19 | #include <linux/cpu.h> |
20 | #include <linux/pm_runtime.h> | 20 | #include <linux/pm_runtime.h> |
21 | #include <linux/suspend.h> | 21 | #include <linux/suspend.h> |
22 | #include <linux/kexec.h> | ||
22 | #include "pci.h" | 23 | #include "pci.h" |
23 | 24 | ||
24 | struct pci_dynid { | 25 | struct pci_dynid { |
@@ -288,12 +289,27 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, | |||
288 | int error, node; | 289 | int error, node; |
289 | struct drv_dev_and_id ddi = { drv, dev, id }; | 290 | struct drv_dev_and_id ddi = { drv, dev, id }; |
290 | 291 | ||
291 | /* Execute driver initialization on node where the device's | 292 | /* |
292 | bus is attached to. This way the driver likely allocates | 293 | * Execute driver initialization on node where the device is |
293 | its local memory on the right node without any need to | 294 | * attached. This way the driver likely allocates its local memory |
294 | change it. */ | 295 | * on the right node. |
296 | */ | ||
295 | node = dev_to_node(&dev->dev); | 297 | node = dev_to_node(&dev->dev); |
296 | if (node >= 0) { | 298 | |
299 | /* | ||
300 | * On NUMA systems, we are likely to call a PF probe function using | ||
301 | * work_on_cpu(). If that probe calls pci_enable_sriov() (which | ||
302 | * adds the VF devices via pci_bus_add_device()), we may re-enter | ||
303 | * this function to call the VF probe function. Calling | ||
304 | * work_on_cpu() again will cause a lockdep warning. Since VFs are | ||
305 | * always on the same node as the PF, we can work around this by | ||
306 | * avoiding work_on_cpu() when we're already on the correct node. | ||
307 | * | ||
308 | * Preemption is enabled, so it's theoretically unsafe to use | ||
309 | * numa_node_id(), but even if we run the probe function on the | ||
310 | * wrong node, it should be functionally correct. | ||
311 | */ | ||
312 | if (node >= 0 && node != numa_node_id()) { | ||
297 | int cpu; | 313 | int cpu; |
298 | 314 | ||
299 | get_online_cpus(); | 315 | get_online_cpus(); |
@@ -305,6 +321,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, | |||
305 | put_online_cpus(); | 321 | put_online_cpus(); |
306 | } else | 322 | } else |
307 | error = local_pci_probe(&ddi); | 323 | error = local_pci_probe(&ddi); |
324 | |||
308 | return error; | 325 | return error; |
309 | } | 326 | } |
310 | 327 | ||
@@ -399,12 +416,17 @@ static void pci_device_shutdown(struct device *dev) | |||
399 | pci_msi_shutdown(pci_dev); | 416 | pci_msi_shutdown(pci_dev); |
400 | pci_msix_shutdown(pci_dev); | 417 | pci_msix_shutdown(pci_dev); |
401 | 418 | ||
419 | #ifdef CONFIG_KEXEC | ||
402 | /* | 420 | /* |
403 | * Turn off Bus Master bit on the device to tell it to not | 421 | * If this is a kexec reboot, turn off Bus Master bit on the |
404 | * continue to do DMA. Don't touch devices in D3cold or unknown states. | 422 | * device to tell it to not continue to do DMA. Don't touch |
423 | * devices in D3cold or unknown states. | ||
424 | * If it is not a kexec reboot, firmware will hit the PCI | ||
425 | * devices with big hammer and stop their DMA any way. | ||
405 | */ | 426 | */ |
406 | if (pci_dev->current_state <= PCI_D3hot) | 427 | if (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot)) |
407 | pci_clear_master(pci_dev); | 428 | pci_clear_master(pci_dev); |
429 | #endif | ||
408 | } | 430 | } |
409 | 431 | ||
410 | #ifdef CONFIG_PM | 432 | #ifdef CONFIG_PM |
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 0b6e76604068..ce9d9ae17bfd 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -554,7 +554,7 @@ int pcie_port_service_register(struct pcie_port_service_driver *new) | |||
554 | if (pcie_ports_disabled) | 554 | if (pcie_ports_disabled) |
555 | return -ENODEV; | 555 | return -ENODEV; |
556 | 556 | ||
557 | new->driver.name = (char *)new->name; | 557 | new->driver.name = new->name; |
558 | new->driver.bus = &pcie_port_bus_type; | 558 | new->driver.bus = &pcie_port_bus_type; |
559 | new->driver.probe = pcie_port_probe_service; | 559 | new->driver.probe = pcie_port_probe_service; |
560 | new->driver.remove = pcie_port_remove_service; | 560 | new->driver.remove = pcie_port_remove_service; |
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 1576851028db..cc9337a71529 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c | |||
@@ -24,7 +24,7 @@ static void pci_stop_dev(struct pci_dev *dev) | |||
24 | if (dev->is_added) { | 24 | if (dev->is_added) { |
25 | pci_proc_detach_device(dev); | 25 | pci_proc_detach_device(dev); |
26 | pci_remove_sysfs_dev_files(dev); | 26 | pci_remove_sysfs_dev_files(dev); |
27 | device_del(&dev->dev); | 27 | device_release_driver(&dev->dev); |
28 | dev->is_added = 0; | 28 | dev->is_added = 0; |
29 | } | 29 | } |
30 | 30 | ||
@@ -34,6 +34,8 @@ static void pci_stop_dev(struct pci_dev *dev) | |||
34 | 34 | ||
35 | static void pci_destroy_dev(struct pci_dev *dev) | 35 | static void pci_destroy_dev(struct pci_dev *dev) |
36 | { | 36 | { |
37 | device_del(&dev->dev); | ||
38 | |||
37 | down_write(&pci_bus_sem); | 39 | down_write(&pci_bus_sem); |
38 | list_del(&dev->bus_list); | 40 | list_del(&dev->bus_list); |
39 | up_write(&pci_bus_sem); | 41 | up_write(&pci_bus_sem); |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 219a4106480a..2e344a5581ae 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -538,7 +538,8 @@ static void pci_setup_bridge_io(struct pci_bus *bus) | |||
538 | struct pci_bus_region region; | 538 | struct pci_bus_region region; |
539 | unsigned long io_mask; | 539 | unsigned long io_mask; |
540 | u8 io_base_lo, io_limit_lo; | 540 | u8 io_base_lo, io_limit_lo; |
541 | u32 l, io_upper16; | 541 | u16 l; |
542 | u32 io_upper16; | ||
542 | 543 | ||
543 | io_mask = PCI_IO_RANGE_MASK; | 544 | io_mask = PCI_IO_RANGE_MASK; |
544 | if (bridge->io_window_1k) | 545 | if (bridge->io_window_1k) |
@@ -548,11 +549,10 @@ static void pci_setup_bridge_io(struct pci_bus *bus) | |||
548 | res = bus->resource[0]; | 549 | res = bus->resource[0]; |
549 | pcibios_resource_to_bus(bridge, ®ion, res); | 550 | pcibios_resource_to_bus(bridge, ®ion, res); |
550 | if (res->flags & IORESOURCE_IO) { | 551 | if (res->flags & IORESOURCE_IO) { |
551 | pci_read_config_dword(bridge, PCI_IO_BASE, &l); | 552 | pci_read_config_word(bridge, PCI_IO_BASE, &l); |
552 | l &= 0xffff0000; | ||
553 | io_base_lo = (region.start >> 8) & io_mask; | 553 | io_base_lo = (region.start >> 8) & io_mask; |
554 | io_limit_lo = (region.end >> 8) & io_mask; | 554 | io_limit_lo = (region.end >> 8) & io_mask; |
555 | l |= ((u32) io_limit_lo << 8) | io_base_lo; | 555 | l = ((u16) io_limit_lo << 8) | io_base_lo; |
556 | /* Set up upper 16 bits of I/O base/limit. */ | 556 | /* Set up upper 16 bits of I/O base/limit. */ |
557 | io_upper16 = (region.end & 0xffff0000) | (region.start >> 16); | 557 | io_upper16 = (region.end & 0xffff0000) | (region.start >> 16); |
558 | dev_info(&bridge->dev, " bridge window %pR\n", res); | 558 | dev_info(&bridge->dev, " bridge window %pR\n", res); |
@@ -564,7 +564,7 @@ static void pci_setup_bridge_io(struct pci_bus *bus) | |||
564 | /* Temporarily disable the I/O range before updating PCI_IO_BASE. */ | 564 | /* Temporarily disable the I/O range before updating PCI_IO_BASE. */ |
565 | pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, 0x0000ffff); | 565 | pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, 0x0000ffff); |
566 | /* Update lower 16 bits of I/O base/limit. */ | 566 | /* Update lower 16 bits of I/O base/limit. */ |
567 | pci_write_config_dword(bridge, PCI_IO_BASE, l); | 567 | pci_write_config_word(bridge, PCI_IO_BASE, l); |
568 | /* Update upper 16 bits of I/O base/limit. */ | 568 | /* Update upper 16 bits of I/O base/limit. */ |
569 | pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, io_upper16); | 569 | pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, io_upper16); |
570 | } | 570 | } |
@@ -665,21 +665,23 @@ static void pci_bridge_check_ranges(struct pci_bus *bus) | |||
665 | 665 | ||
666 | pci_read_config_word(bridge, PCI_IO_BASE, &io); | 666 | pci_read_config_word(bridge, PCI_IO_BASE, &io); |
667 | if (!io) { | 667 | if (!io) { |
668 | pci_write_config_word(bridge, PCI_IO_BASE, 0xf0f0); | 668 | pci_write_config_word(bridge, PCI_IO_BASE, 0xe0f0); |
669 | pci_read_config_word(bridge, PCI_IO_BASE, &io); | 669 | pci_read_config_word(bridge, PCI_IO_BASE, &io); |
670 | pci_write_config_word(bridge, PCI_IO_BASE, 0x0); | 670 | pci_write_config_word(bridge, PCI_IO_BASE, 0x0); |
671 | } | 671 | } |
672 | if (io) | 672 | if (io) |
673 | b_res[0].flags |= IORESOURCE_IO; | 673 | b_res[0].flags |= IORESOURCE_IO; |
674 | |||
674 | /* DECchip 21050 pass 2 errata: the bridge may miss an address | 675 | /* DECchip 21050 pass 2 errata: the bridge may miss an address |
675 | disconnect boundary by one PCI data phase. | 676 | disconnect boundary by one PCI data phase. |
676 | Workaround: do not use prefetching on this device. */ | 677 | Workaround: do not use prefetching on this device. */ |
677 | if (bridge->vendor == PCI_VENDOR_ID_DEC && bridge->device == 0x0001) | 678 | if (bridge->vendor == PCI_VENDOR_ID_DEC && bridge->device == 0x0001) |
678 | return; | 679 | return; |
680 | |||
679 | pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem); | 681 | pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem); |
680 | if (!pmem) { | 682 | if (!pmem) { |
681 | pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, | 683 | pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, |
682 | 0xfff0fff0); | 684 | 0xffe0fff0); |
683 | pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem); | 685 | pci_read_config_dword(bridge, PCI_PREF_MEMORY_BASE, &pmem); |
684 | pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, 0x0); | 686 | pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, 0x0); |
685 | } | 687 | } |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d78d28a733b1..5fd33dc1fe3a 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -198,6 +198,9 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
198 | extern size_t vmcoreinfo_size; | 198 | extern size_t vmcoreinfo_size; |
199 | extern size_t vmcoreinfo_max_size; | 199 | extern size_t vmcoreinfo_max_size; |
200 | 200 | ||
201 | /* flag to track if kexec reboot is in progress */ | ||
202 | extern bool kexec_in_progress; | ||
203 | |||
201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 204 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
202 | unsigned long long *crash_size, unsigned long long *crash_base); | 205 | unsigned long long *crash_size, unsigned long long *crash_base); |
203 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, | 206 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 009b02481436..92a2f991262a 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -60,10 +60,10 @@ void arch_teardown_msi_irq(unsigned int irq); | |||
60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | 60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); |
61 | void arch_teardown_msi_irqs(struct pci_dev *dev); | 61 | void arch_teardown_msi_irqs(struct pci_dev *dev); |
62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); | 62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); |
63 | void arch_restore_msi_irqs(struct pci_dev *dev, int irq); | 63 | void arch_restore_msi_irqs(struct pci_dev *dev); |
64 | 64 | ||
65 | void default_teardown_msi_irqs(struct pci_dev *dev); | 65 | void default_teardown_msi_irqs(struct pci_dev *dev); |
66 | void default_restore_msi_irqs(struct pci_dev *dev, int irq); | 66 | void default_restore_msi_irqs(struct pci_dev *dev); |
67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); | 67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); |
68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); | 68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); |
69 | 69 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 1084a15175e0..eb8078aeadc8 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1567,65 +1567,65 @@ enum pci_fixup_pass { | |||
1567 | /* Anonymous variables would be nice... */ | 1567 | /* Anonymous variables would be nice... */ |
1568 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1568 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
1569 | class_shift, hook) \ | 1569 | class_shift, hook) \ |
1570 | static const struct pci_fixup __pci_fixup_##name __used \ | 1570 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ |
1571 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1571 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
1572 | = { vendor, device, class, class_shift, hook }; | 1572 | = { vendor, device, class, class_shift, hook }; |
1573 | 1573 | ||
1574 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ | 1574 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ |
1575 | class_shift, hook) \ | 1575 | class_shift, hook) \ |
1576 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1576 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
1577 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1577 | hook, vendor, device, class, class_shift, hook) |
1578 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ | 1578 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ |
1579 | class_shift, hook) \ | 1579 | class_shift, hook) \ |
1580 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1580 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
1581 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1581 | hook, vendor, device, class, class_shift, hook) |
1582 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ | 1582 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ |
1583 | class_shift, hook) \ | 1583 | class_shift, hook) \ |
1584 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1584 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
1585 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1585 | hook, vendor, device, class, class_shift, hook) |
1586 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ | 1586 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ |
1587 | class_shift, hook) \ | 1587 | class_shift, hook) \ |
1588 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1588 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
1589 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1589 | hook, vendor, device, class, class_shift, hook) |
1590 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ | 1590 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ |
1591 | class_shift, hook) \ | 1591 | class_shift, hook) \ |
1592 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1592 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
1593 | resume##vendor##device##hook, vendor, device, class, \ | 1593 | resume##hook, vendor, device, class, \ |
1594 | class_shift, hook) | 1594 | class_shift, hook) |
1595 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ | 1595 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ |
1596 | class_shift, hook) \ | 1596 | class_shift, hook) \ |
1597 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1597 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
1598 | resume_early##vendor##device##hook, vendor, device, \ | 1598 | resume_early##hook, vendor, device, \ |
1599 | class, class_shift, hook) | 1599 | class, class_shift, hook) |
1600 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ | 1600 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ |
1601 | class_shift, hook) \ | 1601 | class_shift, hook) \ |
1602 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1602 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
1603 | suspend##vendor##device##hook, vendor, device, class, \ | 1603 | suspend##hook, vendor, device, class, \ |
1604 | class_shift, hook) | 1604 | class_shift, hook) |
1605 | 1605 | ||
1606 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1606 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
1607 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1607 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
1608 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1608 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1609 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ | 1609 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ |
1610 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1610 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
1611 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1611 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1612 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ | 1612 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ |
1613 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1613 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
1614 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1614 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1615 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ | 1615 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ |
1616 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1616 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
1617 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1617 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
1618 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ | 1618 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ |
1619 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1619 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
1620 | resume##vendor##device##hook, vendor, device, \ | 1620 | resume##hook, vendor, device, \ |
1621 | PCI_ANY_ID, 0, hook) | 1621 | PCI_ANY_ID, 0, hook) |
1622 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ | 1622 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ |
1623 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1623 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
1624 | resume_early##vendor##device##hook, vendor, device, \ | 1624 | resume_early##hook, vendor, device, \ |
1625 | PCI_ANY_ID, 0, hook) | 1625 | PCI_ANY_ID, 0, hook) |
1626 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ | 1626 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ |
1627 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1627 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
1628 | suspend##vendor##device##hook, vendor, device, \ | 1628 | suspend##hook, vendor, device, \ |
1629 | PCI_ANY_ID, 0, hook) | 1629 | PCI_ANY_ID, 0, hook) |
1630 | 1630 | ||
1631 | #ifdef CONFIG_PCI_QUIRKS | 1631 | #ifdef CONFIG_PCI_QUIRKS |
diff --git a/kernel/kexec.c b/kernel/kexec.c index 490afc03627e..d0d8fca54065 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -47,6 +47,9 @@ u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
47 | size_t vmcoreinfo_size; | 47 | size_t vmcoreinfo_size; |
48 | size_t vmcoreinfo_max_size = sizeof(vmcoreinfo_data); | 48 | size_t vmcoreinfo_max_size = sizeof(vmcoreinfo_data); |
49 | 49 | ||
50 | /* Flag to indicate we are going to kexec a new kernel */ | ||
51 | bool kexec_in_progress = false; | ||
52 | |||
50 | /* Location of the reserved area for the crash kernel */ | 53 | /* Location of the reserved area for the crash kernel */ |
51 | struct resource crashk_res = { | 54 | struct resource crashk_res = { |
52 | .name = "Crash kernel", | 55 | .name = "Crash kernel", |
@@ -1675,6 +1678,7 @@ int kernel_kexec(void) | |||
1675 | } else | 1678 | } else |
1676 | #endif | 1679 | #endif |
1677 | { | 1680 | { |
1681 | kexec_in_progress = true; | ||
1678 | kernel_restart_prepare(NULL); | 1682 | kernel_restart_prepare(NULL); |
1679 | printk(KERN_EMERG "Starting new kernel\n"); | 1683 | printk(KERN_EMERG "Starting new kernel\n"); |
1680 | machine_shutdown(); | 1684 | machine_shutdown(); |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 987293d03ebc..5690b8eabfbc 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -2840,19 +2840,6 @@ already_gone: | |||
2840 | return false; | 2840 | return false; |
2841 | } | 2841 | } |
2842 | 2842 | ||
2843 | static bool __flush_work(struct work_struct *work) | ||
2844 | { | ||
2845 | struct wq_barrier barr; | ||
2846 | |||
2847 | if (start_flush_work(work, &barr)) { | ||
2848 | wait_for_completion(&barr.done); | ||
2849 | destroy_work_on_stack(&barr.work); | ||
2850 | return true; | ||
2851 | } else { | ||
2852 | return false; | ||
2853 | } | ||
2854 | } | ||
2855 | |||
2856 | /** | 2843 | /** |
2857 | * flush_work - wait for a work to finish executing the last queueing instance | 2844 | * flush_work - wait for a work to finish executing the last queueing instance |
2858 | * @work: the work to flush | 2845 | * @work: the work to flush |
@@ -2866,10 +2853,18 @@ static bool __flush_work(struct work_struct *work) | |||
2866 | */ | 2853 | */ |
2867 | bool flush_work(struct work_struct *work) | 2854 | bool flush_work(struct work_struct *work) |
2868 | { | 2855 | { |
2856 | struct wq_barrier barr; | ||
2857 | |||
2869 | lock_map_acquire(&work->lockdep_map); | 2858 | lock_map_acquire(&work->lockdep_map); |
2870 | lock_map_release(&work->lockdep_map); | 2859 | lock_map_release(&work->lockdep_map); |
2871 | 2860 | ||
2872 | return __flush_work(work); | 2861 | if (start_flush_work(work, &barr)) { |
2862 | wait_for_completion(&barr.done); | ||
2863 | destroy_work_on_stack(&barr.work); | ||
2864 | return true; | ||
2865 | } else { | ||
2866 | return false; | ||
2867 | } | ||
2873 | } | 2868 | } |
2874 | EXPORT_SYMBOL_GPL(flush_work); | 2869 | EXPORT_SYMBOL_GPL(flush_work); |
2875 | 2870 | ||
@@ -4814,14 +4809,7 @@ long work_on_cpu(int cpu, long (*fn)(void *), void *arg) | |||
4814 | 4809 | ||
4815 | INIT_WORK_ONSTACK(&wfc.work, work_for_cpu_fn); | 4810 | INIT_WORK_ONSTACK(&wfc.work, work_for_cpu_fn); |
4816 | schedule_work_on(cpu, &wfc.work); | 4811 | schedule_work_on(cpu, &wfc.work); |
4817 | 4812 | flush_work(&wfc.work); | |
4818 | /* | ||
4819 | * The work item is on-stack and can't lead to deadlock through | ||
4820 | * flushing. Use __flush_work() to avoid spurious lockdep warnings | ||
4821 | * when work_on_cpu()s are nested. | ||
4822 | */ | ||
4823 | __flush_work(&wfc.work); | ||
4824 | |||
4825 | return wfc.ret; | 4813 | return wfc.ret; |
4826 | } | 4814 | } |
4827 | EXPORT_SYMBOL_GPL(work_on_cpu); | 4815 | EXPORT_SYMBOL_GPL(work_on_cpu); |