* [PATCH] i2c: microchip-corei2c: remove clients before disabling clock
@ 2026-11-29 12:49 Jiawen Liu
2026-12-01 18:58 ` Conor Dooley
0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-11-29 12:49 UTC (permalink / raw)
To: Conor Dooley, Daire McNamara, Andi Shyti
Cc: linux-riscv, linux-i2c, linux-kernel
mchp_corei2c_remove() disables the controller clock before removing the
adapter. Adapter deletion synchronously invokes bound client remove
callbacks, and those callbacks can issue transfers through their existing
client handle.
Keep the controller clock enabled while clients are removed, and disable
it after client teardown has completed.
Fixes: 64a6f1c4987e ("i2c: add support for microchip fpga i2c controllers")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
drivers/i2c/busses/i2c-microchip-corei2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-microchip-corei2c.c b/drivers/i2c/busses/i2c-microchip-corei2c.c
index e5fa28f20228c..7e772893f4a4b 100644
--- a/drivers/i2c/busses/i2c-microchip-corei2c.c
+++ b/drivers/i2c/busses/i2c-microchip-corei2c.c
@@ -620,8 +620,8 @@ static void mchp_corei2c_remove(struct platform_device *pdev)
{
struct mchp_corei2c_dev *idev = platform_get_drvdata(pdev);
- clk_disable_unprepare(idev->i2c_clk);
i2c_del_adapter(&idev->adapter);
+ clk_disable_unprepare(idev->i2c_clk);
}
static const struct of_device_id mchp_corei2c_of_match[] = {
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: microchip-corei2c: remove clients before disabling clock
2026-11-29 12:49 [PATCH] i2c: microchip-corei2c: remove clients before disabling clock Jiawen Liu
@ 2026-12-01 18:58 ` Conor Dooley
0 siblings, 0 replies; 2+ messages in thread
From: Conor Dooley @ 2026-12-01 18:58 UTC (permalink / raw)
To: Jiawen Liu
Cc: Conor Dooley, Daire McNamara, Andi Shyti, linux-riscv, linux-i2c,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]
On Sun, Nov 29, 2026 at 04:49:59PM +0400, Jiawen Liu wrote:
> mchp_corei2c_remove() disables the controller clock before removing the
> adapter. Adapter deletion synchronously invokes bound client remove
> callbacks, and those callbacks can issue transfers through their existing
> client handle.
>
> Keep the controller clock enabled while clients are removed, and disable
> it after client teardown has completed.
>
> Fixes: 64a6f1c4987e ("i2c: add support for microchip fpga i2c controllers")
> Signed-off-by: Jiawen Liu <1298662399@qq.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Cheers,
Conor.
> ---
> drivers/i2c/busses/i2c-microchip-corei2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-microchip-corei2c.c b/drivers/i2c/busses/i2c-microchip-corei2c.c
> index e5fa28f20228c..7e772893f4a4b 100644
> --- a/drivers/i2c/busses/i2c-microchip-corei2c.c
> +++ b/drivers/i2c/busses/i2c-microchip-corei2c.c
> @@ -620,8 +620,8 @@ static void mchp_corei2c_remove(struct platform_device *pdev)
> {
> struct mchp_corei2c_dev *idev = platform_get_drvdata(pdev);
>
> - clk_disable_unprepare(idev->i2c_clk);
> i2c_del_adapter(&idev->adapter);
> + clk_disable_unprepare(idev->i2c_clk);
> }
>
> static const struct of_device_id mchp_corei2c_of_match[] = {
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 18:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 12:49 [PATCH] i2c: microchip-corei2c: remove clients before disabling clock Jiawen Liu
2026-12-01 18:58 ` Conor Dooley
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®