From: Jiawen Liu <1298662399@qq.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH] gpu: ipu-pre: handle clock enable failures
Date: Tue, 18 Aug 2026 17:18:05 +0400 [thread overview]
Message-ID: <tencent_90AF2A01EBA98B24211F74B39C3200FD7F09@qq.com> (raw)
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);
reply other threads:[~2026-08-18 13:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_90AF2A01EBA98B24211F74B39C3200FD7F09@qq.com \
--to=1298662399@qq.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®