linux-stable/drivers/devfreq
Leonard Crestez 0ef7c7cce4 PM / devfreq: passive: Use non-devm notifiers
The devfreq passive governor registers and unregisters devfreq
transition notifiers on DEVFREQ_GOV_START/GOV_STOP using devm wrappers.

If devfreq itself is registered with devm then a warning is triggered on
rmmod from devm_devfreq_unregister_notifier. Call stack looks like this:

	devm_devfreq_unregister_notifier+0x30/0x40
	devfreq_passive_event_handler+0x4c/0x88
	devfreq_remove_device.part.8+0x6c/0x9c
	devm_devfreq_dev_release+0x18/0x20
	release_nodes+0x1b0/0x220
	devres_release_all+0x78/0x84
	device_release_driver_internal+0x100/0x1c0
	driver_detach+0x4c/0x90
	bus_remove_driver+0x7c/0xd0
	driver_unregister+0x2c/0x58
	platform_driver_unregister+0x10/0x18
	imx_devfreq_platdrv_exit+0x14/0xd40 [imx_devfreq]

This happens because devres_release_all will first remove all the nodes
into a separate todo list so the nested devres_release from
devm_devfreq_unregister_notifier won't find anything.

Fix the warning by calling the non-devm APIS for frequency notification.
Using devm wrappers is not actually useful for a governor anyway: it
relies on the devfreq core to correctly match the GOV_START/GOV_STOP
notifications.

Fixes: 996133119f ("PM / devfreq: Add new passive governor")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
2019-08-25 12:47:31 +09:00
..
event PM / devfreq: events: extend events by type of counted data 2019-08-25 12:44:38 +09:00
devfreq-event.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
devfreq.c PM / devfreq: Correct devm_devfreq_remove_device() documentation 2019-08-25 12:45:34 +09:00
exynos-bus.c PM / devfreq: exynos-bus: Convert to use dev_pm_opp_set_rate() 2019-08-25 12:46:48 +09:00
governor.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
governor_passive.c PM / devfreq: passive: Use non-devm notifiers 2019-08-25 12:47:31 +09:00
governor_performance.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
governor_powersave.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
governor_simpleondemand.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
governor_userspace.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Kconfig PM / devfreq: tegra20: add COMMON_CLK dependency 2019-08-24 20:11:12 +09:00
Makefile PM / devfreq: Introduce driver for NVIDIA Tegra20 2019-08-24 20:11:12 +09:00
rk3399_dmc.c PM / devfreq: rk3399_dmc: Fix spelling typo 2019-08-24 20:11:12 +09:00
tegra20-devfreq.c PM / devfreq: Introduce driver for NVIDIA Tegra20 2019-08-24 20:11:12 +09:00
tegra30-devfreq.c PM / devfreq: tegra: Rename tegra-devfreq.c to tegra30-devfreq.c 2019-08-24 20:11:12 +09:00