* [PATCH] gpu: ipu-pre: handle clock enable failures
@ 2026-08-18 13:18 Jiawen Liu
0 siblings, 0 replies; only message in thread
From: Jiawen Liu @ 2026-08-18 13:18 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Simona Vetter, dri-devel, linux-kernel
Check clock-enable failures after a manually managed allocation.
Release the earlier allocation and return the original clock error when
probe cannot enable the clock.
Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
--- a/drivers/gpu/ipu-v3/ipu-pre.c
+++ b/drivers/gpu/ipu-v3/ipu-pre.c
@@ -311,6 +311,7 @@
{
struct device *dev = &pdev->dev;
struct ipu_pre *pre;
+ int ret;
pre = devm_kzalloc(dev, sizeof(*pre), GFP_KERNEL);
if (!pre)
@@ -339,7 +340,12 @@
if (!pre->buffer_virt)
return -ENOMEM;
- clk_prepare_enable(pre->clk_axi);
+ ret = clk_prepare_enable(pre->clk_axi);
+ if (ret) {
+ gen_pool_free(pre->iram, (unsigned long)pre->buffer_virt,
+ IPU_PRE_MAX_WIDTH * IPU_PRE_NUM_SCANLINES * 4);
+ return ret;
+ }
pre->dev = dev;
platform_set_drvdata(pdev, pre);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-18 13:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-18 13:18 [PATCH] gpu: ipu-pre: handle clock enable failures Jiawen Liu
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®