Re: [PATCH] i2c: synquacer: fix synquacer_i2c_doxfer() return value

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

 



On Tue, 28 May 2019 at 04:34, Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote:
>
> On Tue, May 21, 2019 at 10:33:50AM +0900, Masahisa Kojima wrote:
> > master_xfer should return the number of messages successfully
> > processed.
> >
> > Fixes: 0d676a6c4390 ("i2c: add support for Socionext SynQuacer I2C controller")
> > Cc: <stable@xxxxxxxxxxxxxxx> # v4.19+
> > Signed-off-by: Okamoto Satoru <okamoto.satoru@xxxxxxxxxxxxx>
> > Signed-off-by: Masahisa Kojima <masahisa.kojima@xxxxxxxxxx>
>
> Applied to for-current, thanks!
>

Thank you for merging and your feedback.

> I just noticed you have an open coded loop in synquacer_i2c_xfer() which
> should not be needed because the I2C core does that?

I'm not sure I correctly understand the meaning of "open coded loop",
but I2C controller status such as lost arbitration and bus busy is checked
in the retry of synquacer_i2c_doxfer().

> Your code does a HW
> reset, though, but is it really needed for a lost arbitration?

Other than handling lost arbitration, this loop also handles following errors.
 - transfer fails(expected size and actual transferred size is not matched)
 - transfer timeout
I think it is reasonable to reset the I2C controller before xfer() retries.

Regards,
Masahisa



[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