Re: [Discussion] Global vs Local devicetree overlays for addon board + connector setups

From: Ayush Singh
Date: Sun May 04 2025 - 09:00:57 EST



On 5/4/25 18:20, Greg Kroah-Hartman wrote:
On Sun, May 04, 2025 at 06:03:26PM +0530, Ayush Singh wrote:
It depends on the bus the device is added.
when an overlay is applied by the kernel, OF_RECONFIG_* events are
triggered. Some buses handle them:

$ git grep OF_RECONFIG_CHANGE
drivers/bus/imx-weim.c: case OF_RECONFIG_CHANGE_ADD:
drivers/bus/imx-weim.c: case OF_RECONFIG_CHANGE_REMOVE:
drivers/gpio/gpiolib-of.c: case OF_RECONFIG_CHANGE_ADD:
drivers/gpio/gpiolib-of.c: case OF_RECONFIG_CHANGE_REMOVE:
drivers/i2c/i2c-core-of.c: case OF_RECONFIG_CHANGE_ADD:
drivers/i2c/i2c-core-of.c: case OF_RECONFIG_CHANGE_REMOVE:
drivers/of/dynamic.c: * Return: OF_RECONFIG_CHANGE_REMOVE on device going from enabled to
drivers/of/dynamic.c: * disabled, OF_RECONFIG_CHANGE_ADD on device going from disabled to
drivers/of/dynamic.c: return new_state ? OF_RECONFIG_CHANGE_ADD : OF_RECONFIG_CHANGE_REMOVE;
drivers/of/platform.c: case OF_RECONFIG_CHANGE_ADD:
drivers/of/platform.c: case OF_RECONFIG_CHANGE_REMOVE:
drivers/spi/spi.c: case OF_RECONFIG_CHANGE_ADD:
drivers/spi/spi.c: case OF_RECONFIG_CHANGE_REMOVE:
include/linux/of.h: OF_RECONFIG_CHANGE_ADD,
include/linux/of.h: OF_RECONFIG_CHANGE_REMOVE,

Well, if some bus does handle the event, I guess it is a bug in the
subsystems that do not? Maybe Greg Kroah-Hartman can clarify the expected
behavior here? Maybe we are in transition phase here.
Perhaps those other busses just do not have OF devices and so they never
needed to add that functionality to them?

If they do, then by all means add that code. OF devices are not
possible for many bus types, so there shouldn't be a need to add this to
the driver core, right?

thanks,

greg k-h


UART devices are pretty common in both Beagle capes and MikroBUS. So I think that will probably need to be added at some point.


Ayush Singh