fbdev: goldfishfb: fail pan display on base-update timeout

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>
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
Pengpeng Hou 2026-06-25 11:01:02 +08:00 committed by Helge Deller
parent 8fdc8c2057
commit a11aa7b850

View File

@ -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: