From owner-freebsd-arch@FreeBSD.ORG Mon Jun 23 17:39:09 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 1DC644CD for ; Mon, 23 Jun 2014 17:39:09 +0000 (UTC) Received: from mail-ie0-f176.google.com (mail-ie0-f176.google.com [209.85.223.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D57B720E8 for ; Mon, 23 Jun 2014 17:39:08 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id rd18so6029999iec.21 for ; Mon, 23 Jun 2014 10:39:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=hZav0meCyGZAJJkf5IHSOeuAM/iRawfZ4l4P0d+3xxE=; b=jxTfRmFUmXTcDFTSXN+Nm+EAeVc4WDjkI7X+yycgz7Gnp8fQVzBqy4R4yl8t9h8aUz zh5URvew5XoPf75CVNK1PylYbCAYRXN3FhJngpRRRlBV1LruFGpwGU+HUaDXAaXHoTvK StdX5DCmQ811Nkh80UmzzKHcbKACJ7FGPRmDKdIqUqNFOGgCMvRLTmDBQVexsL43hAdu lIRhTxbX0fx6mYuNFpfMCUC0o2piXspGeeJJSjAqBTAYBWwCFo9a5KU4muuwRf/w7E06 B2pYz4eNV91rdFICb3khPWO+Fa2fANBEQKfj2iXNff8WkhdBBtPXeUlPt0RAqS8AlKk3 hM6w== X-Gm-Message-State: ALoCoQmHN/mW1lEYlLGYJax3k6BVRM3badcRkL4Xy8QvGkUk1ZOCC6EFqY8WX9TBQEh/dZGAtelI X-Received: by 10.50.28.37 with SMTP id y5mr281430igg.5.1403545142303; Mon, 23 Jun 2014 10:39:02 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id n17sm24716905igk.19.2014.06.23.10.39.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 10:39:01 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_0DF483F6-486F-4E8F-B911-A4D2911C4AAF"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: How to properly handle several fonctions provided by the Winbond SuperIO chip? From: Warner Losh In-Reply-To: <201406230956.48220.jhb@freebsd.org> Date: Mon, 23 Jun 2014 11:38:59 -0600 Message-Id: <0C33F78B-60F2-41A5-92AD-C002EACE312E@bsdimp.com> References: <1118241087.138096.1403180509132.JavaMail.zimbra@arkoon-netasq.com> <201406190919.04443.jhb@freebsd.org> <750618593.166408.1403191319583.JavaMail.zimbra@arkoon-netasq.com> <201406230956.48220.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1878.2) 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: Mon, 23 Jun 2014 17:39:09 -0000 --Apple-Mail=_0DF483F6-486F-4E8F-B911-A4D2911C4AAF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jun 23, 2014, at 7:56 AM, John Baldwin wrote: > On Thursday, June 19, 2014 11:21:59 am Emeric POUPON wrote: >> Thanks for your answer! >>=20 >> I was thinking about calling some parent device functions from the = children=20 > devices in order to perform IO accesses. >> But I imagine it would be "better" to expose a kind of bus interface = from=20 > the main driver? >> However, I'm not sure the extra work induced is worth it. What do you = think? >=20 > I think it's fine to have them call each other directly if they are = going to=20 > all live in the same module. =46rom a pure design point of view, having helpers might be slightly = better. However, given the specialized nature of SuperIO chips, you=92ll likely = get very little reuse of out the more complicated design, so John=92s suggestion = will be a big win. The only time you=92ll likely need to get the parent involved is for = =93shared access=94 situations (some SuperIO chips have banked registers, and you have to = have some kind of locking in place to access them, even if the locking is = done with a grab/ungrab bus paradigm). Warner --Apple-Mail=_0DF483F6-486F-4E8F-B911-A4D2911C4AAF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTqGY0AAoJEGwc0Sh9sBEApr8P/33x5pj34CPTKRIxyYxY2S4m Kc+8UpLfdtNJGfMrfkApjiS+QTDYpeRCuMs1y0yM8fFgleqEONdbxmIi2CQBHIRJ Lo22mNAQQc4HwwbgPZ+lI/uiktMhdIUyaSOqcYtZCEN+Ipy+ukiOevvZwhlRovv7 Zi6QbuafJ4Tp1sjH3WlBfjlD8ZF6mdw9hJ5GrGSr2/WQgH/9Blreb2F4xHhANibj +7Vldp9rx2ZHxRz6aSfg2JITzAs5KT9v5AoW/MnUHt9xYvSmVcQY35bIttVJ4ujm GYyilrToEAa7F5xRDYPrhg8AiyIWkL2UU4lCkVvMBQjJ45hXxXBZvRPwNasSXYMN 7a4fzBO+jaBRZkVN8RxZt6XTCTP7a3Qws2AdswL0vKi8k5r0ygQ5nR+c9/HDJzS2 jNyjOs0mUqIFjXCIY06D+NBbL72IYw5l+n/9xMA17qsqcg3VOqfu+fxlKzRaAhUV mwCagAXL0P1c5dj7pXyBVRIL9Z7bhZAfLv1R1KAREde7ioFKmDNeJIaIYCcrIHWX Jh6pSw1ukBGAHXzI9D3XhIQ40ivCDwYh5ZvSHye0XRKTvhusNOj2Kxda4R4t/Lym osJjZq5XjWWazdEb0P0b68N7QU2LsYAgg2erJNUjSJAhM5at9CAECw+9tMT2DA8c utLxlgFWR+V7LGHsUSJv =Wo6a -----END PGP SIGNATURE----- --Apple-Mail=_0DF483F6-486F-4E8F-B911-A4D2911C4AAF--