From owner-freebsd-hackers Sat May 27 14:23:46 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from front6.grolier.fr (front6.grolier.fr [194.158.96.56]) by hub.freebsd.org (Postfix) with ESMTP id E3E9737B9FE for ; Sat, 27 May 2000 14:23:37 -0700 (PDT) (envelope-from groudier@club-internet.fr) Received: from ppp-169-224.villette.club-internet.fr (ppp-169-224.villette.club-internet.fr [195.36.169.224]) by front6.grolier.fr (8.9.3/No_Relay+No_Spam_MGC990224) with ESMTP id XAA26054; Sat, 27 May 2000 23:23:12 +0200 (MET DST) Date: Sat, 27 May 2000 22:59:31 +0200 (CEST) From: =?ISO-8859-1?Q?G=E9rard_Roudier?= X-Sender: groudier@linux.local To: Jeroen Ruigrok van der Werven Cc: Dennis , John Hay , hackers@FreeBSD.ORG Subject: Re: 4.0 - Isa devices not being probed In-Reply-To: <20000527215735.A43304@lucifer.bart.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 27 May 2000, Jeroen Ruigrok van der Werven wrote: > -On [20000527 21:06], Dennis (dennis@etinc.com) wrote: > > > >Its seems rather humorous that the "generic" bus implementation requires > >that isa drivers be hacked into the kernel with a build-time include. Ve= ry > >humorous indeed. Is this a temporary condition as was the deboggle in v3= =2E0? >=20 > Yeah I laugh my ass off. You figure out at what or whom. Hmmm... When I see all those bus abstractions floating around in different O/Ses, I donnot laugh at all, but I am sad. In order to work correctly, it is the concrete device driver that must be aware of what actually happens about IO and DMA. Thinking that generic bus abstraction can be clever enough to deal with all that is a serious mistake in my opinion. A device support is a pair that consists in a software driver + a device that may incorporate firmware, and both parts may need to have some consistant view of some data in some place in order to work correctly. Existing bus abstractions tend to let think that the same software driver can deal with different buses, bridges or IO methods without having to care about how these things actually behave, notably regarding buffering and ordering rules. This is untrue. Existing bus abstractions may let driver writer think that everything that addresses bridges, bus specific and arch specific properties is handled transparently given that the right abstract method is called in the right place. This is untrue. Existing bus transactions may let think that driver writers donnot have=20 to care with ordering rules and coherency issues between transactions in=20 both directions targetting device and memory. This is untrue. I donnot know how the right bus generic abstraction could be, but for now, all those I saw donnot look statisfying to me, and it seems to me that they may lead to having numerous quite aesthetic drivers that are just broken due to driver (writer?) relying too much on some supposed=20 generic cleverness of the bus abstraction that does not happen.=20 When some weak memory ordering is involved, the only way to make things right and not too sub-optimal is to insert explicit barriers in the driver code. Flushing everything after the IO from the 'bus write/read' abstraction is broken. For example, if I want a WRITE TO MEMORY followed by a WRITE TO AN IO REGISTER performed from the C code to be seen consistently from the device (bus), most IO abstractions I have seen will do the bad work by just performing a memory barrier (or some additionnal barrier) after the WRITE TO THE IO REGISTER. If driver writer is not aware of this kind of subtleties, very ennoying bugs will be generated all around, in my opinion. G=E9rard. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message