* [PATCH v1 1/2] media: rockchip: rkcif: Don't reset the hardware in runtime suspend
[not found] <20261112183208.2688580-1-mehdi.djait@linux.intel.com>
@ 2026-11-12 18:32 ` Mehdi Djait
2026-11-16 10:58 ` Michael Riesch
0 siblings, 1 reply; 4+ messages in thread
From: Mehdi Djait @ 2026-11-12 18:32 UTC (permalink / raw)
To: michael.riesch
Cc: linux-media, paul.elder, daniel, linux-rockchip, Mehdi Djait,
stable
The reset in the runtime suspend also resets the VICAP IOMMU.
When the IOMMU driver accesses the IOMMU registers inside the delay window
between the assert and deassert, e.g. in rk_iommu_zap_lines() to shootdown
IOTLB entries, the system hangs.
Drop the reset and the now unused reset control.
Fixes: f53fb31a3889 ("media: rockchip: add driver for the rockchip camera interface")
Cc: stable@vger.kernel.org
Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
---
.../media/platform/rockchip/rkcif/rkcif-common.h | 1 -
drivers/media/platform/rockchip/rkcif/rkcif-dev.c | 15 ---------------
2 files changed, 16 deletions(-)
diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-common.h b/drivers/media/platform/rockchip/rkcif/rkcif-common.h
index 4d9211ba9bda..38208e8b7b2d 100644
--- a/drivers/media/platform/rockchip/rkcif/rkcif-common.h
+++ b/drivers/media/platform/rockchip/rkcif/rkcif-common.h
@@ -237,7 +237,6 @@ struct rkcif_device {
struct clk_bulk_data clks[RKCIF_CLK_MAX];
unsigned int clks_num;
struct regmap *grf;
- struct reset_control *reset;
void __iomem *base_addr;
struct rkcif_interface interfaces[RKCIF_IF_MAX];
diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-dev.c b/drivers/media/platform/rockchip/rkcif/rkcif-dev.c
index be3a174b9aab..dceabee2ecd6 100644
--- a/drivers/media/platform/rockchip/rkcif/rkcif-dev.c
+++ b/drivers/media/platform/rockchip/rkcif/rkcif-dev.c
@@ -10,7 +10,6 @@
*/
#include <linux/clk.h>
-#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
@@ -18,7 +17,6 @@
#include <linux/of_graph.h>
#include <linux/of_platform.h>
#include <linux/pm_runtime.h>
-#include <linux/reset.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-mc.h>
@@ -201,10 +199,6 @@ static int rkcif_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(dev, ret, "failed to get clocks\n");
- rkcif->reset = devm_reset_control_array_get_exclusive(dev);
- if (IS_ERR(rkcif->reset))
- return PTR_ERR(rkcif->reset);
-
rkcif->grf = syscon_regmap_lookup_by_phandle(dev->of_node,
"rockchip,grf");
if (IS_ERR(rkcif->grf))
@@ -273,15 +267,6 @@ static int rkcif_runtime_suspend(struct device *dev)
{
struct rkcif_device *rkcif = dev_get_drvdata(dev);
- /*
- * Reset CIF (CRU, DMA, FIFOs) to allow a clean resume.
- * Since this resets the IOMMU too, we cannot issue this reset when
- * resuming.
- */
- reset_control_assert(rkcif->reset);
- udelay(5);
- reset_control_deassert(rkcif->reset);
-
clk_bulk_disable_unprepare(rkcif->clks_num, rkcif->clks);
return 0;
--
2.56.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/2] media: rockchip: rkcif: Don't reset the hardware in runtime suspend
2026-11-12 18:32 ` [PATCH v1 1/2] media: rockchip: rkcif: Don't reset the hardware in runtime suspend Mehdi Djait
@ 2026-11-16 10:58 ` Michael Riesch
2026-11-16 14:30 ` Mehdi Djait
0 siblings, 1 reply; 4+ messages in thread
From: Michael Riesch @ 2026-11-16 10:58 UTC (permalink / raw)
To: Mehdi Djait; +Cc: linux-media, paul.elder, daniel, linux-rockchip, stable
Hi Mehdi,
On 11/12/26 19:32, Mehdi Djait wrote:
> The reset in the runtime suspend also resets the VICAP IOMMU.
>
> When the IOMMU driver accesses the IOMMU registers inside the delay window
> between the assert and deassert, e.g. in rk_iommu_zap_lines() to shootdown
> IOTLB entries, the system hangs.
>
> Drop the reset and the now unused reset control.
I agree that the current situation is nothing more than a crude hack
that happened to work in most cases. But I doubt simply removing the
reset is the correct solution. Recently, I saw some downstream patch
that makes the reset a shared one, which seems like the right thing to
do here. What would you think about that?
Best regards,
Michael
>
> Fixes: f53fb31a3889 ("media: rockchip: add driver for the rockchip camera interface")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> ---
> .../media/platform/rockchip/rkcif/rkcif-common.h | 1 -
> drivers/media/platform/rockchip/rkcif/rkcif-dev.c | 15 ---------------
> 2 files changed, 16 deletions(-)
>
> diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-common.h b/drivers/media/platform/rockchip/rkcif/rkcif-common.h
> index 4d9211ba9bda..38208e8b7b2d 100644
> --- a/drivers/media/platform/rockchip/rkcif/rkcif-common.h
> +++ b/drivers/media/platform/rockchip/rkcif/rkcif-common.h
> @@ -237,7 +237,6 @@ struct rkcif_device {
> struct clk_bulk_data clks[RKCIF_CLK_MAX];
> unsigned int clks_num;
> struct regmap *grf;
> - struct reset_control *reset;
> void __iomem *base_addr;
>
> struct rkcif_interface interfaces[RKCIF_IF_MAX];
> diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-dev.c b/drivers/media/platform/rockchip/rkcif/rkcif-dev.c
> index be3a174b9aab..dceabee2ecd6 100644
> --- a/drivers/media/platform/rockchip/rkcif/rkcif-dev.c
> +++ b/drivers/media/platform/rockchip/rkcif/rkcif-dev.c
> @@ -10,7 +10,6 @@
> */
>
> #include <linux/clk.h>
> -#include <linux/delay.h>
> #include <linux/interrupt.h>
> #include <linux/mfd/syscon.h>
> #include <linux/module.h>
> @@ -18,7 +17,6 @@
> #include <linux/of_graph.h>
> #include <linux/of_platform.h>
> #include <linux/pm_runtime.h>
> -#include <linux/reset.h>
>
> #include <media/v4l2-fwnode.h>
> #include <media/v4l2-mc.h>
> @@ -201,10 +199,6 @@ static int rkcif_probe(struct platform_device *pdev)
> if (ret)
> return dev_err_probe(dev, ret, "failed to get clocks\n");
>
> - rkcif->reset = devm_reset_control_array_get_exclusive(dev);
> - if (IS_ERR(rkcif->reset))
> - return PTR_ERR(rkcif->reset);
> -
> rkcif->grf = syscon_regmap_lookup_by_phandle(dev->of_node,
> "rockchip,grf");
> if (IS_ERR(rkcif->grf))
> @@ -273,15 +267,6 @@ static int rkcif_runtime_suspend(struct device *dev)
> {
> struct rkcif_device *rkcif = dev_get_drvdata(dev);
>
> - /*
> - * Reset CIF (CRU, DMA, FIFOs) to allow a clean resume.
> - * Since this resets the IOMMU too, we cannot issue this reset when
> - * resuming.
> - */
> - reset_control_assert(rkcif->reset);
> - udelay(5);
> - reset_control_deassert(rkcif->reset);
> -
> clk_bulk_disable_unprepare(rkcif->clks_num, rkcif->clks);
>
> return 0;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/2] media: rockchip: rkcif: Don't reset the hardware in runtime suspend
2026-11-16 10:58 ` Michael Riesch
@ 2026-11-16 14:30 ` Mehdi Djait
2026-11-17 9:09 ` Mehdi Djait
0 siblings, 1 reply; 4+ messages in thread
From: Mehdi Djait @ 2026-11-16 14:30 UTC (permalink / raw)
To: Michael Riesch; +Cc: linux-media, paul.elder, daniel, linux-rockchip, stable
Hi Michael,
On Mon, Nov 16, 2026 at 11:58:35AM +0100, Michael Riesch wrote:
> Hi Mehdi,
>
> On 11/12/26 19:32, Mehdi Djait wrote:
> > The reset in the runtime suspend also resets the VICAP IOMMU.
> >
> > When the IOMMU driver accesses the IOMMU registers inside the delay window
> > between the assert and deassert, e.g. in rk_iommu_zap_lines() to shootdown
> > IOTLB entries, the system hangs.
> >
> > Drop the reset and the now unused reset control.
>
> I agree that the current situation is nothing more than a crude hack
> that happened to work in most cases. But I doubt simply removing the
> reset is the correct solution. Recently, I saw some downstream patch
> that makes the reset a shared one, which seems like the right thing to
> do here. What would you think about that?
Do you have a link for these patches ?
I also agree that this patch will not be the solution that will go in
but the situation needs to change.
The VICAP_GLB_CTRL register does expose this:
reset the VICAP(except MMU/AXI MASTER/REG FILE)
The Rockchip-bsp kernel exports the disable and enable functions of the
iommu driver and calls them in the rkcif driver, see:
https://github.com/rockchip-linux/kernel/blob/develop-6.1/drivers/media/platform/rockchip/cif/capture.c#L7269
--
Kind regards
Mehdi Djait
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/2] media: rockchip: rkcif: Don't reset the hardware in runtime suspend
2026-11-16 14:30 ` Mehdi Djait
@ 2026-11-17 9:09 ` Mehdi Djait
0 siblings, 0 replies; 4+ messages in thread
From: Mehdi Djait @ 2026-11-17 9:09 UTC (permalink / raw)
To: Michael Riesch; +Cc: linux-media, paul.elder, daniel, linux-rockchip, stable
On Mon, Nov 16, 2026 at 03:30:33PM +0100, Mehdi Djait wrote:
> Hi Michael,
>
> On Mon, Nov 16, 2026 at 11:58:35AM +0100, Michael Riesch wrote:
> > Hi Mehdi,
> >
> > On 11/12/26 19:32, Mehdi Djait wrote:
> > > The reset in the runtime suspend also resets the VICAP IOMMU.
> > >
> > > When the IOMMU driver accesses the IOMMU registers inside the delay window
> > > between the assert and deassert, e.g. in rk_iommu_zap_lines() to shootdown
> > > IOTLB entries, the system hangs.
> > >
> > > Drop the reset and the now unused reset control.
> >
> > I agree that the current situation is nothing more than a crude hack
> > that happened to work in most cases. But I doubt simply removing the
> > reset is the correct solution. Recently, I saw some downstream patch
> > that makes the reset a shared one, which seems like the right thing to
> > do here. What would you think about that?
>
> Do you have a link for these patches ?
>
> I also agree that this patch will not be the solution that will go in
> but the situation needs to change.
>
> The VICAP_GLB_CTRL register does expose this:
> reset the VICAP(except MMU/AXI MASTER/REG FILE)
>
> The Rockchip-bsp kernel exports the disable and enable functions of the
> iommu driver and calls them in the rkcif driver, see:
> https://github.com/rockchip-linux/kernel/blob/develop-6.1/drivers/media/platform/rockchip/cif/capture.c#L7269
>
I mean, I of course don't think this is a solution to be considered, but
this is what I found for now..
--
Kind regards
Mehdi Djait
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-17 9:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261112183208.2688580-1-mehdi.djait@linux.intel.com>
2026-11-12 18:32 ` [PATCH v1 1/2] media: rockchip: rkcif: Don't reset the hardware in runtime suspend Mehdi Djait
2026-11-16 10:58 ` Michael Riesch
2026-11-16 14:30 ` Mehdi Djait
2026-11-17 9:09 ` Mehdi Djait
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox