ChangeSet 1.2231.1.140, 2005/03/28 19:55:27-08:00, [EMAIL PROTECTED]
[PATCH] Fix irq_affinity write from /proc for ia64
Made GENERIC_HARDIRQ mechanism work for ia64 and CPU hotplug. When
write
to /proc/irq is handled it is not appropriate to perform set_rte
immediatly, since there is a race when the interrupt is asserted while
the
re-program is happening. Hence such programming is only safe when we do
the re-program at the time of servicing an interrupt. This got broken
when
GENERIC_HARDIRQ got introduced for ia64.
- added CONFIG_PENDING_IRQ so default /proc/irq write handler can do
the right
thing.
TBD: We currently dont handle redirectable hint either in the display,
or
when we handle writes to /proc/irq/XX/smp_affinity. We need an arch
specific way to account for the presence of "r" hint when we handle the
proc write.
Signed-off-by: Ashok Raj <[EMAIL PROTECTED]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
arch/ia64/kernel/irq.c | 12 ++++++++++--
kernel/irq/proc.c | 10 ++++++++--
2 files changed, 18 insertions(+), 4 deletions(-)
diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
--- a/arch/ia64/kernel/irq.c 2005-03-28 21:37:19 -08:00
+++ b/arch/ia64/kernel/irq.c 2005-03-28 21:37:19 -08:00
@@ -94,11 +94,19 @@
/*
* This is updated when the user sets irq affinity via /proc
*/
-cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
+static cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)];
-static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 };
+
+/*
+ * Arch specific routine for deferred write to iosapic rte to reprogram
+ * intr destination.
+ */
+void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
+{
+ pending_irq_cpumask[irq] = mask_val;
+}
void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
{
diff -Nru a/kernel/irq/proc.c b/kernel/irq/proc.c
--- a/kernel/irq/proc.c 2005-03-28 21:37:19 -08:00
+++ b/kernel/irq/proc.c 2005-03-28 21:37:19 -08:00
@@ -19,6 +19,13 @@
*/
static struct proc_dir_entry *smp_affinity_entry[NR_IRQS];
+void __attribute__((weak))
+proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
+{
+ irq_affinity[irq] = mask_val;
+ irq_desc[irq].handler->set_affinity(irq, mask_val);
+}
+
static int irq_affinity_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
@@ -53,8 +60,7 @@
if (cpus_empty(tmp))
return -EINVAL;
- irq_affinity[irq] = new_value;
- irq_desc[irq].handler->set_affinity(irq, new_value);
+ proc_set_irq_affinity(irq, new_value);
return full_count;
}
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html