All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Jon Smirl <jonsmirl@yahoo.com>
Cc: Jeff Garzik <jgarzik@pobox.com>, Eric Anholt <eta@lclark.edu>,
	<kronos@kronoz.cjb.net>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<linux-fbdev-devel@lists.sourceforge.net>,
	dri-devel <dri-devel@lists.sourceforge.net>
Subject: Re: Multiple drivers for same hardware:, was: DRM and pci_driver conversion
Date: Thu, 23 Oct 2003 21:40:33 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0310232132410.4894-100000@home.osdl.org> (raw)
In-Reply-To: <20031024034701.16514.qmail@web14915.mail.yahoo.com>


On Thu, 23 Oct 2003, Jon Smirl wrote:
>
> What about the fundamental question? We have several pairs of device drivers
> that want to control the same hardware. One example would be radeon DRM and
> radeon Framebuffer. How should these drivers coordinate probing and claiming
> resources?

Since they have to co-operate some way on the resources _anyway_, they'll 
just need to work it out amongst themselves.

One common case is to have a "arbitration driver" that tends to do the
actual low-level accesses and is one level of abstraction over the
hardware (papers over trivial differences in hardware). An example of this
would be the old-style ISA DMA infrastructure (now happily pretty much
dead), where the "DMA driver" was just a trivial layer that had some basic
allocation/deallocation and had somewhat nicer access routines than the
raw IO accesses, but didn't do much more.

Another case is the PS/2 keyboard driver, where the mouse and the keyboard
actually share the controller, and they shared a spinlock and some helper
routines to guarantee some basic serialization (that eventually got 
replaced with the current i8042 driver, but the old setup was trivial).

> 1) try new probe first and fall back to old scheme. First driver that loads
> gets the new probe, second gets the old. First driver reserves resources.
> 2) Require a mini driver that handles probing. Then both drivers attach to the
> mini driver.
> 3) Declare it illegal and make the drivers merge.
> 4) Declare it illegal and only allow first one loaded to run.

I'd suggest the minidriver case. You _will_ find common issues anyway
(locking and certain access patterns etc), and the minidriver ends up
being a place to put the trivial shared code too.

			Linus


WARNING: multiple messages have this Message-ID (diff)
From: Linus Torvalds <torvalds@osdl.org>
To: Jon Smirl <jonsmirl@yahoo.com>
Cc: Jeff Garzik <jgarzik@pobox.com>, Eric Anholt <eta@lclark.edu>,
	kronos@kronoz.cjb.net,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fbdev-devel@lists.sourceforge.net,
	dri-devel <dri-devel@lists.sourceforge.net>
Subject: Re: Multiple drivers for same hardware:, was: DRM and pci_driver conversion
Date: Thu, 23 Oct 2003 21:40:33 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0310232132410.4894-100000@home.osdl.org> (raw)
In-Reply-To: <20031024034701.16514.qmail@web14915.mail.yahoo.com>


On Thu, 23 Oct 2003, Jon Smirl wrote:
>
> What about the fundamental question? We have several pairs of device drivers
> that want to control the same hardware. One example would be radeon DRM and
> radeon Framebuffer. How should these drivers coordinate probing and claiming
> resources?

Since they have to co-operate some way on the resources _anyway_, they'll 
just need to work it out amongst themselves.

One common case is to have a "arbitration driver" that tends to do the
actual low-level accesses and is one level of abstraction over the
hardware (papers over trivial differences in hardware). An example of this
would be the old-style ISA DMA infrastructure (now happily pretty much
dead), where the "DMA driver" was just a trivial layer that had some basic
allocation/deallocation and had somewhat nicer access routines than the
raw IO accesses, but didn't do much more.

Another case is the PS/2 keyboard driver, where the mouse and the keyboard
actually share the controller, and they shared a spinlock and some helper
routines to guarantee some basic serialization (that eventually got 
replaced with the current i8042 driver, but the old setup was trivial).

> 1) try new probe first and fall back to old scheme. First driver that loads
> gets the new probe, second gets the old. First driver reserves resources.
> 2) Require a mini driver that handles probing. Then both drivers attach to the
> mini driver.
> 3) Declare it illegal and make the drivers merge.
> 4) Declare it illegal and only allow first one loaded to run.

I'd suggest the minidriver case. You _will_ find common issues anyway
(locking and certain access patterns etc), and the minidriver ends up
being a place to put the trivial shared code too.

			Linus

  reply	other threads:[~2003-10-24  4:40 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21  2:31 DRM and pci_driver conversion Eric Anholt
2003-10-23 19:04 ` [Linux-fbdev-devel] " Kronos
2003-10-23 19:04   ` Kronos
2003-10-23 21:10   ` [Linux-fbdev-devel] " Eric Anholt
2003-10-23 21:31     ` Jon Smirl
2003-10-23 23:23       ` [Dri-devel] " Linus Torvalds
2003-10-23 23:23         ` Linus Torvalds
2003-10-23 23:46         ` Eric Anholt
2003-10-24  1:19         ` Jeff Garzik
2003-10-24  1:19           ` [Dri-devel] " Jeff Garzik
2003-10-24  1:52           ` [Dri-devel] Re: [Linux-fbdev-devel] " Jon Smirl
2003-10-24  3:47           ` Multiple drivers for same hardware:, was: " Jon Smirl
2003-10-24  3:47             ` Jon Smirl
2003-10-24  4:40             ` Linus Torvalds [this message]
2003-10-24  4:40               ` Linus Torvalds
2003-10-28 18:00               ` James Simmons
2003-10-28 18:00                 ` James Simmons
2003-10-24 16:44           ` [Dri-devel] Re: [Linux-fbdev-devel] " Linus Torvalds
2003-10-24 16:44             ` [Dri-devel] " Linus Torvalds
2003-10-24 16:57             ` [Dri-devel] Re: [Linux-fbdev-devel] " Petr Vandrovec
2003-10-24 17:59               ` Linus Torvalds
2003-10-24 17:59                 ` Linus Torvalds
2003-10-24 18:34                 ` Jon Smirl
2003-10-24 19:45                   ` Ivan Kokshaysky
2003-10-24 19:45                     ` [Dri-devel] " Ivan Kokshaysky
2003-10-24 19:08               ` [Dri-devel] Re: [Linux-fbdev-devel] " Ivan Kokshaysky
2003-10-24 19:08                 ` [Dri-devel] " Ivan Kokshaysky
2003-10-24 17:06             ` [Dri-devel] Re: [Linux-fbdev-devel] " Jeff Garzik
2003-10-24 17:06               ` [Dri-devel] " Jeff Garzik
2003-10-24  1:50         ` [Dri-devel] Re: [Linux-fbdev-devel] " Jon Smirl
2003-10-24  1:50           ` [Dri-devel] " Jon Smirl
2003-10-25 17:29         ` [Dri-devel] Re: [Linux-fbdev-devel] " Egbert Eich
2003-10-25 17:29           ` [Dri-devel] " Egbert Eich
2003-10-25 18:37           ` [Dri-devel] Re: [Linux-fbdev-devel] " Linus Torvalds
2003-10-25 18:37             ` Linus Torvalds
2003-10-25 19:17             ` Jeff Garzik
2003-10-25 19:17               ` [Dri-devel] " Jeff Garzik
2003-10-27 14:37               ` Ingo Oeser
2003-10-27 14:37               ` [Dri-devel] Re: [Linux-fbdev-devel] " Ingo Oeser
2003-10-27 15:43                 ` Jeff Garzik
2003-10-27 15:43                   ` [Dri-devel] " Jeff Garzik
2003-10-28 10:53                   ` [Dri-devel] Re: [Linux-fbdev-devel] " Ingo Oeser
2003-10-27 15:14               ` Keith Whitwell
2003-10-27 15:14                 ` [Dri-devel] " Keith Whitwell
2003-10-27 15:38                 ` Jeff Garzik
2003-10-27 15:38                 ` [Dri-devel] Re: [Linux-fbdev-devel] " Jeff Garzik
2003-10-27 15:50                   ` [Dri-devel] " Keith Whitwell
2003-10-27 15:50                   ` [Dri-devel] Re: [Linux-fbdev-devel] " Keith Whitwell
2003-10-25 21:02             ` Jon Smirl
2003-10-25 21:02               ` [Dri-devel] " Jon Smirl
2003-10-25 22:07             ` [Dri-devel] Re: [Linux-fbdev-devel] " Benjamin Herrenschmidt
2003-10-25 22:07               ` [Dri-devel] " Benjamin Herrenschmidt
2003-10-27 14:01             ` [Dri-devel] Re: [Linux-fbdev-devel] " jlnance
2003-10-27 15:10             ` Eric W. Biederman
2003-10-27 15:10               ` [Dri-devel] " Eric W. Biederman
2003-10-27 15:10             ` [Dri-devel] Re: [Linux-fbdev-devel] " Keith Whitwell
2003-10-27 15:10               ` [Dri-devel] " Keith Whitwell
     [not found]             ` <20031027114006.A66611@xfree86.org>
2003-10-27 19:38               ` Ian Romanick
2003-10-27 21:32                 ` Linus Torvalds
2003-10-27 23:55                   ` Benjamin Herrenschmidt
2003-10-28  2:13                     ` Linus Torvalds
2003-10-28  3:27                       ` Philip Brown
2003-10-28 19:40                       ` James Simmons
2003-10-28 21:35                         ` Benjamin Herrenschmidt
2003-10-28 22:09                           ` Jon Smirl
2003-10-28 22:26                             ` Benjamin Herrenschmidt
2003-10-28 22:54                         ` Linus Torvalds

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=Pine.LNX.4.44.0310232132410.4894-100000@home.osdl.org \
    --to=torvalds@osdl.org \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=eta@lclark.edu \
    --cc=jgarzik@pobox.com \
    --cc=jonsmirl@yahoo.com \
    --cc=kronos@kronoz.cjb.net \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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 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.