From ce38cac48209d270d07fd6d1a8e94446b37abcd5 Mon Sep 17 00:00:00 2001 From: Guido Guenther Date: Sun, 30 Jul 2006 03:04:21 -0700 Subject: [PATCH] rivafb/nvidiafb: race between register_framebuffer and *_bl_init Since we now use the generic backlight infrastructure, I think we need to call rivafb_bl_init before calling register_framebuffer since otherwise rivafb_bl_init might race with the framebuffer layer already opening the device and setting up the video mode. In this case we might end up with a not yet fully intialized backlight (info->bl_dev still NULL) when calling riva_bl_set_power via rivafb_set_par/rivafb_load_video_mode and the kernel dies without any further notice during boot. This fixes booting current git on a PB 6,1. In this case radeonfb/atyfb would be affected too - I can fix that too but don't have any hardware to test this on. Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/nvidia/nvidia.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/video/nvidia') diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index d0ca0d89dd2..d4f85011787 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c @@ -1299,20 +1299,19 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd, nvidia_save_vga(par, &par->SavedReg); + pci_set_drvdata(pd, info); + nvidia_bl_init(par); if (register_framebuffer(info) < 0) { printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); goto err_out_iounmap_fb; } - pci_set_drvdata(pd, info); printk(KERN_INFO PFX "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", info->fix.id, par->FbMapSize / (1024 * 1024), info->fix.smem_start); - nvidia_bl_init(par); - NVTRACE_LEAVE(); return 0; -- cgit v1.2.3