[PATCH linux dev-4.10] aspeed_g5_defconfig: add CONFIG_OF_DYNAMIC.

Mykola Kostenok c_mykolak at mellanox.com
Thu Aug 10 01:09:51 AEST 2017


> -----Original Message-----
> From: Michael Ellerman [mailto:mpe at ellerman.id.au]
> Sent: Wednesday, August 9, 2017 4:01 PM
> To: Mykola Kostenok <c_mykolak at mellanox.com>; Joel Stanley
> <joel at jms.id.au>
> Cc: OpenBMC Maillist <openbmc at lists.ozlabs.org>; Vadim Pasternak
> <vadimp at mellanox.com>; Ohad Oz <ohado at mellanox.com>; Benjamin
> Herrenschmidt <benh at kernel.crashing.org>; Jeremy Kerr <jk at ozlabs.org>
> Subject: RE: [PATCH linux dev-4.10] aspeed_g5_defconfig: add
> CONFIG_OF_DYNAMIC.
> 
> Mykola Kostenok <c_mykolak at mellanox.com> writes:
> >> -----Original Message-----
> >> From: joel.stan at gmail.com [mailto:joel.stan at gmail.com] On Behalf Of
> >> Joel >> Stanley
> >>
> >> Can you explain what you're wanting to do here?
> >>
> >> I've added some of our device tree experts to cc so they can offer advice.
> >
> > Hi, Joel.
> >
> > We have now patchset supporting our CPLD device in upstream review.
> > There we have support for dynamic (hotplug) devices, like PSUs, FANs,
> ASIC, etc.
> >
> ...
> >
> > They all sets with the state "disabled", and driver activates it with the
> below calls, when related hotplug event is received in interrupt handler:
> >
> > static struct property mlxreg_core_device_dis = {
> > 	.name = MLXREG_CORE_PROP_STATUS,
> > 	.value = MLXREG_CORE_PROP_DISABLED,
> > 	.length = sizeof(MLXREG_CORE_PROP_DISABLED),
> > };
> >
> > static void mlxreg_core_dev_enable(struct device_node *np) {
> > 	/* Enable and create device. */
> > 	of_update_property(np, &mlxreg_core_device_en); }
> >
> > static void mlxreg_core_dev_disable(struct device_node *np) {
> > 	/* Disable and unregister platform device. */
> > 	of_update_property(np, &mlxreg_core_device_dis);
> > 	of_node_clear_flag(np, OF_POPULATED); }
> >
> > For that we must have OF_DYNAMIC set, and last one required
> OF_UNITEST.
> 
> But are you actually changing the structure of the device tree at run time?
> 
> If all you're doing is using of_update_property() to change the status
> property I don't think you need OF_DYNAMIC.
> 
> cheers

Hi, Michael.

In drivers/i2c/i2c-core.c:

#if IS_ENABLED(CONFIG_OF_DYNAMIC)
static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
			 void *arg)
So we need it.

Best regards. Mykola Kostenok.


More information about the openbmc mailing list