diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-12-15 14:45:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-12-15 14:45:27 -0500 |
commit | 9199c4caa1315c31d160abbd166df0b9a9e8551e (patch) | |
tree | 3f0dea86d44a4aa20695d99faa6f170b68e0f51d /kernel | |
parent | b5745c59627854afb3cd3f3860ee6f4571e2b633 (diff) | |
parent | f0b75693cbb26439ba959ba7d3b4f43e2fcf3da6 (diff) |
Merge tag 'pci-v3.13-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
"PCI device hotplug
- Move device_del() from pci_stop_dev() to pci_destroy_dev() (Rafael
Wysocki)
Host bridge drivers
- Update maintainers for DesignWare, i.MX6, Armada, R-Car (Bjorn
Helgaas)
- mvebu: Return 'unsupported' for Interrupt Line and Interrupt Pin
(Jason Gunthorpe)
Miscellaneous
- Avoid unnecessary CPU switch when calling .probe() (Alexander
Duyck)
- Revert "workqueue: allow work_on_cpu() to be called recursively"
(Bjorn Helgaas)
- Disable Bus Master only on kexec reboot (Khalid Aziz)
- Omit PCI ID macro strings to shorten quirk names for LTO (Michal
Marek)"
* tag 'pci-v3.13-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
MAINTAINERS: Add DesignWare, i.MX6, Armada, R-Car PCI host maintainers
PCI: Disable Bus Master only on kexec reboot
PCI: mvebu: Return 'unsupported' for Interrupt Line and Interrupt Pin
PCI: Omit PCI ID macro strings to shorten quirk names
PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev()
Revert "workqueue: allow work_on_cpu() to be called recursively"
PCI: Avoid unnecessary CPU switch when calling driver .probe() method
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kexec.c | 4 | ||||
-rw-r--r-- | kernel/workqueue.c | 32 |
2 files changed, 14 insertions, 22 deletions
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 c66912be990f..b010eac595d2 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -2851,19 +2851,6 @@ already_gone: | |||
2851 | return false; | 2851 | return false; |
2852 | } | 2852 | } |
2853 | 2853 | ||
2854 | static bool __flush_work(struct work_struct *work) | ||
2855 | { | ||
2856 | struct wq_barrier barr; | ||
2857 | |||
2858 | if (start_flush_work(work, &barr)) { | ||
2859 | wait_for_completion(&barr.done); | ||
2860 | destroy_work_on_stack(&barr.work); | ||
2861 | return true; | ||
2862 | } else { | ||
2863 | return false; | ||
2864 | } | ||
2865 | } | ||
2866 | |||
2867 | /** | 2854 | /** |
2868 | * flush_work - wait for a work to finish executing the last queueing instance | 2855 | * flush_work - wait for a work to finish executing the last queueing instance |
2869 | * @work: the work to flush | 2856 | * @work: the work to flush |
@@ -2877,10 +2864,18 @@ static bool __flush_work(struct work_struct *work) | |||
2877 | */ | 2864 | */ |
2878 | bool flush_work(struct work_struct *work) | 2865 | bool flush_work(struct work_struct *work) |
2879 | { | 2866 | { |
2867 | struct wq_barrier barr; | ||
2868 | |||
2880 | lock_map_acquire(&work->lockdep_map); | 2869 | lock_map_acquire(&work->lockdep_map); |
2881 | lock_map_release(&work->lockdep_map); | 2870 | lock_map_release(&work->lockdep_map); |
2882 | 2871 | ||
2883 | return __flush_work(work); | 2872 | if (start_flush_work(work, &barr)) { |
2873 | wait_for_completion(&barr.done); | ||
2874 | destroy_work_on_stack(&barr.work); | ||
2875 | return true; | ||
2876 | } else { | ||
2877 | return false; | ||
2878 | } | ||
2884 | } | 2879 | } |
2885 | EXPORT_SYMBOL_GPL(flush_work); | 2880 | EXPORT_SYMBOL_GPL(flush_work); |
2886 | 2881 | ||
@@ -4832,14 +4827,7 @@ long work_on_cpu(int cpu, long (*fn)(void *), void *arg) | |||
4832 | 4827 | ||
4833 | INIT_WORK_ONSTACK(&wfc.work, work_for_cpu_fn); | 4828 | INIT_WORK_ONSTACK(&wfc.work, work_for_cpu_fn); |
4834 | schedule_work_on(cpu, &wfc.work); | 4829 | schedule_work_on(cpu, &wfc.work); |
4835 | 4830 | flush_work(&wfc.work); | |
4836 | /* | ||
4837 | * The work item is on-stack and can't lead to deadlock through | ||
4838 | * flushing. Use __flush_work() to avoid spurious lockdep warnings | ||
4839 | * when work_on_cpu()s are nested. | ||
4840 | */ | ||
4841 | __flush_work(&wfc.work); | ||
4842 | |||
4843 | return wfc.ret; | 4831 | return wfc.ret; |
4844 | } | 4832 | } |
4845 | EXPORT_SYMBOL_GPL(work_on_cpu); | 4833 | EXPORT_SYMBOL_GPL(work_on_cpu); |