Hi,

On 04/03/2012 12:05 PM, Michael Büsch wrote:
Now that i2c transfers are fixed, 3 retries are enough.

Signed-off-by: Michael Buesch<[email protected]>

---

Index: linux/drivers/media/common/tuners/fc0011.c
===================================================================
--- linux.orig/drivers/media/common/tuners/fc0011.c     2012-04-03 
08:48:39.000000000 +0200
+++ linux/drivers/media/common/tuners/fc0011.c  2012-04-03 10:44:07.243418827 
+0200
@@ -314,7 +314,7 @@
        if (err)
                return err;
        vco_retries = 0;
-       while (!(vco_cal&  FC11_VCOCAL_OK)&&  vco_retries<  6) {
+       while (!(vco_cal&  FC11_VCOCAL_OK)&&  vco_retries<  3) {

Do we need to retry at all?
I2C core layer is responsible to retry is xfer() fails.
If failure is propagated to driver I'd assume:
 - I2C is still buggy by not return -EAGAIN on arbitrary error
 - I2C xfer failed for real.

Look this piece of code from i2c-core.c:

int i2c_transfer()
{
...
                /* Retry automatically on arbitration loss */
                orig_jiffies = jiffies;
                for (ret = 0, try = 0; try <= adap->retries; try++) {
                        ret = adap->algo->master_xfer(adap, msgs, num);
                        if (ret != -EAGAIN)
                                break;
if (time_after(jiffies, orig_jiffies + adap->timeout))
                                break;
                }
...
}

BR,

David

                /* Reset the tuner and try again */
                err = fe->callback(priv->i2c, DVB_FRONTEND_COMPONENT_TUNER,
                                   FC0011_FE_CALLBACK_RESET, priv->addr);



--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to