From owner-freebsd-arch@FreeBSD.ORG Fri Jul 11 16:41:37 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D350A78 for ; Fri, 11 Jul 2014 16:41:37 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14ECF2D2F for ; Fri, 11 Jul 2014 16:41:37 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D0168B968; Fri, 11 Jul 2014 12:41:35 -0400 (EDT) From: John Baldwin To: johnandsara2@cox.net Subject: Re: How to properly handle several fonctions provided by the Winbond SuperIO chip? Date: Fri, 11 Jul 2014 09:55:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <1118241087.138096.1403180509132.JavaMail.zimbra@arkoon-netasq.com> <53BF23A0.1000603@cox.net> In-Reply-To: <53BF23A0.1000603@cox.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201407110955.55568.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 11 Jul 2014 12:41:35 -0400 (EDT) Cc: Emeric POUPON , freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 16:41:37 -0000 On Thursday, July 10, 2014 7:37:04 pm John D. Hendrickson and Sara Darnell wrote: > John Baldwin wrote: > > On Thursday, June 19, 2014 11:21:59 am Emeric POUPON wrote: > >> Thanks for your answer! > >> > >> I was thinking about calling some parent device functions from the children > > devices in order to perform IO accesses. > >> But I imagine it would be "better" to expose a kind of bus interface from > > the main driver? > >> However, I'm not sure the extra work induced is worth it. What do you think? > > > > I think it's fine to have them call each other directly if they are going to > > all live in the same module. > > > > just wondering > > do you mean fine not to expose a feature ? > > or fine the Winbond chip circuit allows the procedure with no problems ? > > wow i thought winbond io would have been a done deal. wasn't that > released in 1990s ? (rhetorical) No, the question is if you have two C files that are compiled into a single loading object (foo.ko), do they call each other's functions directly or do they use an indirection layer like kobj to call into each other. The indirection layers tend to be both slower and a bit more obfuscated code-wise, so if it is known for sure that these will always be in the same foo.ko, then I think direct calls is cleaner. -- John Baldwin