From e44e67333bb835c54a2a66835a13498d4080893f Mon Sep 17 00:00:00 2001 From: Yogesh Date: Wed, 5 Aug 2015 13:36:13 -0700 Subject: gpu: nvgpu: Inject function address from nvgpu This patch inserts the function address of gk20a_debug_dump_device into host data struct once the nvgpu module loads and removes it during unload. Bug 1476801 Change-Id: If49262208325b2aa0807705c26086e6d7c81632c Signed-off-by: Yogesh Bhosale Reviewed-on: http://git-master/r/779397 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 5caef6fe..79240800 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -863,4 +863,6 @@ void gk20a_pbus_isr(struct gk20a *g); int gk20a_user_init(struct platform_device *dev); void gk20a_user_deinit(struct platform_device *dev); +extern void gk20a_debug_dump_device(struct platform_device *pdev); + #endif /* GK20A_H */ diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index 5e07ac55..f8e1e3b7 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c @@ -747,6 +747,10 @@ static int gk20a_tegra_probe(struct platform_device *dev) platform->g->host1x_dev = host1x_pdev; + if (platform->g->host1x_dev) + nvhost_register_dump_device(platform->g->host1x_dev, + gk20a_debug_dump_device); + /* WAR for bug 1547668: Disable railgating and scaling irrespective of * platform data if the rework has not been made. */ @@ -776,6 +780,11 @@ static int gk20a_tegra_late_probe(struct platform_device *dev) static int gk20a_tegra_remove(struct platform_device *dev) { + struct gk20a_platform *platform = gk20a_get_platform(dev); + + if (platform->g->host1x_dev) + nvhost_unregister_dump_device(platform->g->host1x_dev); + /* remove gk20a power subdomain from host1x */ nvhost_unregister_client_domain(dev_to_genpd(&dev->dev)); -- cgit v1.2.2