All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vga16fb: refuse to load in face of other driver controlling primary card
@ 2010-07-20 19:19 ` Marcin Slusarz
  0 siblings, 0 replies; 15+ messages in thread
From: Marcin Slusarz @ 2010-07-20 19:19 UTC (permalink / raw)
  To: LKML, Andrew Morton; +Cc: linux-fbdev, nouveau

We don't want vga16fb to mess with hardware initialized by other driver.
Detect it and refuse to load.
It fixes nouveau interrupt storm on some machines.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
---
 drivers/video/vga16fb.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 28ccab4..4505446 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -22,6 +22,7 @@
 #include <linux/platform_device.h>
 #include <linux/screen_info.h>
 
+#include <asm/fb.h>
 #include <asm/io.h>
 #include <video/vga.h>
 
@@ -1415,7 +1416,7 @@ static struct platform_device *vga16fb_device;
 
 static int __init vga16fb_init(void)
 {
-	int ret;
+	int ret, i;
 #ifndef MODULE
 	char *option = NULL;
 
@@ -1424,6 +1425,16 @@ static int __init vga16fb_init(void)
 
 	vga16fb_setup(option);
 #endif
+	for (i = 0 ; i < FB_MAX; i++) {
+		if (!registered_fb[i])
+			continue;
+		if (fb_is_primary_device(registered_fb[i])) {
+			printk(KERN_INFO "vga16fb: %s is driving the primary card, refusing to load\n",
+				registered_fb[i]->fix.id);
+			return -EBUSY;
+		}
+	}
+
 	ret = platform_driver_register(&vga16fb_driver);
 
 	if (!ret) {
-- 
1.7.1



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

end of thread, other threads:[~2010-07-25 11:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-20 19:19 [PATCH] vga16fb: refuse to load in face of other driver controlling primary card Marcin Slusarz
2010-07-20 19:19 ` Marcin Slusarz
2010-07-20 19:19 ` [PATCH] vga16fb: refuse to load in face of other driver Marcin Slusarz
2010-07-23  0:20 ` [PATCH] vga16fb: refuse to load in face of other driver controlling primary card Andrew Morton
2010-07-23  0:20   ` [PATCH] vga16fb: refuse to load in face of other driver Andrew Morton
2010-07-23 13:10   ` [PATCH v2] vga16fb: refuse to load in face of other driver controlling primary card Marcin Slusarz
2010-07-23 13:10     ` [PATCH v2] vga16fb: refuse to load in face of other driver Marcin Slusarz
2010-07-23 15:00     ` [PATCH v2] vga16fb: refuse to load in face of other driver controlling primary card Geert Uytterhoeven
2010-07-23 15:00       ` Geert Uytterhoeven
2010-07-23 15:00       ` [PATCH v2] vga16fb: refuse to load in face of other driver Geert Uytterhoeven
2010-07-25  8:42     ` [Nouveau] [PATCH v2] vga16fb: refuse to load in face of other driver controlling primary card Dave Airlie
2010-07-25  8:42       ` Dave Airlie
2010-07-25  8:42       ` [Nouveau] [PATCH v2] vga16fb: refuse to load in face of other Dave Airlie
2010-07-25 11:54       ` [Nouveau] [PATCH v2] vga16fb: refuse to load in face of other driver controlling primary card Marcin Slusarz
2010-07-25 11:54         ` [Nouveau] [PATCH v2] vga16fb: refuse to load in face of other Marcin Slusarz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.