Re: [PATCH V8 2/2] i2c/designware: Provide i2c bus recovery support

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

 



On 24 January 2013 12:54, Wolfram Sang <w.sang@xxxxxxxxxxxxxx> wrote:
> On Mon, Dec 03, 2012 at 08:24:05AM +0530, Viresh Kumar wrote:
>> @@ -538,7 +538,11 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
>>       ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete, HZ);
>>       if (ret == 0) {
>>               dev_err(dev->dev, "controller timed out\n");
>> -             i2c_dw_init(dev);
>> +             if (adap->bus_recovery_info) {
>> +                     dev_dbg(dev->dev, "try i2c bus recovery\n");
>> +                     adap->bus_recovery_info->recover_bus(adap);
>> +             }
>> +
>
> I think we need something like i2c_recover_bus in the core which does
> the above and also returns the return code from recover_bus. If there is
> no recover_bus it should return EOPNOTSUPP.
>
> Then the driver can do
>
>         ret = i2c_recover_bus(adap);
>         if (ret < 0)
>                 i2c_dw_init();
>
> If not calling i2c_dw_init, you will probably cause a regression.

Fair enough.

>> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
>> +err_free_recovery_info:
>> +     kfree(recovery_info);

Leftover of earlier versions, my mistake :(
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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