lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231213151312.1165115-1-enachman@marvell.com>
Date:   Wed, 13 Dec 2023 17:13:11 +0200
From:   Elad Nachman <enachman@...vell.com>
To:     <gregory.clement@...tlin.com>, <andi.shyti@...nel.org>,
        <linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     <enachman@...vell.com>, <cyuval@...vell.com>
Subject: [PATCH v3 0/1] i2c: busses: i2c-mv64xxx: fix arb-loss i2c lock

From: Elad Nachman <enachman@...vell.com>

i2c: busses: i2c-mv64xxx: fix arb-loss i2c lock

Some i2c slaves, mainly SFPs, might cause the bus to lose arbitration
while slave is in the middle of responding.
This means that the i2c slave has not finished the transmission, but
the master has already finished toggling the clock, probably due to
the slave missing some of the master's clocks.
This was seen with Ubiquity SFP module.
This is typically caused by slaves which do not adhere completely
to the i2c standard.

The solution is to change the I2C mode from mpps to gpios, and toggle
the i2c_scl gpio to emulate bus clock toggling, so slave will finish
its transmission, driven by the manual clock toggling, and will release
the i2c bus.

v3:
   1) Remove unused / un-initialized variable

   2) Replace devm_pinctrl_get() with pinctrl_get() and pinctrl_put() pair
      in probe and device removal.

   3) Replace atomic sleeps with usleep_range()

   4) Rework comment to start with a capital letter

v2:
   1) Explain more about cause of issue in commit message

   2) Change variable name to something clearer

   3) Leave space between comments

   4) Remove redundant blank line

   5) Add error message if pinctrl get failed

   6) Move gpio request to probe function

   7) Fix commenting style

   8) Explain in comments why 10 togglings are required

   9) Move from mdelay to udelay, reducing delay time

   10) Explain in comments what is the value written
       to the reset register.

   11) Explain why fallthrough is required (generate stop condition)

   12) Explain why in case of missing i2c arbitration loss details,
       driver probe will not fail, in order to be backward compatible
       with older dts files

Elad Nachman (1):
  i2c: busses: i2c-mv64xxx: fix arb-loss i2c lock

 drivers/i2c/busses/i2c-mv64xxx.c | 118 ++++++++++++++++++++++++++++++-
 1 file changed, 117 insertions(+), 1 deletion(-)

-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ