From: Cong Nguyen <congnt264@gmail.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] i2c: qup: do not disable the clocks twice in remove()
Date: Wed, 25 Nov 2026 20:44:58 +0700 [thread overview]
Message-ID: <20261125134458.2704674-1-congnt264@gmail.com> (raw)
qup_i2c_remove() disables the clocks unconditionally. If the controller
is already runtime suspended, the suspend callback has disabled them, so
they are disabled a second time.
It also does this before i2c_del_adapter(), so transfers from client
drivers in their remove() run with the clocks off.
Delete the adapter and disable runtime PM first, then disable the clocks
only if the device is not runtime suspended.
Fixes: 10c5a8425968 ("i2c: qup: New bus driver for the Qualcomm QUP I2C controller")
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
drivers/i2c/busses/i2c-qup.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 731bce9f9a92..f61ef2d3a10d 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1960,15 +1960,17 @@ static void qup_i2c_remove(struct platform_device *pdev)
{
struct qup_i2c_dev *qup = platform_get_drvdata(pdev);
+ i2c_del_adapter(&qup->adap);
+ pm_runtime_disable(qup->dev);
+
if (qup->is_dma) {
dma_release_channel(qup->btx.dma);
dma_release_channel(qup->brx.dma);
}
disable_irq(qup->irq);
- qup_i2c_disable_clocks(qup);
- i2c_del_adapter(&qup->adap);
- pm_runtime_disable(qup->dev);
+ if (!pm_runtime_status_suspended(qup->dev))
+ qup_i2c_disable_clocks(qup);
pm_runtime_set_suspended(qup->dev);
}
--
2.25.1
reply other threads:[~2026-11-25 13:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261125134458.2704674-1-congnt264@gmail.com \
--to=congnt264@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®