mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Zhu Jun <zhujun2@cmss.chinamobile.com>
Cc: jic23@kernel.org, andy.shevchenko@gmail.com, andy@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] iio: potentiostat: lmp91000: Handle configuration write errors
Date: Thu, 19 Nov 2026 12:06:38 +0200	[thread overview]
Message-ID: <av7KLkQPFSf2ir8E@ashevche-desk.local> (raw)
In-Reply-To: <20261119032155.11434-1-zhujun2@cmss.chinamobile.com>

On Thu, Nov 19, 2026 at 11:21:55AM +0800, Zhu Jun wrote:
> On Mon, Nov 16, 2026, Andy Shevchenko wrote:
> > How is HW being recovered from the inconsistent state(s)?
> 
> v3 has no hardware recovery step. The LOCK bit only controls write
> access to TIACN and REFCN (datasheet section 7.6.2). Setting it again
> leaves the register values as they are.
> 
> If the unlock write fails, we stop before writing either configuration
> register. The resulting lock state is unconfirmed. If a configuration
> write fails, the chip may be partly configured. We try to restore write
> protection and return the configuration error. If both configuration
> writes succeed and the relock write fails, we return the relock error.
> In that case the configuration writes succeeded, but write protection
> is unconfirmed. If both a configuration write and the relock fail, v3
> only reports the configuration error.

Right, in each of these cases what will be the outcome to the user?

> In all three cases probe exits before registering the IIO device. If
> the device is probed again and I2C is working, the same sequence writes
> LOCK=0, rewrites both registers and writes LOCK=1. That would restore
> these register settings regardless of the previous lock state.

This is a recovery mechanism! But specific question is the above: what
will happen with HW in each of these states when we try to re-probe the
driver?

> The driver does not schedule a retry or reset the chip after these errors,
> and I have not verified recovery on hardware.
> 
> Datasheet: https://www.ti.com/lit/ds/symlink/lmp91000.pdf

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-11-19 10:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  8:25 Zhu Jun
2026-11-13  8:41 ` Andy Shevchenko
2026-11-13  8:47   ` Andy Shevchenko
2026-11-14  1:41     ` Jonathan Cameron
2026-11-16  9:53       ` Andy Shevchenko
2026-11-19  3:21         ` Zhu Jun
2026-11-19 10:06           ` Andy Shevchenko [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=av7KLkQPFSf2ir8E@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=zhujun2@cmss.chinamobile.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

all inboxes | Powered by JetHome®