Date: Mon, 23 Jun 2014 11:38:59 -0600 From: Warner Losh <imp@bsdimp.com> To: John Baldwin <jhb@FreeBSD.org> Cc: Emeric POUPON <emeric.poupon@arkoon-netasq.com>, freebsd-arch@freebsd.org Subject: Re: How to properly handle several fonctions provided by the Winbond SuperIO chip? Message-ID: <0C33F78B-60F2-41A5-92AD-C002EACE312E@bsdimp.com> In-Reply-To: <201406230956.48220.jhb@freebsd.org> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Jun 23, 2014, at 7:56 AM, John Baldwin <jhb@FreeBSD.org> 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. From a pure design point of view, having helpers might be slightly better. However, given the specialized nature of SuperIO chips, you’ll likely get very little reuse of out the more complicated design, so John’s suggestion will be a big win. The only time you’ll likely need to get the parent involved is for “shared access” 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 [-- Attachment #2 --] -----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0C33F78B-60F2-41A5-92AD-C002EACE312E>
