Re: [PATCH 9/9 v2] iio: pressure: bmp280: read calibration data once

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

 



On Tue, Jun 28, 2016 at 09:34:34AM +0200, Linus Walleij wrote:
> On Mon, Jun 27, 2016 at 8:57 PM, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> > On 27/06/16 08:42, Vlad Dogaru wrote:
> >> On Wed, Jun 22, 2016 at 10:53:39PM +0200, Linus Walleij wrote:
> >>> The calibration data is described as coming from an E2PROM and that
> >>> means it does not change. Just read it once at probe time and store
> >>> it in the device state container. Also toss the calibration data
> >>> into the entropy pool since it is device unique.
> >>
> >> I think my initial thought when writing this was that regmap will take
> >> care of the caching and not hit the i2c bus each time.  But I don't have
> >> an issue with this change.  Other than that, series looks good to me.
> >
> > Good point. I must be half asleep.
> >
> > Linus, are we missing something? If not, I'd go without this one.
> 
> It's true that regmap does cache the contents of the registers,
> cutting the I2C bus traffic bottleneck. But reading it out every time
> still incurs a bulk read of 22 bytes from regmap, meaning 22 iterations
> in regmap where each need to be checked individually for volatileness
> etc in the regmap core, then this happens at every conversion.
> 
> Compared to just doing this once and keeping a copy around
> it is wasteful, so still an optimization worth it IMO.
> 
> Don't get me wrong, regmap is optimized
> (just check drivers/base/regmap/*) but it can never be as optimized
> as reading just once.
> 
> Also Vlad seems to OK it?

Yep, it's not a problem for me.  You're right about reading once being
more efficient and.

Thanks,
Vlad
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux