From 7bd013d4c0ebdafbdb300d562f24737e0d3e583c Mon Sep 17 00:00:00 2001 From: Sai Gurrappadi Date: Tue, 3 Oct 2017 17:35:33 -0700 Subject: video: tegra: host: Fix up cluster power clamps Some host1x clients require cluster power clamps to be applied before executing any cluster wide power sequences (eg: railgating). Currently this is implemented by client modules via pre_poweron() and prepare_poweroff(). However, things end up breaking badly if the finalize_poweron() calls for the client fail. The subsequent error paths can end up causing mismatches in the cluster clamp ref counts. Fix this by implementing cluster power clamp support explicitly in nvhost. All clamp operations therefore remain in sync. Bug 200352108 Change-Id: I70f47ed33814f25b81f17045248954468e929c73 Signed-off-by: Sai Gurrappadi Reviewed-on: https://git-master.nvidia.com/r/1572791 Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/linux/nvhost.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h index 20793c850..14db3b700 100644 --- a/include/linux/nvhost.h +++ b/include/linux/nvhost.h @@ -265,8 +265,12 @@ struct nvhost_device_data { struct rw_semaphore busy_lock; bool forced_idle; - /* Used to run any device specific code before module poweron */ - void (*pre_poweron)(struct platform_device *dev); + /* + * Used to clamp/unclamp clusters across any cluster power sequences. + * The clamp is applied after poweroff and unclamp prior to poweron. + */ + void (*cluster_unclamp)(struct platform_device *dev); + void (*cluster_clamp)(struct platform_device *dev); /* Finalize power on. Can be used for context restore. */ int (*finalize_poweron)(struct platform_device *dev); -- cgit v1.2.2