aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2012-12-12 10:36:37 -0500
committerDavid Howells <dhowells@redhat.com>2012-12-12 10:46:14 -0500
commit7d361cb754720d69695a3efc973e9a1a51e46b21 (patch)
tree4db3debac5fc6f6a78f0f185c4dcc5d9ddf01249 /arch/mn10300/kernel
parentc98c406eb2c518c7c5bc922fafa1f9fdcb7b76f4 (diff)
MN10300: cleanup IRQ affinity setting
The irq_set_affinity handler for the mn10300 cpu pic had some hard-coded IRQs which were not to be migrated from one cpu to another. This patch cleans those up by using a combination of IRQF_NOBALANCING and specialized irq chips with no irq_set_affinity handler. This maintains the previous behavior by using generic IRQ interfaces rather than hard coding IRQ numbers in the default irq_set_affinity handler. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300/kernel')
-rw-r--r--arch/mn10300/kernel/irq.c50
-rw-r--r--arch/mn10300/kernel/mn10300-serial.c9
-rw-r--r--arch/mn10300/kernel/smp.c10
3 files changed, 17 insertions, 52 deletions
diff --git a/arch/mn10300/kernel/irq.c b/arch/mn10300/kernel/irq.c
index 35932a8de8b8..6ab3b73efcf8 100644
--- a/arch/mn10300/kernel/irq.c
+++ b/arch/mn10300/kernel/irq.c
@@ -142,57 +142,11 @@ mn10300_cpupic_setaffinity(struct irq_data *d, const struct cpumask *mask,
142 bool force) 142 bool force)
143{ 143{
144 unsigned long flags; 144 unsigned long flags;
145 int err;
146 145
147 flags = arch_local_cli_save(); 146 flags = arch_local_cli_save();
148 147 set_bit(d->irq, irq_affinity_request);
149 /* check irq no */
150 switch (d->irq) {
151 case TMJCIRQ:
152 case RESCHEDULE_IPI:
153 case CALL_FUNC_SINGLE_IPI:
154 case LOCAL_TIMER_IPI:
155 case FLUSH_CACHE_IPI:
156 case CALL_FUNCTION_NMI_IPI:
157 case DEBUGGER_NMI_IPI:
158#ifdef CONFIG_MN10300_TTYSM0
159 case SC0RXIRQ:
160 case SC0TXIRQ:
161#ifdef CONFIG_MN10300_TTYSM0_TIMER8
162 case TM8IRQ:
163#elif CONFIG_MN10300_TTYSM0_TIMER2
164 case TM2IRQ:
165#endif /* CONFIG_MN10300_TTYSM0_TIMER8 */
166#endif /* CONFIG_MN10300_TTYSM0 */
167
168#ifdef CONFIG_MN10300_TTYSM1
169 case SC1RXIRQ:
170 case SC1TXIRQ:
171#ifdef CONFIG_MN10300_TTYSM1_TIMER12
172 case TM12IRQ:
173#elif defined(CONFIG_MN10300_TTYSM1_TIMER9)
174 case TM9IRQ:
175#elif defined(CONFIG_MN10300_TTYSM1_TIMER3)
176 case TM3IRQ:
177#endif /* CONFIG_MN10300_TTYSM1_TIMER12 */
178#endif /* CONFIG_MN10300_TTYSM1 */
179
180#ifdef CONFIG_MN10300_TTYSM2
181 case SC2RXIRQ:
182 case SC2TXIRQ:
183 case TM10IRQ:
184#endif /* CONFIG_MN10300_TTYSM2 */
185 err = -1;
186 break;
187
188 default:
189 set_bit(d->irq, irq_affinity_request);
190 err = 0;
191 break;
192 }
193
194 arch_local_irq_restore(flags); 148 arch_local_irq_restore(flags);
195 return err; 149 return 0;
196} 150}
197#endif /* CONFIG_SMP */ 151#endif /* CONFIG_SMP */
198 152
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c
index 131b81f9d6c8..4968cfe66c06 100644
--- a/arch/mn10300/kernel/mn10300-serial.c
+++ b/arch/mn10300/kernel/mn10300-serial.c
@@ -936,15 +936,18 @@ static int mn10300_serial_startup(struct uart_port *_port)
936 irq_set_chip(port->tm_irq, &mn10300_serial_pic); 936 irq_set_chip(port->tm_irq, &mn10300_serial_pic);
937 937
938 if (request_irq(port->rx_irq, mn10300_serial_interrupt, 938 if (request_irq(port->rx_irq, mn10300_serial_interrupt,
939 IRQF_DISABLED, port->rx_name, port) < 0) 939 IRQF_DISABLED | IRQF_NOBALANCING,
940 port->rx_name, port) < 0)
940 goto error; 941 goto error;
941 942
942 if (request_irq(port->tx_irq, mn10300_serial_interrupt, 943 if (request_irq(port->tx_irq, mn10300_serial_interrupt,
943 IRQF_DISABLED, port->tx_name, port) < 0) 944 IRQF_DISABLED | IRQF_NOBALANCING,
945 port->tx_name, port) < 0)
944 goto error2; 946 goto error2;
945 947
946 if (request_irq(port->tm_irq, mn10300_serial_interrupt, 948 if (request_irq(port->tm_irq, mn10300_serial_interrupt,
947 IRQF_DISABLED, port->tm_name, port) < 0) 949 IRQF_DISABLED | IRQF_NOBALANCING,
950 port->tm_name, port) < 0)
948 goto error3; 951 goto error3;
949 mn10300_serial_mask_ack(port->tm_irq); 952 mn10300_serial_mask_ack(port->tm_irq);
950 953
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c
index e62c223e4c45..95983cd21e77 100644
--- a/arch/mn10300/kernel/smp.c
+++ b/arch/mn10300/kernel/smp.c
@@ -130,10 +130,12 @@ static irqreturn_t smp_call_function_interrupt(int irq, void *dev_id);
130 130
131static struct irqaction reschedule_ipi = { 131static struct irqaction reschedule_ipi = {
132 .handler = smp_reschedule_interrupt, 132 .handler = smp_reschedule_interrupt,
133 .flags = IRQF_NOBALANCING,
133 .name = "smp reschedule IPI" 134 .name = "smp reschedule IPI"
134}; 135};
135static struct irqaction call_function_ipi = { 136static struct irqaction call_function_ipi = {
136 .handler = smp_call_function_interrupt, 137 .handler = smp_call_function_interrupt,
138 .flags = IRQF_NOBALANCING,
137 .name = "smp call function IPI" 139 .name = "smp call function IPI"
138}; 140};
139 141
@@ -141,7 +143,7 @@ static struct irqaction call_function_ipi = {
141static irqreturn_t smp_ipi_timer_interrupt(int irq, void *dev_id); 143static irqreturn_t smp_ipi_timer_interrupt(int irq, void *dev_id);
142static struct irqaction local_timer_ipi = { 144static struct irqaction local_timer_ipi = {
143 .handler = smp_ipi_timer_interrupt, 145 .handler = smp_ipi_timer_interrupt,
144 .flags = IRQF_DISABLED, 146 .flags = IRQF_DISABLED | IRQF_NOBALANCING,
145 .name = "smp local timer IPI" 147 .name = "smp local timer IPI"
146}; 148};
147#endif 149#endif
@@ -180,6 +182,7 @@ static void init_ipi(void)
180 182
181#ifdef CONFIG_MN10300_CACHE_ENABLED 183#ifdef CONFIG_MN10300_CACHE_ENABLED
182 /* set up the cache flush IPI */ 184 /* set up the cache flush IPI */
185 irq_set_chip(FLUSH_CACHE_IPI, &mn10300_ipi_type);
183 flags = arch_local_cli_save(); 186 flags = arch_local_cli_save();
184 __set_intr_stub(NUM2EXCEP_IRQ_LEVEL(FLUSH_CACHE_GxICR_LV), 187 __set_intr_stub(NUM2EXCEP_IRQ_LEVEL(FLUSH_CACHE_GxICR_LV),
185 mn10300_low_ipi_handler); 188 mn10300_low_ipi_handler);
@@ -189,6 +192,7 @@ static void init_ipi(void)
189#endif 192#endif
190 193
191 /* set up the NMI call function IPI */ 194 /* set up the NMI call function IPI */
195 irq_set_chip(CALL_FUNCTION_NMI_IPI, &mn10300_ipi_type);
192 flags = arch_local_cli_save(); 196 flags = arch_local_cli_save();
193 GxICR(CALL_FUNCTION_NMI_IPI) = GxICR_NMI | GxICR_ENABLE | GxICR_DETECT; 197 GxICR(CALL_FUNCTION_NMI_IPI) = GxICR_NMI | GxICR_ENABLE | GxICR_DETECT;
194 tmp16 = GxICR(CALL_FUNCTION_NMI_IPI); 198 tmp16 = GxICR(CALL_FUNCTION_NMI_IPI);
@@ -199,6 +203,10 @@ static void init_ipi(void)
199 __set_intr_stub(NUM2EXCEP_IRQ_LEVEL(SMP_BOOT_GxICR_LV), 203 __set_intr_stub(NUM2EXCEP_IRQ_LEVEL(SMP_BOOT_GxICR_LV),
200 mn10300_low_ipi_handler); 204 mn10300_low_ipi_handler);
201 arch_local_irq_restore(flags); 205 arch_local_irq_restore(flags);
206
207#ifdef CONFIG_KERNEL_DEBUGGER
208 irq_set_chip(DEBUGGER_NMI_IPI, &mn10300_ipi_type);
209#endif
202} 210}
203 211
204/** 212/**