On 12 March 2015 at 10:50, Alexander Sverdlin
<[email protected]> wrote:
> On 11/03/15 19:35, ext [email protected] wrote:
>>> +    if (i2c_davinci_wait_status_change(dev, DAVINCI_I2C_STR_BB, 0)) {
>>> +        dev_warn(dev->dev, "timeout waiting for bus ready\n");
>>> +        davinci_i2c_recover_bus(dev);
>>> +        i2c_davinci_init(dev);
>>> +        /*
>>> +         * the bus should not be busy after init, otherwise something
>>> +         * is badly broken
>>> +         */
>>
>> I think you should recheck BB and return error if it's still detected.
>
> But after re-reading the datasheet, I must conclude, this is almost not 
> possible.
> It will be a dead code. Reset will clear BB anyway and the only possibility 
> to see
> BB set to 1 here is when another master transmits right after our reset. We 
> cannot
> guarantee that we will always catch this here, so this must be any way 
> handled over
> AL interrupt.

The question here what is worse:
- silently continue execution with undefined behavior
- or recheck and return error (That's how it was before).

I like option 2 :) - don't believe HW.

-- 
Best regards,
-grygorii
--
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