From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Baineng Shou <shoubaineng@gmail.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Andi Shyti <andi.shyti@kernel.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] i2c: designware: add atomic transfer support for IRQ-off contexts
Date: Mon, 31 Aug 2026 13:04:01 +0200 [thread overview]
Message-ID: <20260831110401.AafH5Gx-@linutronix.de> (raw)
In-Reply-To: <aneVvWDgfYr5bEun@ashevche-desk.local>
On 2026-08-08 23:46:53 [+0300], Andy Shevchenko wrote:
> > + /*
> > + * Fall back to the atomic path when IRQs are disabled, e.g. during
> > + * noirq system resume where an I2C client (GPIO expander, PMIC)
> > + * must be accessed before IRQs are re-enabled. The i2c core's
> > + * i2c_in_atomic_xfer_mode() gate does not cover resume_noirq
> > + * (system_state is already SYSTEM_RUNNING there), so the driver has
> > + * to route the transfer itself.
> > + */
> > + if (IS_ENABLED(CONFIG_PREEMPT_COUNT) ? !preemptible() : irqs_disabled())
>
> I don't like this. Do we have something better for this?
> Perhaps @bigeasy knows?
This looks hackish indeed. Couldn't this take an argument from the
caller to learn if it is called from the atomic path or the regular?
And could this be tested on PREEMPT_RT to figure out if it works as
intended? I do remember that some driver creates a warning on PREEMPT_RT
due to its atomic call path which is tested from probe. I don't remember
anyone tested it on RT other than just shutting down the warning,
claiming it is okay…
> > + return i2c_dw_xfer_atomic(adap, msgs, num);
>
Sebastian
prev parent reply other threads:[~2026-08-31 11:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 11:33 Baineng Shou
2026-08-08 20:46 ` Andy Shevchenko
2026-08-31 11:04 ` Sebastian Andrzej Siewior [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=20260831110401.AafH5Gx-@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=andi.shyti@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=shoubaineng@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 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®