Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] fbdev: goldfishfb: fail pan display on base-update timeout
@ 2026-06-25  3:01 Pengpeng Hou
  2026-06-25 16:29 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-06-25  3:01 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, linux-kernel, pengpeng

goldfish_fb_pan_display() waits for the device to acknowledge the new
framebuffer base, but it only logs a timeout and still reports success.
The probe path also ignores the initial pan-display result before
registering the framebuffer.

Return -ETIMEDOUT when the base-update acknowledgment does not arrive,
and propagate that error from the initial probe-time base update before
the framebuffer is published.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/video/fbdev/goldfishfb.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
index c9871281bc1d..e5d79886ea66 100644
--- a/drivers/video/fbdev/goldfishfb.c
+++ b/drivers/video/fbdev/goldfishfb.c
@@ -138,10 +138,12 @@ static int goldfish_fb_pan_display(struct fb_var_screeninfo *var,
 	writel(fb->fb.fix.smem_start + fb->fb.var.xres * 2 * var->yoffset,
 						fb->reg_base + FB_SET_BASE);
 	spin_unlock_irqrestore(&fb->lock, irq_flags);
-	wait_event_timeout(fb->wait,
-			fb->base_update_count != base_update_count, HZ / 15);
-	if (fb->base_update_count == base_update_count)
+	if (!wait_event_timeout(fb->wait,
+				fb->base_update_count != base_update_count,
+				HZ / 15)) {
 		pr_err("%s: timeout waiting for base update\n", __func__);
+		return -ETIMEDOUT;
+	}
 	return 0;
 }
 
@@ -251,7 +253,9 @@ static int goldfish_fb_probe(struct platform_device *pdev)
 		goto err_request_irq_failed;
 
 	writel(FB_INT_BASE_UPDATE_DONE, fb->reg_base + FB_INT_ENABLE);
-	goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */
+	ret = goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */
+	if (ret)
+		goto err_pan_display_failed;
 
 	ret = register_framebuffer(&fb->fb);
 	if (ret)
@@ -259,6 +263,7 @@ static int goldfish_fb_probe(struct platform_device *pdev)
 	return 0;
 
 err_register_framebuffer_failed:
+err_pan_display_failed:
 	free_irq(fb->irq, fb);
 err_request_irq_failed:
 err_fb_set_var_failed:

base-commit: 502d801f0ab03e4f32f9a33d203154ce84887921
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fbdev: goldfishfb: fail pan display on base-update timeout
  2026-06-25  3:01 [PATCH] fbdev: goldfishfb: fail pan display on base-update timeout Pengpeng Hou
@ 2026-06-25 16:29 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2026-06-25 16:29 UTC (permalink / raw)
  To: Pengpeng Hou; +Cc: linux-fbdev, dri-devel, linux-kernel

On 6/25/26 05:01, Pengpeng Hou wrote:
> goldfish_fb_pan_display() waits for the device to acknowledge the new
> framebuffer base, but it only logs a timeout and still reports success.
> The probe path also ignores the initial pan-display result before
> registering the framebuffer.
> 
> Return -ETIMEDOUT when the base-update acknowledgment does not arrive,
> and propagate that error from the initial probe-time base update before
> the framebuffer is published.
> 
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
>   drivers/video/fbdev/goldfishfb.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)

applied.

Thanks!
Helge

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-25 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25  3:01 [PATCH] fbdev: goldfishfb: fail pan display on base-update timeout Pengpeng Hou
2026-06-25 16:29 ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox