Re: SMDK6440: I2C writes fails

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

 



On 24 Jun 2010, at 13:35, Naveen Krishna Ch <naveenkrishna.ch@xxxxxxxxx> wrote:

> Hi Mark,
> 
> On 24 June 2010 17:02, Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>> 
>> On Wed, Jun 23, 2010 at 11:15:55AM +0530, Naveen Krishna Ch wrote:
>> 
>>> Where should i be looking,
>> 
>> I would suggest looking at the driver and comparing it with the
>> datasheet.
>> 
>>> Will changing the spin counts work?
>> 
>> I'd expect this to be unlikely.  Note that if we run out of spins we
>> still go for the 1ms sleep that was being used originally so it's more
>> likely that there's a bug in the chip when that register is being read
>> (though this would be surprising) or some other change in your kernel is
>> causing problems.
> 
>  --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -527,7 +527,7 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
>         /* first, try busy waiting briefly */
>         do {
>                 iicstat = readl(i2c->regs + S3C2410_IICSTAT);
> -       } while ((iicstat & S3C2410_IICSTAT_START) && --spins);
> +       } while (--spins && (iicstat & S3C2410_IICSTAT_START));
> 
>         /* if that timed out sleep */
>         if (!spins) {
> 
> Does the trick..

That smells rather like a compiler bug to me - the two versions
ought to be equivalent apart from the ordering of the comparisons.--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux