The common solution to support bind/unbind the hwmon driver base on the host state.

Matt Spinler mspinler at linux.ibm.com
Tue Apr 6 01:06:14 AEST 2021



On 4/2/2021 2:52 AM, Thu Nguyen OS wrote:
> I thought that OpenBmc community have to have the solution for this.
> I can propose my solution but I don't think it is common enough.

I haven't seen any code that does a bind/unbind on power on, so I would 
welcome your solution being upstreamed.  We put similar functionality 
into phosphor-gpio-presence that can bind/unbind around presence 
detection where the drivers are also listed in a config file.


>
> Regards,
> Thu Nguyen.
>
> On 31/03/2021, 23:14, "Joseph Reynolds" <jrey at linux.ibm.com> wrote:
>
>      On 3/30/21 9:14 PM, Thu Nguyen OS wrote:
>      > Hi All, Currently, In Mtjade platform of Ampere, we have SMPro mdf
>      > drivers (SMPro hwmon, SMPro errmon, SMPro misc driver). The drivers
>      > will be loaded by kernel when the BMC boot up. But they are only
>      > binded when the host is already On. ‍ ‍ ‍ ‍
>      >
>      > Hi All,
>      >
>      > Currently, In Mtjade platform of Ampere, we have SMPro mdf drivers
>      > (SMPro hwmon, SMPro errmon, SMPro misc driver).
>      >
>      > The drivers will be loaded by kernel when the BMC boot up. But they
>      > are only binded when the host is already On.
>      >
>      > They are also unbinded when the host is Off.
>      >
>      > To support binding/unbinding the SMPro drivesr, we have one service
>      > name driver-binder.
>      >
>      >  1. When the Dbus property CurrentHostState of service
>      >     xyz.openbmc_project.State.Host changes to “not Off”, we will bind
>      >     the drivers.
>      >  2. When the Dbus property RequestedHostTransition of service
>      >     xyz.openbmc_project.State.Host OR Dbus property
>      >     RequestedPowerTransition of xyz.openbmc_project.State.Chassis
>      >
>      > change to Off, we will unbind the drivers.
>      >
>      > The driver-binder is working as expected, it have the configuration
>      > file to configure which drivers will be binded/unbinded.
>      >
>      > But that is our solution.
>      >
>      > Do we have any common solution to do that job?
>      >
>
>      Thu,
>
>      I don't have a solution.  But I do want to be able to bind and unbind
>      drivers for the BMC-attached USB ports (as the underlying mechanism when
>      the BMC admin disables the ports), so I think it would be good to have a
>      common solution or understand the best practices.
>
>      Joseph
>
>      > Regards.
>      >
>      > Thu Nguyen.
>      >
>
>



More information about the openbmc mailing list