public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	nsekhar@ti.com, khilman@deeprootsystems.com,
	davinci-linux-open-source@linux.davincidsp.com
Subject: Re: [PATCH] i2c-davinci: Handle signals gracefully
Date: Sun, 9 Mar 2014 21:21:07 +0100	[thread overview]
Message-ID: <20140309202107.GA2835@katana> (raw)
In-Reply-To: <1389265885-26777-1-git-send-email-mike.looijmans@topic.nl>

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

On Thu, Jan 09, 2014 at 12:11:25PM +0100, Mike Looijmans wrote:
> When a signal is caught while the i2c-davinci bus driver is transferring,
> the drive just "abandons" the transfer and leaves the controller to fend
> for itself. The next I2C transaction will find the controller in an
> undefined state and often results in a stream of "initiating i2c bus recovery"
> messages until the controller arrives in a defined state. This behaviour
> also sends out "half" or possibly even mixed messages to I2C client
> devices which may put them in an undesired state as well.
> 
> This patch fixes this issue by always attempting to finish the current
> transaction, and then check on a pending signal. It either reports
> success if all data has been transferred, or it returns failure when
> the transaction was aborted. This keeps the controller in a defined
> state, and is also much friendlier towards client devices, because
> it will only send complete messages.

Even more, you should complete the whole transfer. There are devices
where things can really go wrong if you send a half-complete command and
then start with the next one. So, not checking signals at all is the way
to go for I2C drivers. There is some cruft left, so I am happy about
patches fixing that, with testing on real HW. Like yours here.


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

  reply	other threads:[~2014-03-09 20:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 11:11 [PATCH] i2c-davinci: Handle signals gracefully Mike Looijmans
2014-03-09 20:21 ` Wolfram Sang [this message]
2014-03-10 10:24   ` Mike Looijmans
2014-03-10 10:59     ` Wolfram Sang
2014-03-10 15:24       ` Wolfram Sang
2014-03-14  6:43         ` Mike Looijmans
2014-03-14  6:42 ` Mike Looijmans
2014-03-24 16:14   ` Wolfram Sang
2014-05-21  8:17     ` Wolfram Sang
2014-05-24 11:53       ` Mike Looijmans
2014-06-01 20:11         ` Wolfram Sang
2014-11-08 21:51           ` Wolfram Sang
2014-11-10 14:49             ` Mike Looijmans

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=20140309202107.GA2835@katana \
    --to=wsa@the-dreams.de \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.looijmans@topic.nl \
    --cc=nsekhar@ti.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