Re: [PATCH] i2c-smbus: Don't report duplicate alerts

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

 



On Tue, Jan 19, 2016 at 11:00:48AM -0600, minyard@xxxxxxx wrote:
> From: Corey Minyard <cminyard@xxxxxxxxxx>
> 
> Getting the same alert twice in a row is legal and normal,
> especially on a fast device (like running in qemu).  Kind of
> like interrupts.  So don't report duplicate alerts, and deliver
> them normally.
> 
> Signed-off-by: Corey Minyard <cminyard@xxxxxxxxxx>

Looks plausible to me, but I never used SMBALERT myself. Any chance this
can cause a regression? Jean, what do you think?

> ---
>  drivers/i2c/i2c-smbus.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
> index 94765a8..cecd423 100644
> --- a/drivers/i2c/i2c-smbus.c
> +++ b/drivers/i2c/i2c-smbus.c
> @@ -75,7 +75,6 @@ static void smbus_alert(struct work_struct *work)
>  {
>  	struct i2c_smbus_alert *alert;
>  	struct i2c_client *ara;
> -	unsigned short prev_addr = 0;	/* Not a valid address */
>  
>  	alert = container_of(work, struct i2c_smbus_alert, alert);
>  	ara = alert->ara;
> @@ -99,18 +98,12 @@ static void smbus_alert(struct work_struct *work)
>  		data.flag = status & 1;
>  		data.addr = status >> 1;
>  
> -		if (data.addr == prev_addr) {
> -			dev_warn(&ara->dev, "Duplicate SMBALERT# from dev "
> -				"0x%02x, skipping\n", data.addr);
> -			break;
> -		}
>  		dev_dbg(&ara->dev, "SMBALERT# from dev 0x%02x, flag %d\n",
>  			data.addr, data.flag);
>  
>  		/* Notify driver for the device which issued the alert */
>  		device_for_each_child(&ara->adapter->dev, &data,
>  				      smbus_do_alert);
> -		prev_addr = data.addr;
>  	}
>  
>  	/* We handled all alerts; re-enable level-triggered IRQs */
> -- 
> 2.5.0
> 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux