[SPARC64]: Make error codes available from sun4v_intr_get*().
[safe/jmp/linux-2.6] / arch / sparc64 / kernel / irq.c
index a55177e..0d3b0ea 100644 (file)
@@ -152,10 +152,18 @@ void enable_irq(unsigned int irq)
        preempt_disable();
 
        if (tlb_type == hypervisor) {
+               unsigned int ino = __irq_ino(irq);
                int cpu = hard_smp_processor_id();
-
-               sun4v_intr_settarget(irq, cpu);
-               sun4v_intr_setenabled(irq, HV_INTR_ENABLED);
+               int err;
+
+               err = sun4v_intr_settarget(ino, cpu);
+               if (err != HV_EOK)
+                       printk("sun4v_intr_settarget(%x,%d): err(%d)\n",
+                              ino, cpu, err);
+               sun4v_intr_setenabled(ino, HV_INTR_ENABLED);
+               if (err != HV_EOK)
+                       printk("sun4v_intr_setenabled(%x): err(%d)\n",
+                              ino, err);
        } else {
                if (tlb_type == cheetah || tlb_type == cheetah_plus) {
                        unsigned long ver;
@@ -214,7 +222,13 @@ void disable_irq(unsigned int irq)
        imap = bucket->imap;
        if (imap != 0UL) {
                if (tlb_type == hypervisor) {
-                       sun4v_intr_setenabled(irq, HV_INTR_DISABLED);
+                       unsigned int ino = __irq_ino(irq);
+                       int err;
+
+                       err = sun4v_intr_setenabled(ino, HV_INTR_DISABLED);
+                       if (err != HV_EOK)
+                               printk("sun4v_intr_setenabled(%x): "
+                                      "err(%d)\n", ino, err);
                } else {
                        u32 tmp;
 
@@ -643,9 +657,13 @@ static void process_bucket(int irq, struct ino_bucket *bp, struct pt_regs *regs)
        }
        if (bp->pil != 0) {
                if (tlb_type == hypervisor) {
-                       unsigned int irq = __irq(bp);
+                       unsigned int ino = __irq_ino(bp);
+                       int err;
 
-                       sun4v_intr_setstate(irq, HV_INTR_STATE_IDLE);
+                       err = sun4v_intr_setstate(ino, HV_INTR_STATE_IDLE);
+                       if (err != HV_EOK)
+                               printk("sun4v_intr_setstate(%x): "
+                                      "err(%d)\n", ino, err);
                } else {
                        upa_writel(ICLR_IDLE, bp->iclr);
                        /* Test and add entropy */
@@ -791,10 +809,10 @@ static int retarget_one_irq(struct irqaction *p, int goal_cpu)
        }
 
        if (tlb_type == hypervisor) {
-               unsigned int irq = __irq(bucket);
+               unsigned int ino = __irq_ino(bucket);
 
-               sun4v_intr_settarget(irq, goal_cpu);
-               sun4v_intr_setenabled(irq, HV_INTR_ENABLED);
+               sun4v_intr_settarget(ino, goal_cpu);
+               sun4v_intr_setenabled(ino, HV_INTR_ENABLED);
        } else {
                unsigned int tid;