On Mon, 7 Nov 2022 10:36:36 +0000 Sudeep Holla <sudeep.holla@xxxxxxx> wrote: > On Sun, Nov 06, 2022 at 03:23:07PM +0000, Jonathan Cameron wrote: > > On Tue, 1 Nov 2022 13:21:51 +0100 > > Mårten Lindahl <marten.lindahl@xxxxxxxx> wrote: > > > > > PM runtime is enabled for the parent i2c device, but it is disabled for > > > the iio child device and remains so in this driver. But as the child > > > sysfs PM directory is created by default by iio_device_register => > > > cdev_device_add => dpm_sysfs_add it doesn't bring any value exposing it > > > since it won't give any usable data for the user. > > > > > > Tell dpm_sysfs to not create the PM directory for the iio device. > > > > > > Signed-off-by: Mårten Lindahl <marten.lindahl@xxxxxxxx> > > > > Ah this one.. +CC Sudeep who I am sure has considered such changes in other > > similar cases (he did the original ones that mean this infastructure exists). > > > > Yes it was added for cache devices which are child devices of CPU devices via > Commit 85945c28b5a8 ("PM / core: Add support to skip power management in device/driver model") > > Since CPU and its children are power managed quite differently(via cpuidle > or cpu hotplug), the new API(device_set_pm_not_required) fits the usecase > there well. I am not sure about this IIO usecase. > These are effectively pseudo devices for purposes of the driver model, with parents as the actual physical devices. As such all the PM infrastructure is associate with the appropriate bus specific device rather than the struct iio_dev->dev. So I'm fairly sure we should just not expose the sysfs attributes. This is similar to CXL for which they are only exposed for the PCI devices, not the bunch of subdevices created. Jonathan