Skip to contentSkip to conversation

: hgafb crash on MDA only cards

PATCH In review Paul Gortmaker 2 participants 2 messages Jan 24, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : hgafb crash on MDA only cards

Current (2.4.0pre8) hgafb will misdetect MDA only cards and then crash - last message briefly seen before screen clears is

hgafb: <NULL> with 32K of memory detected.

A comparison to the detection code in XFree86 shows that hgafb forgets to return failure if the status port doesn't show any active changes associated with counting vertical syncs.

Paul.

video/hgafb.c renamed from video/hgafb.c~ +18 -15
@@ -7,6 +7,8 @@
  *
  * History:
  *
+ * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards 
+ *				   being detected as Hercules.	 (Paul G.)
  * - Revision 0.1.6 (17 Aug 2000): new style structs
  *                                 documentation
  * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc
@@ -358,21 +360,22 @@
 		udelay(2);
 	}
 
-	if (p_save != q_save) {
-		switch (inb_p(HGA_STATUS_PORT) & 0x70) {
-			case 0x10:
-				hga_type = TYPE_HERCPLUS;
-				hga_type_name = "HerculesPlus";
-				break;
-			case 0x50:
-				hga_type = TYPE_HERCCOLOR;
-				hga_type_name = "HerculesColor";
-				break;
-			default:
-				hga_type = TYPE_HERC;
-				hga_type_name = "Hercules";
-				break;
-		}
+	if (p_save == q_save) 
+		return 0;
+
+	switch (inb_p(HGA_STATUS_PORT) & 0x70) {
+		case 0x10:
+			hga_type = TYPE_HERCPLUS;
+			hga_type_name = "HerculesPlus";
+			break;
+		case 0x50:
+			hga_type = TYPE_HERCCOLOR;
+			hga_type_name = "HerculesColor";
+			break;
+		default:
+			hga_type = TYPE_HERC;
+			hga_type_name = "Hercules";
+			break;
 	}
 	return 1;
 }

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 8 lines · Paul Gortmaker

Current (2.4.0pre8) hgafb will misdetect MDA only cards and then crash - last message briefly seen before screen clears is

hgafb: <NULL> with 32K of memory detected.

A comparison to the detection code in XFree86 shows that hgafb forgets to return failure if the status port doesn't show any active changes associated with counting vertical syncs.

Hi!

I'm happy to see I'm not the only one using theese old beasts. :) Your patch looks good, thanks for it! I'll test it tonight.

Best regards,
Ferenc Bakonyi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/