From 5fad4e8ff717c94aa1f18b463d4dc2f9ef91aa99 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sat, 14 Nov 2026 08:11:46 +1100 Subject: [PATCH 1/2] media: apple/ave: let genpd gate venc_sys for the DMA fault reporter The AVE auxiliary DMA fault reporter lives in the venc_sys power domain, which the encoder and its DARTs gate whenever the codec is idle. The driver requested its shared fault interrupt but never touched runtime PM, so once the device bound genpd counted it as active and kept ps_venc_sys powered for good, defeating the encoder's idle power saving. Enable runtime PM and leave the reporter runtime-suspended. A DMA fault can only be raised, and the interrupt it shares with the codec DARTs only asserted, while the encoder is running and the domain is therefore powered, so the fault handler always reads registers in a powered domain. The domain is live at bind (the codec DARTs are already up), so start active and drop the vote once the handler is installed, letting genpd gate venc_sys with the rest of the encoder. Signed-off-by: Ryan Murray --- .../media/platform/apple/ave/apple-ave-dma.c | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/apple/ave/apple-ave-dma.c b/drivers/media/platform/apple/ave/apple-ave-dma.c index 8483045031c39..4a370086d1323 100644 --- a/drivers/media/platform/apple/ave/apple-ave-dma.c +++ b/drivers/media/platform/apple/ave/apple-ave-dma.c @@ -6,6 +6,7 @@ #include #include #include +#include #define AVE_DMA_ERROR_STATUS 0x40 #define AVE_DMA_ERROR_PENDING BIT(31) @@ -51,7 +52,7 @@ static irqreturn_t apple_ave_dma_irq(int irq, void *data) static int apple_ave_dma_probe(struct platform_device *pdev) { struct apple_ave_dma *dma; - int irq; + int irq, ret; dma = devm_kzalloc(&pdev->dev, sizeof(*dma), GFP_KERNEL); if (!dma) @@ -66,8 +67,35 @@ static int apple_ave_dma_probe(struct platform_device *pdev) if (irq < 0) return irq; - return devm_request_irq(&pdev->dev, irq, apple_ave_dma_irq, - IRQF_SHARED, dev_name(&pdev->dev), dma); + /* + * This reporter sits in the venc_sys power domain, which the encoder + * and its DARTs gate whenever the codec is idle. Enable runtime PM and + * leave it runtime-suspended so it does not vote the domain on; without + * this genpd treats the bound device as active and pins ps_venc_sys + * forever, defeating the encoder's idle power saving. A DMA fault can + * only be raised - and the interrupt it shares with the codec DARTs + * only asserted - while the encoder runs, so the handler always touches + * registers in a powered domain. The domain is live at bind (the codec + * DARTs are already up), so start active and drop the vote once the + * handler is in place. + */ + pm_runtime_get_noresume(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) { + pm_runtime_put_noidle(&pdev->dev); + return ret; + } + + ret = devm_request_irq(&pdev->dev, irq, apple_ave_dma_irq, + IRQF_SHARED, dev_name(&pdev->dev), dma); + if (ret) { + pm_runtime_put_noidle(&pdev->dev); + return ret; + } + + pm_runtime_put(&pdev->dev); + return 0; } static const struct of_device_id apple_ave_dma_of_match[] = { From 65a52197d1b89d5eb9867f5c4c39d4b8996d010b Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sat, 14 Nov 2026 08:11:46 +1100 Subject: [PATCH 2/2] arm64: dts: apple: t6000: enable the AVE DMA fault reporter Now that apple-ave-dma participates in runtime PM and no longer pins ps_venc_sys, enable the auxiliary DMA fault reporter on T6000 alongside the video encoder and the DARTs it shares the venc_sys domain and fault interrupt with. T6001 and T6002 keep theirs disabled until the binding is proven on that hardware. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6000.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6000.dtsi b/arch/arm64/boot/dts/apple/t6000.dtsi index 07ae672a27c96..39720faed4b0e 100644 --- a/arch/arm64/boot/dts/apple/t6000.dtsi +++ b/arch/arm64/boot/dts/apple/t6000.dtsi @@ -190,6 +190,11 @@ status = "okay"; }; +/* The auxiliary DMA fault reporter shares venc_sys with the codec DARTs. */ +&ave0_dma { + status = "okay"; +}; + &apr0_dart { status = "okay"; };