On 24 January 2013 12:54, Wolfram Sang <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to