Skip to content

Commit c192859

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 b0cdbc6 commit c192859

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
@@ -1554,13 +1554,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
15541554
if (IS_ERR(master->pclk))
15551555
return PTR_ERR(master->pclk);
15561556

1557-
master->core_rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
1558-
"core_rst");
1557+
master->core_rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
1558+
"core_rst");
15591559
if (IS_ERR(master->core_rst))
15601560
return PTR_ERR(master->core_rst);
15611561

1562-
reset_control_deassert(master->core_rst);
1563-
15641562
spin_lock_init(&master->xferqueue.lock);
15651563
INIT_LIST_HEAD(&master->xferqueue.list);
15661564

@@ -1572,7 +1570,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
15721570
dw_i3c_master_irq_handler, 0,
15731571
dev_name(&pdev->dev), master);
15741572
if (ret)
1575-
goto err_assert_rst;
1573+
return ret;
15761574

15771575
platform_set_drvdata(pdev, master);
15781576

@@ -1610,9 +1608,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
16101608
pm_runtime_set_suspended(&pdev->dev);
16111609
pm_runtime_dont_use_autosuspend(&pdev->dev);
16121610

1613-
err_assert_rst:
1614-
reset_control_assert(master->core_rst);
1615-
16161611
return ret;
16171612
}
16181613
EXPORT_SYMBOL_GPL(dw_i3c_common_probe);

0 commit comments

Comments
 (0)