watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused
authorVignesh Raghavendra <vigneshr@ti.com>
Wed, 13 Dec 2023 14:01:10 +0000 (19:31 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:37 +0000 (15:35 -0800)
commitf2c13661c2a656e8c2985767a582bd1acd1a2327
tree1ed7d1a7fbab7621b83c2c777f1fc3d7ce6faaea
parent57b39f0b07cde8ea4a824213ef1c7d35955048bf
watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused

[ Upstream commit c1a6edf3b541e44e78f10bc6024df779715723f1 ]

Call runtime_pm_put*() if watchdog is not already started during probe and re
enable it in watchdog start as required.

On K3 SoCs, watchdogs and their corresponding CPUs are under same
power-domain, so if the reference count of unused watchdogs aren't
dropped, it will lead to CPU hotplug failures as Device Management
firmware won't allow to turn off the power-domain due to dangling
reference count.

Fixes: 2d63908bdbfb ("watchdog: Add K3 RTI watchdog support")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Tested-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231213140110.938129-1-vigneshr@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/watchdog/rti_wdt.c