From: Wolfram Sang <wsa@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-i2c@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: designware: Lock the adapter while setting the suspended flag
Date: Tue, 1 Mar 2022 16:32:36 +0100 [thread overview]
Message-ID: <Yh48lAgASIr3kM0x@ninjato> (raw)
In-Reply-To: <20220223134839.731138-1-hdegoede@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
On Wed, Feb 23, 2022 at 02:48:38PM +0100, Hans de Goede wrote:
> Lock the adapter while setting the suspended flag, to ensure that other
> locked code always sees the change immediately, rather then possibly using
> a stale value.
>
> This involves splitting the suspend/resume callbacks into separate runtime
> and normal suspend/resume calls. This is necessary because i2c_dw_xfer()
> will get called by the i2c-core with the adapter locked and it in turn
> calls the runtime-resume callback through pm_runtime_get_sync().
>
> So the runtime versions of the suspend/resume callbacks cannot take
> the adapter-lock. Note this patch simply makes the runtime suspend/resume
> callbacks not deal with the suspended flag at all. During runtime the
> pm_runtime_get_sync() from i2c_dw_xfer() will always ensure that the
> adapter is resumed when necessary.
>
> The suspended flag check is only necessary to check proper suspend/resume
> ordering during normal suspend/resume which makes the pm_runtime_get_sync()
> call a no-op.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied to for-next, thanks! We can still backport if we find out we
really need it...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-03-01 15:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-23 13:48 [PATCH 1/2] i2c: designware: Lock the adapter while setting the suspended flag Hans de Goede
2022-02-23 13:48 ` [PATCH 2/2] i2c: designware: Use the i2c_mark_adapter_suspended/resumed() helpers Hans de Goede
2022-02-24 13:03 ` Jarkko Nikula
2022-03-01 15:33 ` Wolfram Sang
2022-02-23 14:52 ` [PATCH 1/2] i2c: designware: Lock the adapter while setting the suspended flag Andy Shevchenko
2022-02-23 15:15 ` Hans de Goede
2022-02-24 13:02 ` Jarkko Nikula
2022-03-01 15:32 ` 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=Yh48lAgASIr3kM0x@ninjato \
--to=wsa@kernel.org \
--cc=andy@kernel.org \
--cc=hdegoede@redhat.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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