diff options
author | Jan Beulich <JBeulich@suse.com> | 2014-11-03 03:15:42 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-12-16 08:08:14 -0500 |
commit | e10679825924580845c4825deaaddf5331ff627c (patch) | |
tree | c052eea779aa058de20fc1b19679188d199954ab | |
parent | 9f50c6ea0d02a58abd498250abd11bde687bbe22 (diff) |
x86: irq: Fix placement of mp_should_keep_irq()
While f3761db164 ("x86, irq: Fix build error caused by
9eabc99a635a77cbf09") addressed the original build problem,
declaration, inline stub, and definition still seem misplaced: It isn't
really IO-APIC related, and it's being used solely in arch/x86/pci/.
This also means stubbing it out when !CONFIG_X86_IO_APIC was at least
questionable.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Link: http://lkml.kernel.org/r/545747BE020000780004436E@mail.emea.novell.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/include/asm/io_apic.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/pci_x86.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 12 | ||||
-rw-r--r-- | arch/x86/pci/irq.c | 12 |
4 files changed, 14 insertions, 15 deletions
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 1733ab49ac5e..0aeed5ca356e 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -227,8 +227,6 @@ static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned | |||
227 | 227 | ||
228 | extern void io_apic_eoi(unsigned int apic, unsigned int vector); | 228 | extern void io_apic_eoi(unsigned int apic, unsigned int vector); |
229 | 229 | ||
230 | extern bool mp_should_keep_irq(struct device *dev); | ||
231 | |||
232 | #else /* !CONFIG_X86_IO_APIC */ | 230 | #else /* !CONFIG_X86_IO_APIC */ |
233 | 231 | ||
234 | #define io_apic_assign_pci_irqs 0 | 232 | #define io_apic_assign_pci_irqs 0 |
@@ -239,7 +237,6 @@ static inline int mp_find_ioapic(u32 gsi) { return 0; } | |||
239 | static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } | 237 | static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } |
240 | static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } | 238 | static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } |
241 | static inline void mp_unmap_irq(int irq) { } | 239 | static inline void mp_unmap_irq(int irq) { } |
242 | static inline bool mp_should_keep_irq(struct device *dev) { return 1; } | ||
243 | 240 | ||
244 | static inline int save_ioapic_entries(void) | 241 | static inline int save_ioapic_entries(void) |
245 | { | 242 | { |
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h index fa1195dae425..164e3f8d3c3d 100644 --- a/arch/x86/include/asm/pci_x86.h +++ b/arch/x86/include/asm/pci_x86.h | |||
@@ -93,6 +93,8 @@ extern raw_spinlock_t pci_config_lock; | |||
93 | extern int (*pcibios_enable_irq)(struct pci_dev *dev); | 93 | extern int (*pcibios_enable_irq)(struct pci_dev *dev); |
94 | extern void (*pcibios_disable_irq)(struct pci_dev *dev); | 94 | extern void (*pcibios_disable_irq)(struct pci_dev *dev); |
95 | 95 | ||
96 | extern bool mp_should_keep_irq(struct device *dev); | ||
97 | |||
96 | struct pci_raw_ops { | 98 | struct pci_raw_ops { |
97 | int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn, | 99 | int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn, |
98 | int reg, int len, u32 *val); | 100 | int reg, int len, u32 *val); |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 7ffe0a2b870f..a157b666ac36 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -3964,18 +3964,6 @@ int mp_set_gsi_attr(u32 gsi, int trigger, int polarity, int node) | |||
3964 | return ret; | 3964 | return ret; |
3965 | } | 3965 | } |
3966 | 3966 | ||
3967 | bool mp_should_keep_irq(struct device *dev) | ||
3968 | { | ||
3969 | if (dev->power.is_prepared) | ||
3970 | return true; | ||
3971 | #ifdef CONFIG_PM_RUNTIME | ||
3972 | if (dev->power.runtime_status == RPM_SUSPENDING) | ||
3973 | return true; | ||
3974 | #endif | ||
3975 | |||
3976 | return false; | ||
3977 | } | ||
3978 | |||
3979 | /* Enable IOAPIC early just for system timer */ | 3967 | /* Enable IOAPIC early just for system timer */ |
3980 | void __init pre_init_apic_IRQ0(void) | 3968 | void __init pre_init_apic_IRQ0(void) |
3981 | { | 3969 | { |
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index eb500c2592ad..cb50e281d838 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -1254,6 +1254,18 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1254 | return 0; | 1254 | return 0; |
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | bool mp_should_keep_irq(struct device *dev) | ||
1258 | { | ||
1259 | if (dev->power.is_prepared) | ||
1260 | return true; | ||
1261 | #ifdef CONFIG_PM_RUNTIME | ||
1262 | if (dev->power.runtime_status == RPM_SUSPENDING) | ||
1263 | return true; | ||
1264 | #endif | ||
1265 | |||
1266 | return false; | ||
1267 | } | ||
1268 | |||
1257 | static void pirq_disable_irq(struct pci_dev *dev) | 1269 | static void pirq_disable_irq(struct pci_dev *dev) |
1258 | { | 1270 | { |
1259 | if (io_apic_assign_pci_irqs && !mp_should_keep_irq(&dev->dev) && | 1271 | if (io_apic_assign_pci_irqs && !mp_should_keep_irq(&dev->dev) && |