From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jon Smirl <jonsmirl@yahoo.com>
Cc: Jesse Barnes <jbarnes@engr.sgi.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Vojtech Pavlik <vojtech@suse.cz>,
Torrey Hoffman <thoffman@arnor.net>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: Exposing ROM's though sysfs
Date: Wed, 04 Aug 2004 11:57:16 +1000 [thread overview]
Message-ID: <1091584635.1922.72.camel@gaston> (raw)
In-Reply-To: <20040804013745.7323.qmail@web14927.mail.yahoo.com>
On Wed, 2004-08-04 at 11:37, Jon Smirl wrote:
> Ben, can you put together a first pass on a "VGA arbitration driver"?
> You probably know more about the quirks necessary on non-x86 platforms
> than anyone else. I can help from the desktop x86 side but I've never
> worked on high end hardware that allows things like multiple active VGA
> devices. I'm sure the Mac machines and ia64 systems will need some
> special code too.
At this point, even the kernel doesn't have internally the necessary
platform hooks for dealing with multi domains legacy port IOs or
VGA memory space, it's all plaform hacks. But we can define an API at
least for userland and fix the kernel driver afterward.
I'm fairly busy this week, so it would be nice if you guys could come
up with some rough idea of the API you think the kernel driver should
provide (a /dev entry with ioctl's ? Linus won't be too happy ... something
in sysfs ?) and I can sit down & code something hopefully next week end
and/or next week.
Jesse did a pretty good summary of what features need to be provided
though. Note also that this "arbitration" layer may also need an in-kernel
API for things like vgacon or whatever may want to "grab" access to the
VGA device.
I suggest that at this point, we don't try to bother with simultaneous
access to devices on separate PCI domains, but just use an in-kernel
semaphore to arbitrate the single user at a given point in time who "owns"
the VGA access, whatever bus it is on. So we need 2 things, both in-kernel
and for userland:
- A way to identify a VGA device on a given bus. Could this be a PCI
ID (or in kernel a pci_dev ?). That would mean no support for non-PCI stuffs,
how bad would that be ? Or we can try to be more smart and have userland
pass an ID string that contains the bus type, leaving us with some room
for accomodation of crappy bus types (read: embedded).
Maybe we just need to add to any entry in sysfs that is a VGA device some
kind of "vga_token" attribute that contains a "magic string" to be then used
with the driver for identification purposes ? For in kernel, we then just
use the pci_dev, with a special case for "legacy non-PCI" VGA ?
- Basic API for grabbing/releasing the VGA lock, passing a given ID. This
would both take the exclusive access lock, and "set" IOs to the given device
(enable IOs to it). The API doesn't prevent future implementation of per-domain
locks if we want to have some concurrency here, though I feel that's useless.
The kernel-side is simple, the userland side could be an ioctl (hrm....).
However, should it be blocking or of trylock kind ? I don't like the idea of
userland beeing able to block the kernel (vgacon or whoever else in the kernel
need to do legacy IOs). Also, some console drivers still need to run in
'atomic' environment, though we did move a lot of things down to normal
task protected by the console semaphore, the printk and blanking code path,
afaik, are still a problem. So a simple semaphore may not do the trick. We
could simply abuse the console sem instead for now as our VGA lock, which means
that an fb driver would alwyas be called with the lock already held... but then,
we still need a call to "set" the current active VGA device while already
owning the lock... I liked the idea of having one single call doing both.
Alan, what is your opinion there ?
- In kernel API for vga_inX/outX and vga mem access on a given device
- Userland should use read/write for IOs imho, either to a /dev device
(with maybe an ioctl to switch between PIO and VGA mem, though mmap is
better for the later) or to some sysfs entry (in which case, can we add
mmap call to a sysfs attribute ? last time I looked, it wasn't simple).
Ben.
next prev parent reply other threads:[~2004-08-04 1:58 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1091207136.2762.181.camel@rohan.arnor.net>
2004-07-30 17:24 ` Exposing ROM's though sysfs Jon Smirl
2004-07-30 19:14 ` Vojtech Pavlik
2004-07-30 20:26 ` Jesse Barnes
2004-07-30 22:36 ` Alan Cox
2004-08-03 21:41 ` Benjamin Herrenschmidt
2004-08-04 0:55 ` Jesse Barnes
2004-08-04 0:59 ` Benjamin Herrenschmidt
2004-08-04 1:18 ` legacy VGA device requirements (was: Exposing ROM's though sysfs) Jesse Barnes
2004-08-13 15:53 ` Jon Smirl
2004-08-13 16:11 ` Jesse Barnes
2004-08-13 21:45 ` Alan Cox
2004-08-13 21:43 ` Alan Cox
2004-08-13 23:56 ` Jon Smirl
2004-08-14 15:27 ` Alan Cox
2004-08-14 16:36 ` Jon Smirl
2004-08-20 4:46 ` Jon Smirl
2004-08-20 4:53 ` Vojtech Pavlik
2004-08-20 5:03 ` Jon Smirl
2004-08-20 11:14 ` Alan Cox
2004-08-04 1:37 ` Exposing ROM's though sysfs Jon Smirl
2004-08-04 1:57 ` Benjamin Herrenschmidt [this message]
2004-08-04 2:16 ` Jesse Barnes
2004-07-30 16:53 Jon Smirl
2004-07-30 17:10 ` Jesse Barnes
2004-07-30 17:19 ` Jesse Barnes
2004-07-30 17:24 ` Christoph Hellwig
2004-07-30 17:57 ` Jesse Barnes
2004-07-30 18:06 ` Jesse Barnes
2004-07-30 18:12 ` Matthew Wilcox
2004-07-30 18:12 ` Jesse Barnes
2004-07-30 18:20 ` Martin Mares
2004-07-30 18:49 ` Jesse Barnes
2004-07-30 19:55 ` Greg KH
2004-07-30 20:05 ` Jon Smirl
2004-07-30 20:16 ` Jesse Barnes
2004-07-30 20:29 ` Greg KH
2004-07-30 18:59 ` Jon Smirl
2004-07-30 19:04 ` Matthew Wilcox
2004-07-30 19:30 ` Jon Smirl
2004-07-30 19:35 ` Martin Mares
2004-07-30 19:39 ` Jon Smirl
2004-07-30 19:46 ` Martin Mares
2004-07-30 20:03 ` Jon Smirl
2004-07-30 20:10 ` Martin Mares
2004-07-30 20:13 ` Martin Mares
2004-07-30 20:25 ` Jesse Barnes
2004-07-30 20:32 ` Jon Smirl
2004-07-30 20:41 ` Martin Mares
2004-07-30 20:49 ` Jesse Barnes
2004-07-30 20:54 ` Martin Mares
2004-07-30 21:00 ` Jesse Barnes
2004-07-30 21:07 ` Jon Smirl
2004-07-30 21:12 ` Jesse Barnes
2004-07-30 19:47 ` Vojtech Pavlik
2004-07-30 22:18 ` Thomas Bogendoerfer
2004-07-30 22:39 ` Alan Cox
2004-07-30 19:25 ` Jon Smirl
2004-07-30 19:35 ` Vojtech Pavlik
2004-07-30 19:41 ` Jon Smirl
2004-07-30 19:48 ` Vojtech Pavlik
2004-07-30 20:20 ` Jesse Barnes
2004-07-30 22:41 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1091584635.1922.72.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jbarnes@engr.sgi.com \
--cc=jonsmirl@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thoffman@arnor.net \
--cc=vojtech@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox