]> git.neil.brown.name Git - history.git/commitdiff
merge some irq.c fixes from x86
authorAnton Blanchard <anton@samba.org>
Thu, 16 Oct 2003 21:44:00 +0000 (07:44 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 16 Oct 2003 21:44:00 +0000 (07:44 +1000)
arch/ppc64/kernel/irq.c
arch/ppc64/kernel/ppc_ksyms.c

index d9631b90476df3a1ecdb5bf87b5c1d89e97269d5..1d43005fbb19f382d1131690ab579199354966e0 100644 (file)
@@ -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;
index 1f01ee19e64473ee5af735a4241b7ffa3572fd24..98893369e7f46c8a6f26766082eee35e538e246a 100644 (file)
@@ -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);