diff options
author | Kevin D. Kissell <kevink@mips.com> | 2007-08-03 13:38:03 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-11 18:45:57 -0400 |
commit | f571eff0a24ed97a919f2b61bb4afdeab4b43002 (patch) | |
tree | e9d6c597fafca02720f000cf795a37f2d163f10f /arch/mips/mips-boards | |
parent | bbf25010f1a6b761914430f5fca081ec8c7accd1 (diff) |
[MIPS] IRQ Affinity Support for SMTC on Malta Platform
Signed-off-by: Kevin D. Kissell <kevink@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards')
-rw-r--r-- | arch/mips/mips-boards/malta/malta_smtc.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/mips/mips-boards/malta/malta_smtc.c b/arch/mips/mips-boards/malta/malta_smtc.c index ae05d058cb37..5c980f4a48fe 100644 --- a/arch/mips/mips-boards/malta/malta_smtc.c +++ b/arch/mips/mips-boards/malta/malta_smtc.c | |||
@@ -88,3 +88,53 @@ void __cpuinit prom_smp_finish(void) | |||
88 | void prom_cpus_done(void) | 88 | void prom_cpus_done(void) |
89 | { | 89 | { |
90 | } | 90 | } |
91 | |||
92 | #ifdef CONFIG_MIPS_MT_SMTC_IRQAFF | ||
93 | /* | ||
94 | * IRQ affinity hook | ||
95 | */ | ||
96 | |||
97 | |||
98 | void plat_set_irq_affinity(unsigned int irq, cpumask_t affinity) | ||
99 | { | ||
100 | cpumask_t tmask = affinity; | ||
101 | int cpu = 0; | ||
102 | void smtc_set_irq_affinity(unsigned int irq, cpumask_t aff); | ||
103 | |||
104 | /* | ||
105 | * On the legacy Malta development board, all I/O interrupts | ||
106 | * are routed through the 8259 and combined in a single signal | ||
107 | * to the CPU daughterboard, and on the CoreFPGA2/3 34K models, | ||
108 | * that signal is brought to IP2 of both VPEs. To avoid racing | ||
109 | * concurrent interrupt service events, IP2 is enabled only on | ||
110 | * one VPE, by convention VPE0. So long as no bits are ever | ||
111 | * cleared in the affinity mask, there will never be any | ||
112 | * interrupt forwarding. But as soon as a program or operator | ||
113 | * sets affinity for one of the related IRQs, we need to make | ||
114 | * sure that we don't ever try to forward across the VPE boundry, | ||
115 | * at least not until we engineer a system where the interrupt | ||
116 | * _ack() or _end() function can somehow know that it corresponds | ||
117 | * to an interrupt taken on another VPE, and perform the appropriate | ||
118 | * restoration of Status.IM state using MFTR/MTTR instead of the | ||
119 | * normal local behavior. We also ensure that no attempt will | ||
120 | * be made to forward to an offline "CPU". | ||
121 | */ | ||
122 | |||
123 | for_each_cpu_mask(cpu, affinity) { | ||
124 | if ((cpu_data[cpu].vpe_id != 0) || !cpu_online(cpu)) | ||
125 | cpu_clear(cpu, tmask); | ||
126 | } | ||
127 | irq_desc[irq].affinity = tmask; | ||
128 | |||
129 | if (cpus_empty(tmask)) | ||
130 | /* | ||
131 | * We could restore a default mask here, but the | ||
132 | * runtime code can anyway deal with the null set | ||
133 | */ | ||
134 | printk(KERN_WARNING | ||
135 | "IRQ affinity leaves no legal CPU for IRQ %d\n", irq); | ||
136 | |||
137 | /* Do any generic SMTC IRQ affinity setup */ | ||
138 | smtc_set_irq_affinity(irq, tmask); | ||
139 | } | ||
140 | #endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */ | ||