mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: <balbi@ti.com>, Hein Tibosch <hein_tibosch@yahoo.es>,
	Tony Lindgren <tony@atomide.com>,
	linux-i2c <linux-i2c@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] i2c-omap: always send stop after nack
Date: Tue, 16 Jul 2013 16:00:58 +0300	[thread overview]
Message-ID: <20130716130058.GD15036@arwen.pp.htv.fi> (raw)
In-Reply-To: <51E537A4.40300@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2020 bytes --]

Hi,

(when replying, can you add some blank lines around your reply and the
previous mail, it's quite difficult to find your replies with so many
quote marks (>) around)

On Tue, Jul 16, 2013 at 03:08:04PM +0300, Grygorii Strashko wrote:
> Hi Felipe,
> On 07/16/2013 02:27 PM, Felipe Balbi wrote:
> >Hi,
> >
> >On Tue, Jul 16, 2013 at 02:01:11PM +0300, Grygorii Strashko wrote:
> >>>>>>On a OMAP4460, i2c-bus-3:
> >>>>>>
> >>>>>>A driver (lm75) is causing many 'timeout waiting for bus ready' errors.
> >>>>>>SDA remains high (as it should), but SCL remains low after a NACK.
> >>>>>>The bus becomes _unusable for other clients_.
> >>>>>>
> >>>>>>While probing, "lm75" writes a command, followed by a read + stop,
> >>>>>>but the write command is NACK'd. The chip does accept other writes/reads,
> >>>>>>it just refuses to ack invalid commands.
> >>>>>>
> >>>>>>Can you tell me if the patch below would make any sense? Or is it the
> >>>>>>responsibility of the client to reset the i2c_smbus?
> >>>>>patch below breaks repeated start.
> >>Felipe, I'd very appreciate if you'd be able to provide the use case
> >>which will fail with such solution?
> >
> >can't you see how this would fail ?
> >
> >assume omap_i2c_xfer() is called with its last argument (num) being
> >greater than one and you get the NAK before the last transfer.
> That's our case - NACK from slave before last transfer

with one difference, your device requires a STP condition because it's
SMBus, right ? Not all devices act like that :-)

But now I noticed, because of your reply, something I have been
overlooking for quite some time. As you said below, in case of NAK we
break out of the loop and don't even try the following messages.

Which means your original patch starts to make a lot more sense. I
wonder is this is really what we should be doing though - breaking out
of the loop, I mean.

It'd be cool to get an answer from I2C maintainers if we're doing the
right thing here.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-07-16 13:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16  8:19 Hein Tibosch
2013-07-16  9:03 ` Felipe Balbi
2013-07-16  9:33   ` Hein Tibosch
2013-07-16  9:42     ` Felipe Balbi
2013-07-16 11:01       ` Grygorii Strashko
2013-07-16 11:27         ` Felipe Balbi
2013-07-16 12:08           ` Grygorii Strashko
2013-07-16 13:00             ` Felipe Balbi [this message]
2013-07-16 16:17               ` Hein Tibosch
2013-08-19 12:11                 ` Wolfram Sang
2013-08-19 13:57                   ` Felipe Balbi
2013-08-19 14:05                     ` Wolfram Sang
2013-08-20 16:39                   ` Grygorii Strashko

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=20130716130058.GD15036@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=grygorii.strashko@ti.com \
    --cc=hein_tibosch@yahoo.es \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome