Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fbdev: atafb: Fix broken frame buffer after kexec

On Falcon, Atari frame buffer initialization relies on preprogrammed
register values. These register values are changed to blank the
console.

Hence when using kexec to boot into a new kernel while the console is
blanked, the new kernel cannot determine the current video
configuration, and the Atari frame buffer driver fails to initialize:

atafb: phys_screen_base 6ce000 screen_len 4096

Fix this by doing a straight-forward conversion of the driver to a
platform device driver, and adding a shutdown handler that unblanks the
display.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Geert Uytterhoeven and committed by
Bartlomiej Zolnierkiewicz
80cf9635 577eabb2

+30 -4
+30 -4
drivers/video/fbdev/atafb.c
··· 54 54 #include <linux/delay.h> 55 55 #include <linux/init.h> 56 56 #include <linux/interrupt.h> 57 + #include <linux/platform_device.h> 57 58 58 59 #include <asm/setup.h> 59 60 #include <linux/uaccess.h> ··· 3073 3072 return 0; 3074 3073 } 3075 3074 3076 - int __init atafb_init(void) 3075 + static int __init atafb_probe(struct platform_device *pdev) 3077 3076 { 3078 3077 int pad, detected_mode, error; 3079 3078 unsigned int defmode = 0; ··· 3084 3083 return -ENODEV; 3085 3084 atafb_setup(option); 3086 3085 printk("atafb_init: start\n"); 3087 - 3088 - if (!MACH_IS_ATARI) 3089 - return -ENODEV; 3090 3086 3091 3087 do { 3092 3088 #ifdef ATAFB_EXT ··· 3243 3245 3244 3246 /* TODO: This driver cannot be unloaded yet */ 3245 3247 return 0; 3248 + } 3249 + 3250 + static void atafb_shutdown(struct platform_device *pdev) 3251 + { 3252 + /* Unblank before kexec */ 3253 + if (fbhw->blank) 3254 + fbhw->blank(0); 3255 + } 3256 + 3257 + static struct platform_driver atafb_driver = { 3258 + .shutdown = atafb_shutdown, 3259 + .driver = { 3260 + .name = "atafb", 3261 + }, 3262 + }; 3263 + 3264 + static int __init atafb_init(void) 3265 + { 3266 + struct platform_device *pdev; 3267 + 3268 + if (!MACH_IS_ATARI) 3269 + return -ENODEV; 3270 + 3271 + pdev = platform_device_register_simple("atafb", -1, NULL, 0); 3272 + if (IS_ERR(pdev)) 3273 + return PTR_ERR(pdev); 3274 + 3275 + return platform_driver_probe(&atafb_driver, atafb_probe); 3246 3276 } 3247 3277 3248 3278 device_initcall(atafb_init);