public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Artem Shimko <a.shimko.dev@gmail.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Jan Dabros <jsd@semihalf.com>, Andi Shyti <andi.shyti@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: designware: add reset control support in suspend/resume
Date: Wed, 11 Mar 2026 14:10:55 +0200	[thread overview]
Message-ID: <abFbzyYHjTCilnqU@ashevche-desk.local> (raw)
In-Reply-To: <CAOPX746OoVrQYgJiBMgDA+VOkUj5mtUmxFEXubwHsXTnPsCsrA@mail.gmail.com>

On Wed, Mar 11, 2026 at 09:20:25AM +0300, Artem Shimko wrote:
> Hi Andy,
> On Tue, Mar 10, 2026 at 10:22 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > Usually we try to avoid _adding_ ugly ifdeffery. Can you elaborate why the
> > change is needed in the first place and why there is no better way to handle
> > it?
> 
> The conditional compilation is needed because ACPI and DT platforms have
> different requirements for system suspend/resume ordering: ACPI
> platforms require LATE_SUSPEND/EARLY_RESUME
> to support I2C operation regions, which may be accessed during
> suspend/resume of other devices. DT platforms don't have
> this requirement, but using LATE/EARLY callbacks causes problems
> because the I2C controller's dependencies (reset controller,
> clock controller) are not yet available at that stage, leading to hangs.
> 
> However, I agree that adding ifdefs is not ideal.
> 
> I have a couple ideas for v2, could you please advise which one is
> better from your point of view?
> 1. Splitting PM ops into separate structures for ACPI and DT
> 2. Using has_acpi_companion() checks in the resume callbacks

The second option is inline with the current approach in .prepare(),
so at least it would be easier to sell to the maintainers.

The first one will still require some ifdeffery if I am not mistaken.
(Or at least the similar has_acpi_companion() check.)

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-11 12:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 18:40 [PATCH] i2c: designware: add reset control support in suspend/resume Artem Shimko
2026-03-10 19:22 ` Andy Shevchenko
2026-03-11  6:20   ` Artem Shimko
2026-03-11 12:10     ` Andy Shevchenko [this message]
2026-03-23  7:42       ` Artem Shimko

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=abFbzyYHjTCilnqU@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=a.shimko.dev@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=p.zabel@pengutronix.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