linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: ext-jaakko.laine@vaisala.com
Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	michal.simek@xilinx.com
Subject: Re: [PATCH 3/3] i2c: xiic: Support forcing single-master in DT
Date: Fri, 28 Aug 2020 09:02:57 +0200	[thread overview]
Message-ID: <20200828070257.GC1343@ninjato> (raw)
In-Reply-To: <20200827144848.12107-4-ext-jaakko.laine@vaisala.com>


[-- Attachment #1.1: Type: text/plain, Size: 1889 bytes --]

On Thu, Aug 27, 2020 at 05:48:48PM +0300, ext-jaakko.laine@vaisala.com wrote:
> From: Jaakko Laine <ext-jaakko.laine@vaisala.com>
> 
> I2C master operating in multimaster mode can get stuck
> indefinitely if I2C start is detected on bus, but no master
> has a transaction going.
> 
> This is a weakness in I2C standard, which defines no way
> to recover, since all masters are indefinitely disallowed
> from interrupting the currently operating master. A start
> condition can be created for example by an electromagnetic
> discharge applied near physical I2C lines. Or a already
> operating master could get reset immediately after sending
> a start.
> 
> If it is known during device tree creation that only a single
> I2C master will be present on the bus, this deadlock of the
> I2C bus could be avoided in the driver by ignoring the
> bus_is_busy register of the xiic, since bus can never be
> reserved by any other master.
> 
> This patch adds this support for detecting single-master flag
> in device tree and when provided, improves I2C reliability by
> ignoring the therefore unnecessary xiic bus_is_busy register.
> 
> Error can be reproduced by pulling I2C SDA -line temporarily low
> by shorting it to ground, while linux I2C master is operating on
> it using the xiic driver. The application using the bus will
> start receiving linux error code 16: "Device or resource busy"
> indefinitely:
> 
> kernel: pca953x 0-0020: failed writing register
> app: Error writing file, error: 16
> 
> With multi-master disabled device will instead receive error
> code 5: "I/O error" while SDA is grounded, but recover normal
> operation once short is removed.
> 
> kernel: pca953x 0-0020: failed reading register
> app: Error reading file, error: 5
> 
> Signed-off-by: Jaakko Laine <ext-jaakko.laine@vaisala.com>

Applied to for-next, thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply	other threads:[~2020-08-28  7:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 14:48 [PATCH 0/3] i2c: xiic: Support forcing single-master in DT ext-jaakko.laine
2020-08-27 14:48 ` [PATCH 1/3] i2c: xiic: Change code alignment to 1 space only ext-jaakko.laine
2020-08-28  7:02   ` Wolfram Sang
2020-08-27 14:48 ` [PATCH 2/3] i2c: xiic: Improve struct memory alignment ext-jaakko.laine
2020-08-27 15:56   ` Michal Simek
2020-08-28  7:02   ` Wolfram Sang
2020-08-27 14:48 ` [PATCH 3/3] i2c: xiic: Support forcing single-master in DT ext-jaakko.laine
2020-08-27 15:57   ` Michal Simek
2020-08-28  7:02   ` Wolfram Sang [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=20200828070257.GC1343@ninjato \
    --to=wsa@the-dreams.de \
    --cc=ext-jaakko.laine@vaisala.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=michal.simek@xilinx.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;
as well as URLs for NNTP newsgroup(s).