* [PATCH v3] i3c: master: dw-i3c: Fix missing reset assertion in remove() callback
@ 2026-03-20 14:18 Felix Gu
2026-03-20 14:43 ` Frank Li
2026-04-12 14:39 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Felix Gu @ 2026-03-20 14:18 UTC (permalink / raw)
To: Alexandre Belloni, Frank Li, Philipp Zabel, Aniket
Cc: linux-i3c, linux-kernel, Felix Gu
The reset line acquired during probe is currently left deasserted when
the driver is unbound.
Switch to devm_reset_control_get_optional_exclusive_deasserted() to
ensure the reset is automatically re-asserted by the devres core when
the driver is removed.
Fixes: 62fe9d06f570 ("i3c: dw: Add power management support")
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
Changes in v3:
- Fix the format to pass checkpatch --strict.
- Link to v2: https://lore.kernel.org/r/20260317-dw-i3c-v2-1-fa57e6394b1d@gmail.com
Changes in v2:
- Switch to devm_reset_control_get_optional_exclusive_deasserted()
suggested by Philipp Zabel.
- Link to v1: https://lore.kernel.org/r/20260316-dw-i3c-v1-1-ab41904fc780@gmail.com
---
drivers/i3c/master/dw-i3c-master.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index d87bde3f7700..d104807cf74e 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1606,13 +1606,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->pclk))
return PTR_ERR(master->pclk);
- master->core_rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
- "core_rst");
+ master->core_rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
+ "core_rst");
if (IS_ERR(master->core_rst))
return PTR_ERR(master->core_rst);
- reset_control_deassert(master->core_rst);
-
spin_lock_init(&master->xferqueue.lock);
INIT_LIST_HEAD(&master->xferqueue.list);
@@ -1624,7 +1622,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
dw_i3c_master_irq_handler, 0,
dev_name(&pdev->dev), master);
if (ret)
- goto err_assert_rst;
+ return ret;
platform_set_drvdata(pdev, master);
@@ -1671,9 +1669,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
-err_assert_rst:
- reset_control_assert(master->core_rst);
-
return ret;
}
EXPORT_SYMBOL_GPL(dw_i3c_common_probe);
---
base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900
change-id: 20260316-dw-i3c-e7a36bc90682
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] i3c: master: dw-i3c: Fix missing reset assertion in remove() callback
2026-03-20 14:18 [PATCH v3] i3c: master: dw-i3c: Fix missing reset assertion in remove() callback Felix Gu
@ 2026-03-20 14:43 ` Frank Li
2026-04-12 14:39 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-03-20 14:43 UTC (permalink / raw)
To: Felix Gu
Cc: Alexandre Belloni, Philipp Zabel, Aniket, linux-i3c, linux-kernel
On Fri, Mar 20, 2026 at 10:18:02PM +0800, Felix Gu wrote:
> The reset line acquired during probe is currently left deasserted when
> the driver is unbound.
>
> Switch to devm_reset_control_get_optional_exclusive_deasserted() to
> ensure the reset is automatically re-asserted by the devres core when
> the driver is removed.
>
> Fixes: 62fe9d06f570 ("i3c: dw: Add power management support")
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Changes in v3:
> - Fix the format to pass checkpatch --strict.
> - Link to v2: https://lore.kernel.org/r/20260317-dw-i3c-v2-1-fa57e6394b1d@gmail.com
>
> Changes in v2:
> - Switch to devm_reset_control_get_optional_exclusive_deasserted()
> suggested by Philipp Zabel.
> - Link to v1: https://lore.kernel.org/r/20260316-dw-i3c-v1-1-ab41904fc780@gmail.com
> ---
> drivers/i3c/master/dw-i3c-master.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index d87bde3f7700..d104807cf74e 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1606,13 +1606,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
> if (IS_ERR(master->pclk))
> return PTR_ERR(master->pclk);
>
> - master->core_rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
> - "core_rst");
> + master->core_rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
> + "core_rst");
> if (IS_ERR(master->core_rst))
> return PTR_ERR(master->core_rst);
>
> - reset_control_deassert(master->core_rst);
> -
> spin_lock_init(&master->xferqueue.lock);
> INIT_LIST_HEAD(&master->xferqueue.list);
>
> @@ -1624,7 +1622,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
> dw_i3c_master_irq_handler, 0,
> dev_name(&pdev->dev), master);
> if (ret)
> - goto err_assert_rst;
> + return ret;
>
> platform_set_drvdata(pdev, master);
>
> @@ -1671,9 +1669,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
> pm_runtime_set_suspended(&pdev->dev);
> pm_runtime_dont_use_autosuspend(&pdev->dev);
>
> -err_assert_rst:
> - reset_control_assert(master->core_rst);
> -
> return ret;
> }
> EXPORT_SYMBOL_GPL(dw_i3c_common_probe);
>
> ---
> base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900
> change-id: 20260316-dw-i3c-e7a36bc90682
>
> Best regards,
> --
> Felix Gu <ustc.gu@gmail.com>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] i3c: master: dw-i3c: Fix missing reset assertion in remove() callback
2026-03-20 14:18 [PATCH v3] i3c: master: dw-i3c: Fix missing reset assertion in remove() callback Felix Gu
2026-03-20 14:43 ` Frank Li
@ 2026-04-12 14:39 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2026-04-12 14:39 UTC (permalink / raw)
To: Frank Li, Philipp Zabel, Aniket, Felix Gu; +Cc: linux-i3c, linux-kernel
On Fri, 20 Mar 2026 22:18:02 +0800, Felix Gu wrote:
> The reset line acquired during probe is currently left deasserted when
> the driver is unbound.
>
> Switch to devm_reset_control_get_optional_exclusive_deasserted() to
> ensure the reset is automatically re-asserted by the devres core when
> the driver is removed.
>
> [...]
Applied, thanks!
[1/1] i3c: master: dw-i3c: Fix missing reset assertion in remove() callback
https://git.kernel.org/i3c/c/bef1eef66718
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-12 14:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-20 14:18 [PATCH v3] i3c: master: dw-i3c: Fix missing reset assertion in remove() callback Felix Gu
2026-03-20 14:43 ` Frank Li
2026-04-12 14:39 ` Alexandre Belloni
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®