Mikko Perttunen
2017-Jun-09 12:25 UTC
[Nouveau] [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. Signed-off-by: Mikko Perttunen <mperttunen at nvidia.com> --- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c index 6474bd2a6d07..3d42cdbbe9c0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c @@ -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); -- 2.13.0
Mikko Perttunen
2017-Jun-09 12:25 UTC
[Nouveau] [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. Signed-off-by: Mikko Perttunen <mperttunen at nvidia.com> --- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c index 3d42cdbbe9c0..189ed80e21ff 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c @@ -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); -- 2.13.0
Mikko Perttunen
2017-Jun-09 12:25 UTC
[Nouveau] [PATCH 3/3] drm/nouveau: Skip vga_fini on non-PCI device
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. Signed-off-by: Mikko Perttunen <mperttunen at nvidia.com> --- drivers/gpu/drm/nouveau/nouveau_vga.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index a4aacbc0cec8..b19dd4dc7099 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vga.c +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c @@ -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)) -- 2.13.0
Ben Skeggs
2017-Jun-12 22:52 UTC
[Nouveau] [PATCH 1/3] drm/nouveau/tegra: Skip manual unpowergating when not necessary
On 06/09/2017 10:25 PM, Mikko Perttunen wrote:> 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.> > Signed-off-by: Mikko Perttunen <mperttunen at nvidia.com> > --- > drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c > index 6474bd2a6d07..3d42cdbbe9c0 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c > @@ -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); >-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20170613/a9bebbd1/attachment.sig>
Mikko Perttunen
2017-Jun-13 12:43 UTC
[Nouveau] [PATCH 1/3] drm/nouveau/tegra: Skip manual unpowergating when not necessary
On 13.06.2017 01:52, Ben Skeggs wrote:> On 06/09/2017 10:25 PM, Mikko Perttunen wrote: >> 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!> > Ben. > >> >> Signed-off-by: Mikko Perttunen <mperttunen at nvidia.com> >> --- >> drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 10 ++++++---- >> 1 file changed, 6 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c >> index 6474bd2a6d07..3d42cdbbe9c0 100644 >> --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c >> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c >> @@ -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); >> >
Apparently Analagous Threads
- [PATCH 1/3] drm/nouveau/tegra: Skip manual unpowergating when not necessary
- [PATCH 1/11] ARM: tegra: add function to control the GPU rail clamp
- [PATCH v3 1/3] drm/nouveau: support for probing platform devices
- [PATCH 1/11] ARM: tegra: add function to control the GPU rail clamp
- [PATCH 1/11] ARM: tegra: add function to control the GPU rail clamp