Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Benjamin Herrenschmidt
On Wed, 2005-03-09 at 12:45 +0200, Pekka Enberg wrote: > Hi Benjamin, > > Few coding style nitpicks follow. > > On Tue, 08 Mar 2005 18:11:59 +1100, Benjamin Herrenschmidt > <[EMAIL PROTECTED]> wrote: > > Index: linux-work/include/linux/pci.h > >

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Kronos
Il Wed, Mar 09, 2005 at 09:46:20AM +1100, Benjamin Herrenschmidt ha scritto: > One thing is: I > don't have x86 hardware, or at least, nothing where I can have 2 VGA > cards in (I may have access to an old laptop). So I'll need help & > testers at one point. It's your lucky day ;) I've just

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Jesse Barnes
On Tuesday, March 8, 2005 9:58 pm, Jon Smirl wrote: > On Wed, 09 Mar 2005 16:37:13 +1100, Benjamin Herrenschmidt > > <[EMAIL PROTECTED]> wrote: > > On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: > > > This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It > > > describes how ia64

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Pekka Enberg
Hi Benjamin, Few coding style nitpicks follow. On Tue, 08 Mar 2005 18:11:59 +1100, Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > Index: linux-work/include/linux/pci.h > === > --- linux-work.orig/include/linux/pci.h

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Pekka Enberg
Hi Benjamin, On Tue, 2005-03-08 at 22:29 +0100, Kronos wrote: > > kfree(NULL) is fine, no need to check for null pointer. On Wed, 09 Mar 2005 09:46:20 +1100, Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > Hehe, yes, but I don't like it :) Please consider doing that anyway as there are

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Benjamin Herrenschmidt
Ok, here's today status. I posted the patch at http://gate.crashing.org/~benh/vga-arbiter.diff. I fixed some issues & added support for nesting locks, I added comments/documentation to kernel interface. It's not tested yet. It's not complete neither, the userland interface is partially implemented

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Benjamin Herrenschmidt
Ok, here's today status. I posted the patch at http://gate.crashing.org/~benh/vga-arbiter.diff. I fixed some issues added support for nesting locks, I added comments/documentation to kernel interface. It's not tested yet. It's not complete neither, the userland interface is partially implemented

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Pekka Enberg
Hi Benjamin, On Tue, 2005-03-08 at 22:29 +0100, Kronos wrote: kfree(NULL) is fine, no need to check for null pointer. On Wed, 09 Mar 2005 09:46:20 +1100, Benjamin Herrenschmidt [EMAIL PROTECTED] wrote: Hehe, yes, but I don't like it :) Please consider doing that anyway as there are ongoing

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Pekka Enberg
Hi Benjamin, Few coding style nitpicks follow. On Tue, 08 Mar 2005 18:11:59 +1100, Benjamin Herrenschmidt [EMAIL PROTECTED] wrote: Index: linux-work/include/linux/pci.h === --- linux-work.orig/include/linux/pci.h 2005-01-24

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Jesse Barnes
On Tuesday, March 8, 2005 9:58 pm, Jon Smirl wrote: On Wed, 09 Mar 2005 16:37:13 +1100, Benjamin Herrenschmidt [EMAIL PROTECTED] wrote: On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It describes how ia64 is achieving

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Kronos
Il Wed, Mar 09, 2005 at 09:46:20AM +1100, Benjamin Herrenschmidt ha scritto: One thing is: I don't have x86 hardware, or at least, nothing where I can have 2 VGA cards in (I may have access to an old laptop). So I'll need help testers at one point. It's your lucky day ;) I've just assembled

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-09 Thread Benjamin Herrenschmidt
On Wed, 2005-03-09 at 12:45 +0200, Pekka Enberg wrote: Hi Benjamin, Few coding style nitpicks follow. On Tue, 08 Mar 2005 18:11:59 +1100, Benjamin Herrenschmidt [EMAIL PROTECTED] wrote: Index: linux-work/include/linux/pci.h

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Wed, 2005-03-09 at 00:58 -0500, Jon Smirl wrote: > On Wed, 09 Mar 2005 16:37:13 +1100, Benjamin Herrenschmidt > <[EMAIL PROTECTED]> wrote: > > On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: > > > This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It > > > describes how ia64

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
On Wed, 09 Mar 2005 16:37:13 +1100, Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote: > On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: > > This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It > > describes how ia64 is achieving legacy IO. The VGA control code > > probably

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: > This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It > describes how ia64 is achieving legacy IO. The VGA control code > probably needs to be coordinated with this. This is a different thing, and I will implement it on ppc one

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It describes how ia64 is achieving legacy IO. The VGA control code probably needs to be coordinated with this. -- Accessing legacy resources through sysfs

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 22:17 -0500, Jon Smirl wrote: > How do I do the 'disable all, post, renable last active' sequence in > this scheme? You don't do it that way. You vga_get(IO|MEM) the card you want to POST, do the POST, then vga_put(). Subsequent user will get back ownership when it does

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
How do I do the 'disable all, post, renable last active' sequence in this scheme? -- Jon Smirl [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 18:47 -0500, Jon Smirl wrote: > This very similar to the reset support patch I have been working on. > > In the reset patch there is a 'vga' attribute on each VGA device. Set > it to 0/1 to make the device active. This lets you move the console > around betweem VGA devices.

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
This very similar to the reset support patch I have been working on. In the reset patch there is a 'vga' attribute on each VGA device. Set it to 0/1 to make the device active. This lets you move the console around betweem VGA devices. You can also set it to 3, which disables all VGA devices but

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 22:29 +0100, Kronos wrote: > > + bus = pdev->bus; > > + while (bus) { > > + bridge = bus->self; > > + if (bridge) { > > + pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, > > ); > > + if

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
Minus the big fat ugly bug of scheduling with a spinlock in vga_get() of course ... bah. Easy to fix tho. I'll post a new version later. Ben. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Kronos
Benjamin Herrenschmidt <[EMAIL PROTECTED]> ha scritto: > Ok, so here is a first, totally untested draft for the kernel side > of the VGA arbiter. Hi Ben, I've a few comments: > Index: linux-work/drivers/pci/vga.c > === > ---

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Kronos
Benjamin Herrenschmidt [EMAIL PROTECTED] ha scritto: Ok, so here is a first, totally untested draft for the kernel side of the VGA arbiter. Hi Ben, I've a few comments: Index: linux-work/drivers/pci/vga.c === --- /dev/null

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
Minus the big fat ugly bug of scheduling with a spinlock in vga_get() of course ... bah. Easy to fix tho. I'll post a new version later. Ben. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 22:29 +0100, Kronos wrote: + bus = pdev-bus; + while (bus) { + bridge = bus-self; + if (bridge) { + pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, cmd); + if (!(cmd

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
This very similar to the reset support patch I have been working on. In the reset patch there is a 'vga' attribute on each VGA device. Set it to 0/1 to make the device active. This lets you move the console around betweem VGA devices. You can also set it to 3, which disables all VGA devices but

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 18:47 -0500, Jon Smirl wrote: This very similar to the reset support patch I have been working on. In the reset patch there is a 'vga' attribute on each VGA device. Set it to 0/1 to make the device active. This lets you move the console around betweem VGA devices.

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
How do I do the 'disable all, post, renable last active' sequence in this scheme? -- Jon Smirl [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 22:17 -0500, Jon Smirl wrote: How do I do the 'disable all, post, renable last active' sequence in this scheme? You don't do it that way. You vga_get(IO|MEM) the card you want to POST, do the POST, then vga_put(). Subsequent user will get back ownership when it does

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It describes how ia64 is achieving legacy IO. The VGA control code probably needs to be coordinated with this. -- Accessing legacy resources through sysfs

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It describes how ia64 is achieving legacy IO. The VGA control code probably needs to be coordinated with this. This is a different thing, and I will implement it on ppc one of

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Jon Smirl
On Wed, 09 Mar 2005 16:37:13 +1100, Benjamin Herrenschmidt [EMAIL PROTECTED] wrote: On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It describes how ia64 is achieving legacy IO. The VGA control code probably needs to be

Re: [PATCH] VGA arbitration: draft of kernel side

2005-03-08 Thread Benjamin Herrenschmidt
On Wed, 2005-03-09 at 00:58 -0500, Jon Smirl wrote: On Wed, 09 Mar 2005 16:37:13 +1100, Benjamin Herrenschmidt [EMAIL PROTECTED] wrote: On Tue, 2005-03-08 at 23:35 -0500, Jon Smirl wrote: This is from /linux-2.5/Documentation/filesystems/sysfs-pci.txt. It describes how ia64 is achieving

[PATCH] VGA arbitration: draft of kernel side

2005-03-07 Thread Benjamin Herrenschmidt
Hi ! Ok, so here is a first, totally untested draft for the kernel side of the VGA arbiter. BIG NOTE: It's really only the basic arbiter itself, which provides the API I drafted a bit earlier, with arch hooks similar to what Alan proposed, it does _NOT_ yet provides a userland interface (to a

[PATCH] VGA arbitration: draft of kernel side

2005-03-07 Thread Benjamin Herrenschmidt
Hi ! Ok, so here is a first, totally untested draft for the kernel side of the VGA arbiter. BIG NOTE: It's really only the basic arbiter itself, which provides the API I drafted a bit earlier, with arch hooks similar to what Alan proposed, it does _NOT_ yet provides a userland interface (to a