Skip to contentSkip to conversation

platform: release IOMMU's mm upon exit

PATCH New Alexandre Courbot 1 participant 3 messages Mar 20, 2015 1 message not in the archive Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 platform: release IOMMU's mm upon exit

nvkm_mm_fini() was not called when exiting the driver, resulting in a memory leak. Fix this.

---
 drm/nouveau/nouveau_platform.c | 1 +
 1 file changed, 1 insertion(+)
drm/nouveau/nouveau_platform.c +1 -0
index 3691982452a9..f83aa12ee5c6 100644
@@ -152,6 +152,7 @@ static void nouveau_platform_remove_iommu(struct device *dev,
 					  struct nouveau_platform_gpu *gpu)
 {
 	if (gpu->iommu.domain) {
+		nvkm_mm_fini(&gpu->iommu._mm);
 		iommu_detach_device(gpu->iommu.domain, dev);
 		iommu_domain_free(gpu->iommu.domain);
 	}
Signature · 6 lines
2.3.3

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1426848066-13700-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw

PATCH 2/3 platform: fix probe error path

A "return 0" found its way in the middle of the error path of nouveau_platform_probe(), remove it as it will make the kernel crash if we try to unload the module afterwards.

While we are at it, also remove the IOMMU domain if it has been created, as we should.

---
 drm/nouveau/nouveau_platform.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drm/nouveau/nouveau_platform.c +1 -2
index f83aa12ee5c6..775277f1edb0 100644
@@ -209,10 +209,9 @@ static int nouveau_platform_probe(struct platform_device *pdev)
 err_unref:
 	drm_dev_unref(drm);
 
-	return 0;
-
 power_down:
 	nouveau_platform_power_down(gpu);
+	nouveau_platform_remove_iommu(&pdev->dev, gpu);
 
 	return err;
 }
Signature · 1 line
2.3.3
#3 lore raw

PATCH 3/3 pmu/gk20a: add some missing statics

In reply to a message not in the archive

Make static a few functions and structures that should be.

---
 drm/nouveau/nvkm/subdev/pmu/gk20a.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drm/nouveau/nvkm/subdev/pmu/gk20a.c +4 -3
index a49934bbe637..594f746e68f2 100644
@@ -159,7 +159,7 @@ resched:
 	nvkm_timer_alarm(priv, 100000000, alarm);
 }
 
-int
+static int
 gk20a_pmu_fini(struct nvkm_object *object, bool suspend)
 {
 	struct nvkm_pmu *pmu = (void *)object;
@@ -170,7 +170,7 @@ gk20a_pmu_fini(struct nvkm_object *object, bool suspend)
 	return nvkm_subdev_fini(&pmu->base, suspend);
 }
 
-int
+static int
 gk20a_pmu_init(struct nvkm_object *object)
 {
 	struct nvkm_pmu *pmu = (void *)object;
@@ -192,7 +192,8 @@ gk20a_pmu_init(struct nvkm_object *object)
 	return ret;
 }
 
-struct gk20a_pmu_dvfs_data gk20a_dvfs_data= {
+static struct gk20a_pmu_dvfs_data
+gk20a_dvfs_data= {
 	.p_load_target = 70,
 	.p_load_max = 90,
 	.p_smooth = 1,
Signature · 6 lines
2.3.3

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau