From: Riku Voipio <riku.voipio@movial.fi>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] [RESEND #8] f75375s driver
Date: Thu, 02 Aug 2007 12:36:27 +0000 [thread overview]
Message-ID: <46B1CFCB.4070907@movial.fi> (raw)
In-Reply-To: <469F7C18.80200@movial.fi>
Mark M. Hoffman wrote:
> Comments are inline...
>
Thanks for review, fixing most issues was straightforward
for all except:
>> +static inline u16 f75375_read16(struct i2c_client *client, u8 reg)
>> +{
>> + return ((i2c_smbus_read_byte_data(client, reg) << 8)
>> + | i2c_smbus_read_byte_data(client, reg + 1));
>> +}
>> +
>>
>
> This is horrible hardware design. A single _read_word_data() would be much
> better here, but the datasheet apparently doesn't allow for it. Neither does
> the datasheet give advice for how to read the word-sized values coherently.
>
> E.g. it's common in such situations for the hardware to lock the second byte
> from updating for some time after the first byte is read. That's what I was
> looking for in the datasheet to make sure you did the accesses in the right
> order. AFAICT, nothing - so it's possible this thing is inherently racy.
>
>
I could use the update_mutex to avoid reading words when they are being
updated, but that does not protect from the chip modifying the values
itself?
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2007-08-02 12:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-19 14:58 [lm-sensors] [PATCH] [RESEND #8] f75375s driver Riku Voipio
2007-07-26 13:13 ` Mark M. Hoffman
2007-08-02 12:36 ` Riku Voipio [this message]
2007-08-03 2:58 ` Mark M. Hoffman
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=46B1CFCB.4070907@movial.fi \
--to=riku.voipio@movial.fi \
--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.