All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] sensors-detect: Check for 1-register-only
Date: Fri, 09 May 2008 05:06:23 +0000	[thread overview]
Message-ID: <4823DBCF.4090902@hhs.nl> (raw)
In-Reply-To: <20080508224145.41cfa3ef@hyperion.delvare>

Hans de Goede wrote:

<snip>

> 
> About the potential for doing an i2c read of 1 byte from a device which expects 
> a write reg address to read, then read 1 byte style transactions, causing 
> problems, I don't think this will cause issues, normally these kind of devices 
> are implemented using a read ptr, which tells the device where to start reading 
> in its internal memory map when an i2c read transaction is done. With the write 
> addr, then read cycle, the write sets that read ptr, so reading without the 
> write would give one the contents of a random register address and should not 
> be a problem otherwise.
> 
> Some devices may have additional checks build in though, and only accept a read 
> if there was a write before it within the same transaction (so in i2c terms:
> { start, write register address, repeated-start, read register contents, stop }
> 
> I've seen devices which wouldn't work if the repeated-start above was a { stop, 
> start } (dallas ds1621 temp sensor) Note: 1 this is not an smbus device, 2 I 
> don't remember how it failed.
> 
> But given that some smbus devices may be like the ds1621 and demand an address 
> write before a read in one transaction (so seperated by a repeated start), it 
> could be that the initial read in this proposed patch fails in that case with 
> an error because the sensor at 0x2e refuses the read and thus does not ack when 
> it gets addressed for the read transfer.
> 

And the point I was trying to make here but didn't is that I thus believe that 
the first 1 byte read in the new detection code should have error handling 
added, because it might fail (due to no ack) in which case we clearly do not 
have a 1 reg device.

Regards,

Hans

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2008-05-09  5:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08 20:41 [lm-sensors] [PATCH] sensors-detect: Check for 1-register-only Jean Delvare
2008-05-09  5:03 ` Hans de Goede
2008-05-09  5:06 ` Hans de Goede [this message]
2008-05-09  6:46 ` Hans de Goede
2008-05-09 10:43 ` Jean Delvare
2008-05-09 10:47 ` Hans de Goede
2008-05-09 11:51 ` achim
2008-05-09 12:14 ` Jean Delvare
2008-05-09 15:29 ` Jean Delvare
2008-05-09 17:05 ` Jean Delvare
2008-05-09 17:31 ` achim
2008-05-09 21:02 ` Jean Delvare
2008-05-09 21:16 ` Ludovic Lebègue
2008-05-10 16:40 ` Jean Delvare
2008-05-11 16:23 ` Jean Delvare
2008-05-12 10:53 ` Achim Gottinger

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=4823DBCF.4090902@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --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.