Commit c4bea288 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Make error codes available from sun4v_intr_get*().

And check for errors at call sites.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4bf447d6
...@@ -154,9 +154,16 @@ void enable_irq(unsigned int irq) ...@@ -154,9 +154,16 @@ void enable_irq(unsigned int irq)
if (tlb_type == hypervisor) { if (tlb_type == hypervisor) {
unsigned int ino = __irq_ino(irq); unsigned int ino = __irq_ino(irq);
int cpu = hard_smp_processor_id(); int cpu = hard_smp_processor_id();
int err;
sun4v_intr_settarget(ino, cpu); 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); sun4v_intr_setenabled(ino, HV_INTR_ENABLED);
if (err != HV_EOK)
printk("sun4v_intr_setenabled(%x): err(%d)\n",
ino, err);
} else { } else {
if (tlb_type == cheetah || tlb_type == cheetah_plus) { if (tlb_type == cheetah || tlb_type == cheetah_plus) {
unsigned long ver; unsigned long ver;
...@@ -216,8 +223,12 @@ void disable_irq(unsigned int irq) ...@@ -216,8 +223,12 @@ void disable_irq(unsigned int irq)
if (imap != 0UL) { if (imap != 0UL) {
if (tlb_type == hypervisor) { if (tlb_type == hypervisor) {
unsigned int ino = __irq_ino(irq); unsigned int ino = __irq_ino(irq);
int err;
sun4v_intr_setenabled(ino, HV_INTR_DISABLED); err = sun4v_intr_setenabled(ino, HV_INTR_DISABLED);
if (err != HV_EOK)
printk("sun4v_intr_setenabled(%x): "
"err(%d)\n", ino, err);
} else { } else {
u32 tmp; u32 tmp;
...@@ -647,8 +658,12 @@ static void process_bucket(int irq, struct ino_bucket *bp, struct pt_regs *regs) ...@@ -647,8 +658,12 @@ static void process_bucket(int irq, struct ino_bucket *bp, struct pt_regs *regs)
if (bp->pil != 0) { if (bp->pil != 0) {
if (tlb_type == hypervisor) { if (tlb_type == hypervisor) {
unsigned int ino = __irq_ino(bp); unsigned int ino = __irq_ino(bp);
int err;
sun4v_intr_setstate(ino, 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 { } else {
upa_writel(ICLR_IDLE, bp->iclr); upa_writel(ICLR_IDLE, bp->iclr);
/* Test and add entropy */ /* Test and add entropy */
......
...@@ -1238,7 +1238,7 @@ extern unsigned long sun4v_intr_getenabled(unsigned long sysino); ...@@ -1238,7 +1238,7 @@ extern unsigned long sun4v_intr_getenabled(unsigned long sysino);
#define HV_FAST_INTR_SETENABLED 0xa2 #define HV_FAST_INTR_SETENABLED 0xa2
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void sun4v_intr_setenabled(unsigned long sysino, unsigned long intr_enabled); extern unsigned long sun4v_intr_setenabled(unsigned long sysino, unsigned long intr_enabled);
#endif #endif
/* intr_getstate() /* intr_getstate()
...@@ -1274,7 +1274,7 @@ extern unsigned long sun4v_intr_getstate(unsigned long sysino); ...@@ -1274,7 +1274,7 @@ extern unsigned long sun4v_intr_getstate(unsigned long sysino);
#define HV_FAST_INTR_SETSTATE 0xa4 #define HV_FAST_INTR_SETSTATE 0xa4
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state); extern unsigned long sun4v_intr_setstate(unsigned long sysino, unsigned long intr_state);
#endif #endif
/* intr_gettarget() /* intr_gettarget()
...@@ -1309,7 +1309,7 @@ extern unsigned long sun4v_intr_gettarget(unsigned long sysino); ...@@ -1309,7 +1309,7 @@ extern unsigned long sun4v_intr_gettarget(unsigned long sysino);
#define HV_FAST_INTR_SETTARGET 0xa6 #define HV_FAST_INTR_SETTARGET 0xa6
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid); extern unsigned long sun4v_intr_settarget(unsigned long sysino, unsigned long cpuid);
#endif #endif
/* PCI IO services. /* PCI IO services.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment