All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] resources: fill in type for __request_region()
@ 2010-05-04 18:58 Bjorn Helgaas
  2010-05-04 18:58 ` [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY Bjorn Helgaas
  0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2010-05-04 18:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, H. Peter Anvin


Set the IORESOURCE_TYPE based on the parent.  Without this, the type is
never set, which is slightly confusing if we ever print the resource later.

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

 kernel/resource.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/kernel/resource.c b/kernel/resource.c
index aa63746..f0d83a4 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -699,8 +699,9 @@ struct resource * __request_region(struct resource *parent,
 	res->name = name;
 	res->start = start;
 	res->end = start + n - 1;
-	res->flags = IORESOURCE_BUSY;
-	res->flags |= flags;
+	res->flags = parent->flags & IORESOURCE_TYPE_BITS;
+	res->flags |= (flags & ~IORESOURCE_TYPE_BITS);
+	res->flags |= IORESOURCE_BUSY;
 
 	write_lock(&resource_lock);
 


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

* [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
  2010-05-04 18:58 [PATCH 1/2] resources: fill in type for __request_region() Bjorn Helgaas
@ 2010-05-04 18:58 ` Bjorn Helgaas
  2010-05-04 19:09   ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2010-05-04 18:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, H. Peter Anvin


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@hp.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;
 		}
 	}


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

* Re: [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
  2010-05-04 18:58 ` [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY Bjorn Helgaas
@ 2010-05-04 19:09   ` Linus Torvalds
  2010-05-04 19:16     ` Bjorn Helgaas
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2010-05-04 19:09 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-kernel, H. Peter Anvin



On Tue, 4 May 2010, Bjorn Helgaas wrote:
> 
> 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@hp.com>

Hmm. I don't object, but unless there is some crazy regression, there's no 
way I will take something like this outside the merge window. Who knows 
what odd frame buffer driver is out there that just depended on the fact 
that it could also register that VGA area?

Probably no such thing exists, but it's why I want these kinds of things 
during the merge window. And obviously preferably through something like 
the PCI merge tree, but that's a different issue.

		Linus

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

* Re: [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
  2010-05-04 19:09   ` Linus Torvalds
@ 2010-05-04 19:16     ` Bjorn Helgaas
  2010-05-04 20:14       ` H. Peter Anvin
  0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2010-05-04 19:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, H. Peter Anvin

On Tuesday, May 04, 2010 01:09:46 pm Linus Torvalds wrote:
> On Tue, 4 May 2010, Bjorn Helgaas wrote:
> > 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@hp.com>
> 
> Hmm. I don't object, but unless there is some crazy regression, there's no
> way I will take something like this outside the merge window. Who knows
> what odd frame buffer driver is out there that just depended on the fact
> that it could also register that VGA area?
> 
> Probably no such thing exists, but it's why I want these kinds of things
> during the merge window. And obviously preferably through something like
> the PCI merge tree, but that's a different issue.

Yep, I was intending for after .34.  I couldn't figure out where
to send it, but I'll be happy to send it to Jesse.

Bjorn

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

* Re: [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
  2010-05-04 19:16     ` Bjorn Helgaas
@ 2010-05-04 20:14       ` H. Peter Anvin
  2010-05-04 20:51         ` Jesse Barnes
  2010-05-18 21:41         ` Jesse Barnes
  0 siblings, 2 replies; 7+ messages in thread
From: H. Peter Anvin @ 2010-05-04 20:14 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Linus Torvalds, linux-kernel, Jesse Barnes

On 05/04/2010 12:16 PM, Bjorn Helgaas wrote:
> On Tuesday, May 04, 2010 01:09:46 pm Linus Torvalds wrote:
>> On Tue, 4 May 2010, Bjorn Helgaas wrote:
>>> 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@hp.com>
>>
>> Hmm. I don't object, but unless there is some crazy regression, there's no
>> way I will take something like this outside the merge window. Who knows
>> what odd frame buffer driver is out there that just depended on the fact
>> that it could also register that VGA area?
>>
>> Probably no such thing exists, but it's why I want these kinds of things
>> during the merge window. And obviously preferably through something like
>> the PCI merge tree, but that's a different issue.
> 
> Yep, I was intending for after .34.  I couldn't figure out where
> to send it, but I'll be happy to send it to Jesse.
> 

I would vote for Jesse's tree.  If Jesse doesn't want it I'll take it.

	-hpa


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

* Re: [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
  2010-05-04 20:14       ` H. Peter Anvin
@ 2010-05-04 20:51         ` Jesse Barnes
  2010-05-18 21:41         ` Jesse Barnes
  1 sibling, 0 replies; 7+ messages in thread
From: Jesse Barnes @ 2010-05-04 20:51 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Bjorn Helgaas, Linus Torvalds, linux-kernel

On Tue, 04 May 2010 13:14:11 -0700
"H. Peter Anvin" <hpa@zytor.com> wrote:

> On 05/04/2010 12:16 PM, Bjorn Helgaas wrote:
> > On Tuesday, May 04, 2010 01:09:46 pm Linus Torvalds wrote:
> >> On Tue, 4 May 2010, Bjorn Helgaas wrote:
> >>> 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@hp.com>
> >>
> >> Hmm. I don't object, but unless there is some crazy regression,
> >> there's no way I will take something like this outside the merge
> >> window. Who knows what odd frame buffer driver is out there that
> >> just depended on the fact that it could also register that VGA
> >> area?
> >>
> >> Probably no such thing exists, but it's why I want these kinds of
> >> things during the merge window. And obviously preferably through
> >> something like the PCI merge tree, but that's a different issue.
> > 
> > Yep, I was intending for after .34.  I couldn't figure out where
> > to send it, but I'll be happy to send it to Jesse.
> > 
> 
> I would vote for Jesse's tree.  If Jesse doesn't want it I'll take it.

I'm happy to stuff it in my -next tree.  Bjorn can you resend?

Thanks,
Jesse

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

* Re: [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
  2010-05-04 20:14       ` H. Peter Anvin
  2010-05-04 20:51         ` Jesse Barnes
@ 2010-05-18 21:41         ` Jesse Barnes
  1 sibling, 0 replies; 7+ messages in thread
From: Jesse Barnes @ 2010-05-18 21:41 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Bjorn Helgaas, Linus Torvalds, linux-kernel

On Tue, 04 May 2010 13:14:11 -0700
"H. Peter Anvin" <hpa@zytor.com> wrote:

> On 05/04/2010 12:16 PM, Bjorn Helgaas wrote:
> > On Tuesday, May 04, 2010 01:09:46 pm Linus Torvalds wrote:
> >> On Tue, 4 May 2010, Bjorn Helgaas wrote:
> >>> 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@hp.com>
> >>
> >> Hmm. I don't object, but unless there is some crazy regression, there's no
> >> way I will take something like this outside the merge window. Who knows
> >> what odd frame buffer driver is out there that just depended on the fact
> >> that it could also register that VGA area?
> >>
> >> Probably no such thing exists, but it's why I want these kinds of things
> >> during the merge window. And obviously preferably through something like
> >> the PCI merge tree, but that's a different issue.
> > 
> > Yep, I was intending for after .34.  I couldn't figure out where
> > to send it, but I'll be happy to send it to Jesse.
> > 
> 
> I would vote for Jesse's tree.  If Jesse doesn't want it I'll take it.

Can you resend this one Bjorn?

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

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

end of thread, other threads:[~2010-05-18 21:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-04 18:58 [PATCH 1/2] resources: fill in type for __request_region() Bjorn Helgaas
2010-05-04 18:58 ` [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY Bjorn Helgaas
2010-05-04 19:09   ` Linus Torvalds
2010-05-04 19:16     ` Bjorn Helgaas
2010-05-04 20:14       ` H. Peter Anvin
2010-05-04 20:51         ` Jesse Barnes
2010-05-18 21:41         ` Jesse Barnes

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.