All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Roman Rozman <rozmanro@gmail.com>
Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: I2C bus locked: marvell mv64xxx i2c controller driver
Date: Tue, 5 Feb 2019 20:58:57 +0100	[thread overview]
Message-ID: <20190205195857.oadxiswya5wq5hca@pengutronix.de> (raw)
In-Reply-To: <CAEHvULnPFtCK9cD3GtFKoZ+OHaqN1ZJMmPxK+OPnYqhptk8t7w@mail.gmail.com>

Cc += linux-i2c

Hello,

On Tue, Feb 05, 2019 at 12:18:05PM +0200, Roman Rozman wrote:
> Having an issue that i know was found many years ago, and there were
> patches along the way for it, but i'm still having an issue.
> 
> I have a SFP connector connected to the switch, the EEprom is fine & readable
> ,the connector is working.
> But after i reboot the device from user space,on startup an I2C bus
> locked issue is happening.
> And the EEprom of the i2c device is no longer readable.
> 
> see screen capture during the reboot:
> 
> [ 5.663823] i2c /dev entries driver
> [ 5.852006] usb 1-1: new high-speed USB device number 2 using orion-ehci
> [ 6.058964] usb-storage 1-1:1.0: USB Mass Storage device detected
> [ 6.065221] scsi host0: usb-storage 1-1:1.0
> [ 7.112857] scsi 0:0:0:0: Direct-Access Generic Ultra HS-COMBO 1.98 PQ: 0 ANSI: 0
> [ 7.122702] sd 0:0:0:0: [sda] Attached SCSI removable disk
> [ 7.752006] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 9.832006] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 11.912005] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 11.918603] lm75: probe of 1-0048 failed with error -110
> [ 11.925496] orion_wdt: Initial timeout 171 sec
> 
> [ 14.472004] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 14.478563] sfp sfp: failed to read EEPROM: -110
> 
> I read regarding the known "possible solution" that the master should
> send nine clock pulses((SDA) is stuck LOW). And the device that held
> the bus LOW should release it sometime within those nine clocks.
> 
> My question is there any GENERIC way to do that for the mv64xxx driver?
> Or maybe there is some other solution for this.

The relevant keyword here is "recovery". The i2c core has some helper
functions that make it easy to reset the bus if your pins can be driven
using a gpio functionality. See i2c_generic_scl_recovery() in
drivers/i2c/i2c-core-base.c.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Roman Rozman <rozmanro@gmail.com>
Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: I2C bus locked: marvell mv64xxx i2c controller driver
Date: Tue, 5 Feb 2019 20:58:57 +0100	[thread overview]
Message-ID: <20190205195857.oadxiswya5wq5hca@pengutronix.de> (raw)
In-Reply-To: <CAEHvULnPFtCK9cD3GtFKoZ+OHaqN1ZJMmPxK+OPnYqhptk8t7w@mail.gmail.com>

Cc += linux-i2c

Hello,

On Tue, Feb 05, 2019 at 12:18:05PM +0200, Roman Rozman wrote:
> Having an issue that i know was found many years ago, and there were
> patches along the way for it, but i'm still having an issue.
> 
> I have a SFP connector connected to the switch, the EEprom is fine & readable
> ,the connector is working.
> But after i reboot the device from user space,on startup an I2C bus
> locked issue is happening.
> And the EEprom of the i2c device is no longer readable.
> 
> see screen capture during the reboot:
> 
> [ 5.663823] i2c /dev entries driver
> [ 5.852006] usb 1-1: new high-speed USB device number 2 using orion-ehci
> [ 6.058964] usb-storage 1-1:1.0: USB Mass Storage device detected
> [ 6.065221] scsi host0: usb-storage 1-1:1.0
> [ 7.112857] scsi 0:0:0:0: Direct-Access Generic Ultra HS-COMBO 1.98 PQ: 0 ANSI: 0
> [ 7.122702] sd 0:0:0:0: [sda] Attached SCSI removable disk
> [ 7.752006] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 9.832006] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 11.912005] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 11.918603] lm75: probe of 1-0048 failed with error -110
> [ 11.925496] orion_wdt: Initial timeout 171 sec
> 
> [ 14.472004] i2c i2c-1: mv64xxx: I2C bus locked, block: 1, time_left: 0
> [ 14.478563] sfp sfp: failed to read EEPROM: -110
> 
> I read regarding the known "possible solution" that the master should
> send nine clock pulses((SDA) is stuck LOW). And the device that held
> the bus LOW should release it sometime within those nine clocks.
> 
> My question is there any GENERIC way to do that for the mv64xxx driver?
> Or maybe there is some other solution for this.

The relevant keyword here is "recovery". The i2c core has some helper
functions that make it easy to reset the bus if your pins can be driven
using a gpio functionality. See i2c_generic_scl_recovery() in
drivers/i2c/i2c-core-base.c.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

  reply	other threads:[~2019-02-05 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 10:18 I2C bus locked: marvell mv64xxx i2c controller driver Roman Rozman
2019-02-05 19:58 ` Uwe Kleine-König [this message]
2019-02-05 19:58   ` Uwe Kleine-König

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=20190205195857.oadxiswya5wq5hca@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=rozmanro@gmail.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 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.