diff options
author | Guido Guenther <agx@sigxcpu.org> | 2006-07-30 06:04:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-31 16:28:45 -0400 |
commit | ce38cac48209d270d07fd6d1a8e94446b37abcd5 (patch) | |
tree | c7840212a8dbc2002734e20ed2e3b0e8f63c857c /drivers | |
parent | b1367d2a2817e6199092b43fe01c1eed3374c4e4 (diff) |
[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" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/nvidia/nvidia.c | 5 | ||||
-rw-r--r-- | drivers/video/riva/fbdev.c | 7 |
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index d0ca0d89dd2a..d4f850117874 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, | |||
1299 | 1299 | ||
1300 | nvidia_save_vga(par, &par->SavedReg); | 1300 | nvidia_save_vga(par, &par->SavedReg); |
1301 | 1301 | ||
1302 | pci_set_drvdata(pd, info); | ||
1303 | nvidia_bl_init(par); | ||
1302 | if (register_framebuffer(info) < 0) { | 1304 | if (register_framebuffer(info) < 0) { |
1303 | printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); | 1305 | printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); |
1304 | goto err_out_iounmap_fb; | 1306 | goto err_out_iounmap_fb; |
1305 | } | 1307 | } |
1306 | 1308 | ||
1307 | pci_set_drvdata(pd, info); | ||
1308 | 1309 | ||
1309 | printk(KERN_INFO PFX | 1310 | printk(KERN_INFO PFX |
1310 | "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", | 1311 | "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", |
1311 | info->fix.id, | 1312 | info->fix.id, |
1312 | par->FbMapSize / (1024 * 1024), info->fix.smem_start); | 1313 | par->FbMapSize / (1024 * 1024), info->fix.smem_start); |
1313 | 1314 | ||
1314 | nvidia_bl_init(par); | ||
1315 | |||
1316 | NVTRACE_LEAVE(); | 1315 | NVTRACE_LEAVE(); |
1317 | return 0; | 1316 | return 0; |
1318 | 1317 | ||
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index 33dddbae5420..76fc9d355eb7 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c | |||
@@ -2132,6 +2132,9 @@ static int __devinit rivafb_probe(struct pci_dev *pd, | |||
2132 | 2132 | ||
2133 | fb_destroy_modedb(info->monspecs.modedb); | 2133 | fb_destroy_modedb(info->monspecs.modedb); |
2134 | info->monspecs.modedb = NULL; | 2134 | info->monspecs.modedb = NULL; |
2135 | |||
2136 | pci_set_drvdata(pd, info); | ||
2137 | riva_bl_init(info->par); | ||
2135 | ret = register_framebuffer(info); | 2138 | ret = register_framebuffer(info); |
2136 | if (ret < 0) { | 2139 | if (ret < 0) { |
2137 | printk(KERN_ERR PFX | 2140 | printk(KERN_ERR PFX |
@@ -2139,8 +2142,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd, | |||
2139 | goto err_iounmap_screen_base; | 2142 | goto err_iounmap_screen_base; |
2140 | } | 2143 | } |
2141 | 2144 | ||
2142 | pci_set_drvdata(pd, info); | ||
2143 | |||
2144 | printk(KERN_INFO PFX | 2145 | printk(KERN_INFO PFX |
2145 | "PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n", | 2146 | "PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n", |
2146 | info->fix.id, | 2147 | info->fix.id, |
@@ -2148,8 +2149,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd, | |||
2148 | info->fix.smem_len / (1024 * 1024), | 2149 | info->fix.smem_len / (1024 * 1024), |
2149 | info->fix.smem_start); | 2150 | info->fix.smem_start); |
2150 | 2151 | ||
2151 | riva_bl_init(info->par); | ||
2152 | |||
2153 | NVTRACE_LEAVE(); | 2152 | NVTRACE_LEAVE(); |
2154 | return 0; | 2153 | return 0; |
2155 | 2154 | ||