From: Jisheng Zhang <jszhang@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Jan Dabros <jsd@semihalf.com>, Andi Shyti <andi.shyti@kernel.org>,
linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: designware: Avoid taking clk_prepare mutex in PM callbacks
Date: Thu, 21 Aug 2025 00:33:08 +0800 [thread overview]
Message-ID: <aKX4xEYE29JC_g14@xhacker> (raw)
In-Reply-To: <aKXyVvFOvpsaAEAB@smile.fi.intel.com>
On Wed, Aug 20, 2025 at 07:05:42PM +0300, Andy Shevchenko wrote:
> On Wed, Aug 20, 2025 at 11:31:24PM +0800, Jisheng Zhang wrote:
> > This is unsafe, as the runtime PM callbacks are called from the PM
> > workqueue, so this may deadlock when handling an i2c attached clock,
> > which may already hold the clk_prepare mutex from another context.
>
> Can you be more specific? What is the actual issue in practice?
> Do you have traces and lockdep warnings?
Assume we use i2c designware to control any i2c based clks, e.g the
clk-si5351.c driver. In its .clk_prepare, we'll get the prepare_lock
mutex, then we call i2c adapter to operate the regs, to runtime resume
the i2c adapter, we call clk_prepare_enable() which will try to get
the prepare_lock mutex again.
Regards.
>
> AFAICS it seems related to the bus recovery mechanism. Is this what you have in
> mind?
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
next prev parent reply other threads:[~2025-08-20 16:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 15:31 [PATCH 0/2] i2c: designware: Implement atomic transfer suppot Jisheng Zhang
2025-08-20 15:31 ` [PATCH 1/2] i2c: designware: Avoid taking clk_prepare mutex in PM callbacks Jisheng Zhang
2025-08-20 16:05 ` Andy Shevchenko
2025-08-20 16:33 ` Jisheng Zhang [this message]
2025-08-21 12:45 ` Jarkko Nikula
2025-08-21 13:01 ` Andy Shevchenko
2025-08-21 16:32 ` Jisheng Zhang
2025-08-22 9:18 ` Andy Shevchenko
2025-08-22 9:34 ` Andy Shevchenko
2025-08-22 13:56 ` Jisheng Zhang
2025-08-22 23:51 ` Jisheng Zhang
2025-08-20 15:31 ` [PATCH 2/2] i2c: designware: Implement atomic transfer suppot Jisheng Zhang
2025-08-20 17:00 ` Andy Shevchenko
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=aKX4xEYE29JC_g14@xhacker \
--to=jszhang@kernel.org \
--cc=andi.shyti@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jsd@semihalf.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).