From owner-freebsd-arch@FreeBSD.ORG Wed Jan 21 14:19:06 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACF2A1065BCD for ; Wed, 21 Jan 2009 14:19:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3948FC29 for ; Wed, 21 Jan 2009 14:19:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 29B4746B17; Wed, 21 Jan 2009 09:19:06 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n0LEIsoG033505; Wed, 21 Jan 2009 09:19:00 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Wed, 21 Jan 2009 08:47:05 -0500 User-Agent: KMail/1.9.7 References: <20081229212020.GA1809@curry.mchp.siemens.de> <20081229143221.X1076@desktop> In-Reply-To: <20081229143221.X1076@desktop> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901210847.05858.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 21 Jan 2009 09:19:00 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8884/Wed Jan 21 08:15:32 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Andre Albsmeier Subject: Re: Two drivers, one physical device: How to deal with that? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 14:19:09 -0000 On Monday 29 December 2008 7:35:21 pm Jeff Roberson wrote: > On Mon, 29 Dec 2008, Andre Albsmeier wrote: > > > Hello, > > > > I have written a driver which attaches to the host bridge in > > order to periodically read the appropriate registers and > > inform the user about ECC errors (ECC-Monitor). No I have > > run across a mainboard where the host bridge is already > > taken by the agp driver. Of course, I can detach the agp > > driver and attach myself and everything is working but > > what is if someone does not want to loose the agp > > functionality? > > > > How does one deal with the case when two separate drivers > > have to access the same device (the host bridge in my case)? > > > > I assume, the correct way would be to join the AGP and > > ECC functionality in one driver but maybe there are other > > tricks I am not aware of? > > Well I don't think it would be correct to merge two conceptually seperate > drivers into one just to share the same device. It sounds like the right > solution is to make a generic layer the attaches to the host bridge and > arbitrates access to it. Then allow other device to find and communicate > with this generic layer. For the host bridge this doesn't have to be > particularly fancy. This is already the case in 7.0 and later where hostb(4) always attaches to host bridges and agp(4) attaches to the hostb(4) devices. -- John Baldwin