lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 04 May 2010 12:58:06 -0600
From:	Bjorn Helgaas <bjorn.helgaas@...com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>
Subject: [PATCH 2/2] vgacon: use request_region(), not request_resource(),
	to set BUSY


Drivers normally use request_region() to mark the region busy so it won't
be used by anybody else.  Previously, we used request_resource(), which
doesn't mark the VGA regions busy.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@...com>
---

 drivers/video/console/vgacon.c |   30 ++++++------------------------
 1 files changed, 6 insertions(+), 24 deletions(-)


diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 182dd6f..fca54ec 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -410,25 +410,16 @@ static const char *vgacon_startup(void)
 		vga_video_port_reg = VGA_CRT_IM;
 		vga_video_port_val = VGA_CRT_DM;
 		if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
-			static struct resource ega_console_resource =
-			    { .name = "ega", .start = 0x3B0, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_EGAM;
 			vga_vram_size = 0x8000;
 			display_desc = "EGA+";
-			request_resource(&ioport_resource,
-					 &ega_console_resource);
+			request_region(0x3b0, 0x10, "ega");
 		} else {
-			static struct resource mda1_console_resource =
-			    { .name = "mda", .start = 0x3B0, .end = 0x3BB };
-			static struct resource mda2_console_resource =
-			    { .name = "mda", .start = 0x3BF, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_MDA;
 			vga_vram_size = 0x2000;
 			display_desc = "*MDA";
-			request_resource(&ioport_resource,
-					 &mda1_console_resource);
-			request_resource(&ioport_resource,
-					 &mda2_console_resource);
+			request_region(0x3b0, 0xc, "mda");
+			request_region(0x3bf, 0x1, "mda");
 			vga_video_font_height = 14;
 		}
 	} else {
@@ -443,19 +434,13 @@ static const char *vgacon_startup(void)
 			vga_vram_size = 0x8000;
 
 			if (!screen_info.orig_video_isVGA) {
-				static struct resource ega_console_resource
-				    = { .name = "ega", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_EGAC;
 				display_desc = "EGA";
-				request_resource(&ioport_resource,
-						 &ega_console_resource);
+				request_region(0x3c0, 0x20, "ega");
 			} else {
-				static struct resource vga_console_resource
-				    = { .name = "vga+", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_VGAC;
 				display_desc = "VGA+";
-				request_resource(&ioport_resource,
-						 &vga_console_resource);
+				request_region(0x3c0, 0x20, "vga+");
 
 #ifdef VGA_CAN_DO_64KB
 				/*
@@ -494,13 +479,10 @@ static const char *vgacon_startup(void)
 				}
 			}
 		} else {
-			static struct resource cga_console_resource =
-			    { .name = "cga", .start = 0x3D4, .end = 0x3D5 };
 			vga_video_type = VIDEO_TYPE_CGA;
 			vga_vram_size = 0x2000;
 			display_desc = "*CGA";
-			request_resource(&ioport_resource,
-					 &cga_console_resource);
+			request_region(0x3d4, 0x2, "cga");
 			vga_video_font_height = 8;
 		}
 	}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists