From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH 1/2 RESEND 3] hwmon: new vt1211 driver
Date: Thu, 31 Aug 2006 20:09:28 +0000 [thread overview]
Message-ID: <20060831220928.7d814891.khali@linux-fr.org> (raw)
In-Reply-To: <191fb4ca0608292235s3494ddecp2276c5d9841ac775@mail.gmail.com>
Juerg,
> > > + vt1211_write8(data, VT1211_REG_PWM_CTL,
> > > + ((data->pwm_ctl[1] << 4) |
> > > + data->pwm_ctl[0]));
> > > + vt1211_write8(data, VT1211_REG_FAN_DIV,
> > > + ((data->fan_div[1] << 6) |
> > > + (data->fan_div[0] << 4) |
> > > + data->fan_ctl));
> >
> > BTW, here you don't actually care about the values of fan_div, all you
> > need is to make sure you don't overwrite them in the register. In that
> > case it isn't very efficient to decode them and store them in the
> > cache, then shift and merge them again to recreate the register value.
> > Instead you could store the upper nibble of the register value in a
> > temporary variable, it'd be more efficient, and IMHO clearer.
>
> But if I don't update the cache I could end up with stale data on a
> following read. If there is a back-to-back read-write-read sequence,
> the 2nd read could return the cached value from the 1st read rather
> then the updated value from the write.
Sorry, I don't follow you here. Do you have a concrete example please?
At any rate, this is only an optimization. If you don't feel
comfortable with it, you can go on with your method which will still
work.
Thanks,
--
Jean Delvare
prev parent reply other threads:[~2006-08-31 20:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-30 5:35 [lm-sensors] [PATCH 1/2 RESEND 3] hwmon: new vt1211 driver Juerg Haefliger
2006-08-30 16:24 ` Jean Delvare
2006-08-30 17:46 ` Juerg Haefliger
2006-08-30 17:53 ` Jean Delvare
2006-08-30 18:30 ` Juerg Haefliger
2006-08-31 1:18 ` Juerg Haefliger
2006-08-31 20:09 ` Jean Delvare [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060831220928.7d814891.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.