[PATCH 2/4] mx2_camera: return IRQ_NONE when doing nothing

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Jul 28 03:27:18 EDT 2010


On Wed, Jul 28, 2010 at 08:53:37AM +0200, Sascha Hauer wrote:
> On Tue, Jul 27, 2010 at 03:06:08PM +0300, Baruch Siach wrote:
> > Signed-off-by: Baruch Siach <baruch at tkos.co.il>
> > ---
> >  drivers/media/video/mx2_camera.c |    8 +++++---
> >  1 files changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> > index 1536bd4..b42ad8d 100644
> > --- a/drivers/media/video/mx2_camera.c
> > +++ b/drivers/media/video/mx2_camera.c
> > @@ -420,15 +420,17 @@ static irqreturn_t mx25_camera_irq(int irq_csi, void *data)
> >  	struct mx2_camera_dev *pcdev = data;
> >  	u32 status = readl(pcdev->base_csi + CSISR);
> >  
> > -	if (status & CSISR_DMA_TSF_FB1_INT)
> > +	writel(status, pcdev->base_csi + CSISR);
> > +
> > +	if (!(status & (CSISR_DMA_TSF_FB1_INT | CSISR_DMA_TSF_FB2_INT)))
> > +		return IRQ_NONE;
> 
> I'm not sure this is correct. When we get here, the interrupt definitely
> is from the camera, it's not a shared interrupt. So this only provokes a
> 'nobody cared' message from the kernel (if it's still present, I don't
> know).

You'll only get the 'nobody cared' message if it's happened many times
in a short space of time.  The odd spurious IRQ_NONE has little effect.

It is good practice to return IRQ_NONE if there's nothing pending - it
allows stuck IRQs to be detected and disabled without taking the system
down.  In other words, it should make the system more robust.



More information about the linux-arm-kernel mailing list