Skip to contentSkip to conversation

drm/nouveau/tegra: Skip manual unpowergating when not necessary

PATCH In review Mikko Perttunen 3 participants 5 messages Jun 9, 2017 – Jun 13, 2017 2 messages not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/nouveau/tegra: Skip manual unpowergating when not necessary

On Tegra186, powergating is handled by the BPMP power domain provider and the "legacy" powergating API is not available. Therefore skip these calls if we are attached to a power domain.

---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +6 -4
index 6474bd2a6d07..3d42cdbbe9c0 100644
@@ -51,10 +51,12 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
 	reset_control_assert(tdev->rst);
 	udelay(10);
 
-	ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
-	if (ret)
-		goto err_clamp;
-	udelay(10);
+	if (!tdev->pdev->dev.pm_domain) {
+		ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
+		if (ret)
+			goto err_clamp;
+		udelay(10);
+	}
 
 	reset_control_deassert(tdev->rst);
 	udelay(10);
Signature · 1 line
2.13.0

A message that is not in the archive (sent off-list or not yet received): 20170609122541.31118-1-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw

PATCH 2/3 drm/nouveau/tegra: Don't leave GPU in reset

On Tegra186 systems with certain firmware revisions, leaving the GPU in reset can cause a hang. To prevent this, don't leave the GPU in reset.

---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +0 -3
index 3d42cdbbe9c0..189ed80e21ff 100644
@@ -82,9 +82,6 @@ nvkm_device_tegra_power_down(struct nvkm_device_tegra *tdev)
 {
 	int ret;
 
-	reset_control_assert(tdev->rst);
-	udelay(10);
-
 	clk_disable_unprepare(tdev->clk_pwr);
 	if (tdev->clk_ref)
 		clk_disable_unprepare(tdev->clk_ref);
Signature · 1 line
2.13.0
#3 lore raw

PATCH 3/3 drm/nouveau: Skip vga_fini on non-PCI device

In reply to a message not in the archive

As with vga_init, this function doesn't make sense on non-PCI devices, and the Thunderbolt check in it dereferences a NULL pointer in that case. Add some code to skip this function when the device is not a PCI device.

---
 drivers/gpu/drm/nouveau/nouveau_vga.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/nouveau/nouveau_vga.c +4 -0
index a4aacbc0cec8..b19dd4dc7099 100644
@@ -115,6 +115,10 @@ nouveau_vga_fini(struct nouveau_drm *drm)
 	struct drm_device *dev = drm->dev;
 	bool runtime = false;
 
+	/* only relevant for PCI devices */
+	if (!dev->pdev)
+		return;
+
 	vga_client_register(dev->pdev, NULL, NULL, NULL);
 
 	if (pci_is_thunderbolt_attached(dev->pdev))
Signature · 1 line
2.13.0
#4 lore raw
In reply to a message not in the archive
Quoted 3 lines · Mikko Perttunen

On Tegra186, powergating is handled by the BPMP power domain provider and the "legacy" powergating API is not available. Therefore skip these calls if we are attached to a power domain.

Thanks Mikko,

Taken all 3 patches into my tree.

Ben.

Quoted 18 lines
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +0 -3
index 6474bd2a6d07..3d42cdbbe9c0 100644
@@ -51,10 +51,12 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
 	reset_control_assert(tdev->rst);
 	udelay(10);
 
-	ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
-	if (ret)
-		goto err_clamp;

drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev) · line 62

Quoted 10 lines
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +6 -1
-	udelay(10);
+	if (!tdev->pdev->dev.pm_domain) {
+		ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
+		if (ret)
+			goto err_clamp;
+		udelay(10);
+	}
 
 	reset_control_deassert(tdev->rst);
 	udelay(10);

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

A message that is not in the archive (sent off-list or not yet received): c8569914-3264-bd12-9418-8bdaa4aaa379-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#6 lore raw
Quoted 7 lines · Ben Skeggs
Quoted 3 lines · Mikko Perttunen

On Tegra186, powergating is handled by the BPMP power domain provider and the "legacy" powergating API is not available. Therefore skip these calls if we are attached to a power domain.

Thanks Mikko,

Taken all 3 patches into my tree.

Thanks!

Quoted 32 lines

Ben.

Quoted 28 lines
---
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +6 -4
index 6474bd2a6d07..3d42cdbbe9c0 100644
@@ -51,10 +51,12 @@ nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
 	reset_control_assert(tdev->rst);
 	udelay(10);
 
-	ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
-	if (ret)
-		goto err_clamp;
-	udelay(10);
+	if (!tdev->pdev->dev.pm_domain) {
+		ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D);
+		if (ret)
+			goto err_clamp;
+		udelay(10);
+	}
 
 	reset_control_deassert(tdev->rst);
 	udelay(10);