Skip to content

Commit 2fc602c

Browse files
outman119gregkh
authored andcommitted
i3c: master: dw-i3c: Fix missing reset assertion in remove() callback
[ Upstream commit bef1eef ] 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: 62fe9d0 ("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> Link: https://patch.msgid.link/20260320-dw-i3c-v3-1-477040c2e3f5@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 350e275 commit 2fc602c

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

drivers/i3c/master/dw-i3c-master.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,13 +1566,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
15661566
if (IS_ERR(master->pclk))
15671567
return PTR_ERR(master->pclk);
15681568

1569-
master->core_rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
1570-
"core_rst");
1569+
master->core_rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
1570+
"core_rst");
15711571
if (IS_ERR(master->core_rst))
15721572
return PTR_ERR(master->core_rst);
15731573

1574-
reset_control_deassert(master->core_rst);
1575-
15761574
spin_lock_init(&master->xferqueue.lock);
15771575
INIT_LIST_HEAD(&master->xferqueue.list);
15781576

@@ -1584,7 +1582,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
15841582
dw_i3c_master_irq_handler, 0,
15851583
dev_name(&pdev->dev), master);
15861584
if (ret)
1587-
goto err_assert_rst;
1585+
return ret;
15881586

15891587
platform_set_drvdata(pdev, master);
15901588

@@ -1620,9 +1618,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
16201618
pm_runtime_set_suspended(&pdev->dev);
16211619
pm_runtime_dont_use_autosuspend(&pdev->dev);
16221620

1623-
err_assert_rst:
1624-
reset_control_assert(master->core_rst);
1625-
16261621
return ret;
16271622
}
16281623
EXPORT_SYMBOL_GPL(dw_i3c_common_probe);

0 commit comments

Comments
 (0)