Re: How to expose various BMC chip controls ?

From: Benjamin Herrenschmidt
Date: Tue Apr 10 2018 - 10:53:34 EST


On Tue, 2018-04-10 at 15:06 +0200, Arnd Bergmann wrote:
> On Tue, Apr 10, 2018 at 2:57 PM, Benjamin Herrenschmidt
> <benh@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Tue, 2018-04-10 at 13:29 +0200, Arnd Bergmann wrote:
> > > In the cases where an ad-hoc interface is needed, I can see
> > > two options: we can stick something in drivers/soc that exposes
> > > it in the least ugly way, completely specific to that particular
> > > SoC, or we can create a new subsystem from "random BMC
> > > slave-side interfaces" and have it maintained by you all (leave
> > > me out of the picture, except if you are looking for ideas).
> >
> > I don't think there enough commonality in these things to create a "BMC
> > slave interface" class that is anything other than a bunch of sysfs
> > files.
> >
> > That's why I ended up with my personal conclusion/preference of just
> > having the syscon "driver" for the SoC just expose a table of a dozen
> > or so such knobs, and use the DT to describe them to abstract a bit the
> > difference between SoC models/revisions and how they are wired up in a
> > given platform.
>
> The idea with having a subsystem for it would be to group stuff together
> in one directory and have that owned by people that care about it,
> even if there is little commonality between the things it's used for.

Ok, so we could use a subsystem as a grouping method in sysfs, that
does make some amount of sense ;-)

That said, fundamentally, it is going to be exposed by whatever creates
the syscon for the SoC, so yes, a "SoC" driver is probably the right
thing to instanciate that thing, as those knobs are very much SoC
specific. Though I do want to keep the actual definition DT based at
least for Aspeed.

As for finding the commonalities, the connundrum here is that we juts
don't have enough experience of platforms with different kinds of BMCs
to do that (provided there's anything to find).

So we can wait a few years until we do and keep out-of-tree crap
drivers, or just solve the immediate problem in a semi-reasonable way,
and maybe make things evolve as we get more SoC's into the picture.

My issue right now is that we need products out of the door (and not
just we IBM, but everybody using OpenBMC) and we are just carrying
various horrid out of tree hacks to do so, and that needs urgent
fixing.

The main worry I have with my own idea here is that it's too easily
abused for things that shouldn't get in there. But I can't find a way
around that, we'll just have to be vigilant I suppose...

Cheers,
Ben.