Re: [PATCH 1/3] Input: adp5589-keys: handle i2c errors on the irq handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dmitry,

On Wed, May 06, 2015 at 04:33:23PM -0700, Dmitry Torokhov wrote:
> On Tue, Apr 21, 2015 at 04:35:04PM +0200, Michael Hennerich wrote:
> > On 04/21/2015 04:21 PM, Guido Martínez wrote:
> > >Bail out if reading the status register fails, otherwise we'll carry
> > >on with a negative error code as if it were read from the keypad, and
> > >falsely report events or errors.
> > >
> > >Fixes: 9d2e173644bb ('Input: ADP5589 - new driver for I2C Keypad Decoder and I/O Expander')
> > >Signed-off-by: Guido Martínez <guido@xxxxxxxxxxxxxxxxxxxx>
> > Acked-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
> > >---
> > >  drivers/input/keyboard/adp5589-keys.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > >diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c
> > >index a452677..19edd2d 100644
> > >--- a/drivers/input/keyboard/adp5589-keys.c
> > >+++ b/drivers/input/keyboard/adp5589-keys.c
> > >@@ -622,6 +622,9 @@ static irqreturn_t adp5589_irq(int irq, void *handle)
> > >  	status = adp5589_read(client, ADP5589_5_INT_STATUS);
> > >+	if (status < 0)
> > >+		return IRQ_HANDLED;
> > >+
> > >  	if (status & OVRFLOW_INT)	/* Unlikely and should never happen */
> > >  		dev_err(&client->dev, "Event Overflow Error\n");
> 
> Hmm, what about all other places where we read and ignore errors? Why
> this place is more important than others?
Good point. It's just the error we were hitting on our system since the
i2c controller failed. It should be the most common one should i2c fail,
but I agree that all other ones should be consistent with this one.

I'll work some more on it and resend.

Thanks!

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux