Re: [PATCH v2 6/7] i2c: img-scb: Clear line and interrupt status before starting a transfer

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

 



On Fri, Aug 14, 2015 at 04:50:23PM +0100, Sifan Naeem wrote:
> Clear line status and all generated interrupts from the interrupt
> status register before starting a transfer, as we may have
> unserviced interrupts from previous transfers that might be
> handled in the context of the new transfer.
> 
> Fixes: commit 27bce457d588 ("i2c: img-scb: Add Imagination Technologies I2C SCB driver")
> Signed-off-by: Sifan Naeem <sifan.naeem@xxxxxxxxxx>
> Reviewed-by: James Hartley <james.hartley@xxxxxxxxxx>

I think it could have done with some more explanation about when this
happens and whether between messages in the transfer or between
transfers, but it does look safe and reasonable, so:

Acked-by: James Hogan <james.hogan@xxxxxxxxxx>

Cheers
James

> ---
>  drivers/i2c/busses/i2c-img-scb.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c
> index 200108dbd194..6c21a7bd9a66 100644
> --- a/drivers/i2c/busses/i2c-img-scb.c
> +++ b/drivers/i2c/busses/i2c-img-scb.c
> @@ -1068,6 +1068,15 @@ static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
>  		i2c->last_msg = (i == num - 1);
>  		reinit_completion(&i2c->msg_complete);
>  
> +		/*
> +		 * Clear line status and all interrupts before starting a
> +		 * transfer, as we may have unserviced interrupts from
> +		 * previous transfers that might be handled in the context
> +		 * of the new transfer.
> +		 */
> +		img_i2c_writel(i2c, SCB_INT_CLEAR_REG, ~0);
> +		img_i2c_writel(i2c, SCB_CLEAR_REG, ~0);
> +
>  		if (atomic)
>  			img_i2c_atomic_start(i2c);
>  		else if (msg->flags & I2C_M_RD)
> -- 
> 1.7.9.5
> 

Attachment: signature.asc
Description: Digital 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