Commit 26e3689c authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

convert Megaraid to irqreturn_t

parent 28e9fb93
...@@ -1739,7 +1739,7 @@ issue_scb_block(adapter_t *adapter, u_char *raw_mbox) ...@@ -1739,7 +1739,7 @@ issue_scb_block(adapter_t *adapter, u_char *raw_mbox)
* Find out if our device is interrupting. If yes, acknowledge the interrupt * Find out if our device is interrupting. If yes, acknowledge the interrupt
* and service the completed commands. * and service the completed commands.
*/ */
static void static irqreturn_t
megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs) megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
{ {
adapter_t *adapter = devp; adapter_t *adapter = devp;
...@@ -1748,6 +1748,7 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1748,6 +1748,7 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
u8 nstatus; u8 nstatus;
u8 completed[MAX_FIRMWARE_STATUS]; u8 completed[MAX_FIRMWARE_STATUS];
u8 byte; u8 byte;
int handled = 0;
/* /*
...@@ -1762,8 +1763,7 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1762,8 +1763,7 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
/* /*
* No more pending commands * No more pending commands
*/ */
spin_unlock_irqrestore(&adapter->lock, flags); goto out_unlock;
return;
} }
set_irq_state(adapter, byte); set_irq_state(adapter, byte);
...@@ -1788,6 +1788,8 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1788,6 +1788,8 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
mega_rundoneq(adapter); mega_rundoneq(adapter);
handled = 1;
/* Loop through any pending requests */ /* Loop through any pending requests */
if(atomic_read(&adapter->quiescent) == 0) { if(atomic_read(&adapter->quiescent) == 0) {
mega_runpendq(adapter); mega_runpendq(adapter);
...@@ -1795,9 +1797,11 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1795,9 +1797,11 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
} while(1); } while(1);
out_unlock:
spin_unlock_irqrestore(&adapter->lock, flags); spin_unlock_irqrestore(&adapter->lock, flags);
return; return IRQ_RETVAL(handled);
} }
...@@ -1811,7 +1815,7 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1811,7 +1815,7 @@ megaraid_isr_iomapped(int irq, void *devp, struct pt_regs *regs)
* Find out if our device is interrupting. If yes, acknowledge the interrupt * Find out if our device is interrupting. If yes, acknowledge the interrupt
* and service the completed commands. * and service the completed commands.
*/ */
static void static irqreturn_t
megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs) megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs)
{ {
adapter_t *adapter = devp; adapter_t *adapter = devp;
...@@ -1820,6 +1824,7 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1820,6 +1824,7 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs)
u32 dword = 0; u32 dword = 0;
u8 nstatus; u8 nstatus;
u8 completed[MAX_FIRMWARE_STATUS]; u8 completed[MAX_FIRMWARE_STATUS];
int handled = 0;
/* /*
...@@ -1834,8 +1839,7 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1834,8 +1839,7 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs)
/* /*
* No more pending commands * No more pending commands
*/ */
spin_unlock_irqrestore(&adapter->lock, flags); goto out_unlock;
return;
} }
WROUTDOOR(adapter, 0x10001234); WROUTDOOR(adapter, 0x10001234);
...@@ -1857,6 +1861,8 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1857,6 +1861,8 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs)
/* Acknowledge interrupt */ /* Acknowledge interrupt */
WRINDOOR(adapter, 0x2); WRINDOOR(adapter, 0x2);
handled = 1;
while( RDINDOOR(adapter) & 0x02 ) cpu_relax(); while( RDINDOOR(adapter) & 0x02 ) cpu_relax();
mega_cmd_done(adapter, completed, nstatus, status); mega_cmd_done(adapter, completed, nstatus, status);
...@@ -1870,9 +1876,11 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs) ...@@ -1870,9 +1876,11 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs)
} while(1); } while(1);
out_unlock:
spin_unlock_irqrestore(&adapter->lock, flags); spin_unlock_irqrestore(&adapter->lock, flags);
return; return IRQ_RETVAL(handled);
} }
/** /**
* mega_cmd_done() * mega_cmd_done()
......
...@@ -1022,8 +1022,8 @@ static void __mega_runpendq(adapter_t *); ...@@ -1022,8 +1022,8 @@ static void __mega_runpendq(adapter_t *);
static inline void mega_runpendq(adapter_t *); static inline void mega_runpendq(adapter_t *);
static int issue_scb_block(adapter_t *, u_char *); static int issue_scb_block(adapter_t *, u_char *);
static void megaraid_isr_memmapped(int, void *, struct pt_regs *); static irqreturn_t megaraid_isr_memmapped(int, void *, struct pt_regs *);
static void megaraid_isr_iomapped(int, void *, struct pt_regs *); static irqreturn_t megaraid_isr_iomapped(int, void *, struct pt_regs *);
static void mega_free_scb(adapter_t *, scb_t *); static void mega_free_scb(adapter_t *, scb_t *);
......
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