linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	Jon Hunter <jonathanh@nvidia.com>,
	linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 2/5] i2c: tegra: Restore pinmux on system resume
Date: Tue, 19 May 2020 18:07:35 +0200	[thread overview]
Message-ID: <20200519160735.GB2113674@ulmo> (raw)
In-Reply-To: <86fee5a3-fe2f-05ab-bc05-1c441d2845e9@gmail.com>

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

On Sat, May 09, 2020 at 06:35:41PM +0300, Dmitry Osipenko wrote:
> > 2. Could you please explain why I2C driver has to care about restoring
> > the pinmux state? Why pinctrl driver isn't doing that for I2C and
> > everything else?
> 
> Although, now I see what you meant in the commit's message.
> 
> Perhaps the "their I2C controllers may have lost the pinmux state in
> hardware" paragraph should be removed from the commit's message because
> it's irrelevant to this patch. The pinctrl state is changed once
> tegra_i2c_runtime_resume() is invoked and it is not about the change
> made by this patch.

The pinctrl state is changed in tegra_i2c_runtime_resume() *only if*
tegra_i2c_runtime_resume() has previously been called. So this patch
does indeed cause the pinmux to be restored, even though it does so
indirectly.

I think that paragraph is necessary to explain that. It's the pinctrl
that doesn't "notice" that the actual pinctrl state has changed from
"I2C" to "idle", so on resume it still thinks we're at "I2C" and won't
try to reapply the same state. Calling tegra_i2c_runtime_suspend() is
making sure that pinctrl explicitly switches to "idle", so that during
resume it will apply the "I2C" state since it is different from "idle".

Thierry

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

  reply	other threads:[~2020-05-19 16:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 19:33 [PATCH 0/5] i2c: tegra: Various fixes and improvements Thierry Reding
2020-05-06 19:33 ` [PATCH 1/5] Revert "i2c: tegra: Fix suspending in active runtime PM state" Thierry Reding
2020-05-06 19:33 ` [PATCH 2/5] i2c: tegra: Restore pinmux on system resume Thierry Reding
2020-05-06 22:43   ` mirq-test
2020-05-07 10:03     ` Thierry Reding
2020-05-07 12:20       ` Michał Mirosław
2020-05-07 21:50   ` Dmitry Osipenko
2020-05-08 10:31     ` Thierry Reding
2020-05-08 15:00       ` Dmitry Osipenko
2020-05-09 15:35         ` Dmitry Osipenko
2020-05-19 16:07           ` Thierry Reding [this message]
2020-05-19 15:57         ` Thierry Reding
2020-05-08 15:05   ` Dmitry Osipenko
2020-05-06 19:33 ` [PATCH 3/5] i2c: tegra: Keep IRQs enabled during suspend/resume Thierry Reding
2020-05-06 19:33 ` [PATCH 4/5] i2c: tegra: Better handle case where CPU0 is busy for a long time Thierry Reding
2020-05-06 19:33 ` [PATCH 5/5] i2c: tegra: Synchronize DMA before termination Thierry Reding

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=20200519160735.GB2113674@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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).