Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2003-10-17 07:44:00 +1000
committerPaul Mackerras <paulus@samba.org>2003-10-17 07:44:00 +1000
commit83161bf95c31fe6f962e3ead2326ea8c2f1abb81 (patch)
tree7f356ddb65c4359ff31295067252e446c93797d2
parentd411a89128b993602c7eb7196b8d6d0226335621 (diff)
merge some irq.c fixes from x86
-rw-r--r--arch/ppc64/kernel/irq.c35
-rw-r--r--arch/ppc64/kernel/ppc_ksyms.c6
2 files changed, 25 insertions, 16 deletions
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index d9631b90476d..1d43005fbb19 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -137,6 +137,8 @@ inline void synchronize_irq(unsigned int irq)
cpu_relax();
}
+EXPORT_SYMBOL(synchronize_irq);
+
#endif /* CONFIG_SMP */
/* XXX Make this into free_irq() - Anton */
@@ -241,7 +243,7 @@ EXPORT_SYMBOL(free_irq);
* This function may be called from IRQ context.
*/
- void disable_irq_nosync(unsigned int irq)
+inline void disable_irq_nosync(unsigned int irq)
{
irq_desc_t *desc = irq_desc + irq;
unsigned long flags;
@@ -255,6 +257,8 @@ EXPORT_SYMBOL(free_irq);
spin_unlock_irqrestore(&desc->lock, flags);
}
+EXPORT_SYMBOL(disable_irq_nosync);
+
/**
* disable_irq - disable an irq and wait for completion
* @irq: Interrupt to disable
@@ -276,6 +280,8 @@ void disable_irq(unsigned int irq)
synchronize_irq(irq);
}
+EXPORT_SYMBOL(disable_irq);
+
/**
* enable_irq - enable interrupt handling on an irq
* @irq: Interrupt to enable
@@ -307,11 +313,14 @@ void enable_irq(unsigned int irq)
desc->depth--;
break;
case 0:
- printk("enable_irq(%u) unbalanced\n", irq);
+ printk("enable_irq(%u) unbalanced from %p\n", irq,
+ __builtin_return_address(0));
}
spin_unlock_irqrestore(&desc->lock, flags);
}
+EXPORT_SYMBOL(enable_irq);
+
int show_interrupts(struct seq_file *p, void *v)
{
int i, j;
@@ -667,7 +676,7 @@ static int irq_affinity_read_proc (char *page, char **start, off_t off,
static unsigned int parse_hex_value (const char *buffer,
unsigned long count, cpumask_t *ret)
{
- unsigned char hexnum [HEX_DIGITS];
+ unsigned char hexnum[HEX_DIGITS];
cpumask_t value = CPU_MASK_NONE;
int i;
@@ -679,7 +688,7 @@ static unsigned int parse_hex_value (const char *buffer,
return -EFAULT;
/*
- * Parse the first 16 characters as a hex string, any non-hex char
+ * Parse the first HEX_DIGITS characters as a hex string, any non-hex char
* is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
*/
@@ -698,7 +707,6 @@ static unsigned int parse_hex_value (const char *buffer,
for (k = 0; k < 4; ++k)
if (test_bit(k, (unsigned long *)&c))
cpu_set(k, value);
-
}
out:
*ret = value;
@@ -715,6 +723,8 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
return -EIO;
err = parse_hex_value(buffer, count, &new_value);
+ if (err)
+ return err;
/*
* Do not allow disabling IRQs completely - it's a too easy
@@ -740,7 +750,7 @@ static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
return sprintf (page, "%08lx\n", *mask);
}
-static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
+static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
cpumask_t *mask = (cpumask_t *)data;
@@ -788,10 +798,12 @@ static void register_irq_proc (unsigned int irq)
/* create /proc/irq/1234/smp_affinity */
entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
- entry->nlink = 1;
- entry->data = (void *)(long)irq;
- entry->read_proc = irq_affinity_read_proc;
- entry->write_proc = irq_affinity_write_proc;
+ if (entry) {
+ entry->nlink = 1;
+ entry->data = (void *)(long)irq;
+ entry->read_proc = irq_affinity_read_proc;
+ entry->write_proc = irq_affinity_write_proc;
+ }
smp_affinity_entry[irq] = entry;
}
@@ -809,6 +821,9 @@ void init_irq_proc (void)
/* create /proc/irq/prof_cpu_mask */
entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
+ if (!entry)
+ return;
+
entry->nlink = 1;
entry->data = (void *)&prof_cpu_mask;
entry->read_proc = prof_cpu_mask_read_proc;
diff --git a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c
index 1f01ee19e644..98893369e7f4 100644
--- a/arch/ppc64/kernel/ppc_ksyms.c
+++ b/arch/ppc64/kernel/ppc_ksyms.c
@@ -57,12 +57,6 @@ extern struct pci_dev * iSeries_vio_dev;
EXPORT_SYMBOL(do_signal);
EXPORT_SYMBOL(sys_ioctl);
-EXPORT_SYMBOL(enable_irq);
-EXPORT_SYMBOL(disable_irq);
-EXPORT_SYMBOL(disable_irq_nosync);
-#ifdef CONFIG_SMP
-EXPORT_SYMBOL(synchronize_irq);
-#endif /* CONFIG_SMP */
EXPORT_SYMBOL(isa_io_base);
EXPORT_SYMBOL(pci_io_base);