Skip to content

Commit

Permalink
[SPARC64]: Make error codes available from sun4v_intr_get*().
Browse files Browse the repository at this point in the history
And check for errors at call sites.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 20, 2006
1 parent 4bf447d commit c4bea28
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
21 changes: 18 additions & 3 deletions arch/sparc64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,16 @@ void enable_irq(unsigned int irq)
if (tlb_type == hypervisor) {
unsigned int ino = __irq_ino(irq);
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);
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;
Expand Down Expand Up @@ -216,8 +223,12 @@ void disable_irq(unsigned int irq)
if (imap != 0UL) {
if (tlb_type == hypervisor) {
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 {
u32 tmp;

Expand Down Expand Up @@ -647,8 +658,12 @@ static void process_bucket(int irq, struct ino_bucket *bp, struct pt_regs *regs)
if (bp->pil != 0) {
if (tlb_type == hypervisor) {
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 {
upa_writel(ICLR_IDLE, bp->iclr);
/* Test and add entropy */
Expand Down
6 changes: 3 additions & 3 deletions include/asm-sparc64/hypervisor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ extern unsigned long sun4v_intr_getenabled(unsigned long sysino);
#define HV_FAST_INTR_SETENABLED 0xa2

#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

/* intr_getstate()
Expand Down Expand Up @@ -1274,7 +1274,7 @@ extern unsigned long sun4v_intr_getstate(unsigned long sysino);
#define HV_FAST_INTR_SETSTATE 0xa4

#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

/* intr_gettarget()
Expand Down Expand Up @@ -1309,7 +1309,7 @@ extern unsigned long sun4v_intr_gettarget(unsigned long sysino);
#define HV_FAST_INTR_SETTARGET 0xa6

#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

/* PCI IO services.
Expand Down

0 comments on commit c4bea28

Please sign in to comment.