How to properly handle several fonctions provided by the Winbond SuperIO chip?

Warner Losh imp at bsdimp.com
Mon Jun 23 17:39:09 UTC 2014


On Jun 23, 2014, at 7:56 AM, John Baldwin <jhb at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20140623/e778fb2e/attachment.sig>


More information about the freebsd-arch mailing list