* [PATCH] i2c: qup: do not disable the clocks twice in remove()
@ 2026-11-25 13:44 Cong Nguyen
0 siblings, 0 replies; only message in thread
From: Cong Nguyen @ 2026-11-25 13:44 UTC (permalink / raw)
To: Andi Shyti; +Cc: linux-arm-msm, linux-i2c, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 13:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 13:44 [PATCH] i2c: qup: do not disable the clocks twice in remove() Cong Nguyen
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®