[Nouveau] [PATCH 5/5] pci: restore the boot pcie link speed on fini

Lyude Paul lyude at redhat.com
Tue May 7 19:44:50 UTC 2019


I think it should be fine to just squash this and the previous patch together.
If not, longer commit message here at least

up to you, either way: Reviewed-by: Lyude Paul <lyude at redhat.com>

On Sat, 2019-05-04 at 18:32 +0200, Karol Herbst wrote:
> fixes runtime suspend on my gp107
> 
> Signed-off-by: Karol Herbst <kherbst at redhat.com>
> ---
>  drm/nouveau/nvkm/subdev/pci/base.c | 2 ++
>  drm/nouveau/nvkm/subdev/pci/pcie.c | 8 ++++++++
>  drm/nouveau/nvkm/subdev/pci/priv.h | 1 +
>  3 files changed, 11 insertions(+)
> 
> diff --git a/drm/nouveau/nvkm/subdev/pci/base.c
> b/drm/nouveau/nvkm/subdev/pci/base.c
> index b6ebee6f..d9fb5a83 100644
> --- a/drm/nouveau/nvkm/subdev/pci/base.c
> +++ b/drm/nouveau/nvkm/subdev/pci/base.c
> @@ -90,6 +90,8 @@ nvkm_pci_fini(struct nvkm_subdev *subdev, bool suspend)
>  
>  	if (pci->agp.bridge)
>  		nvkm_agp_fini(pci);
> +	else if (pci_is_pcie(pci->pdev))
> +		nvkm_pcie_fini(pci);
>  
>  	return 0;
>  }
> diff --git a/drm/nouveau/nvkm/subdev/pci/pcie.c
> b/drm/nouveau/nvkm/subdev/pci/pcie.c
> index 727b5d6a..00c07fd8 100644
> --- a/drm/nouveau/nvkm/subdev/pci/pcie.c
> +++ b/drm/nouveau/nvkm/subdev/pci/pcie.c
> @@ -118,6 +118,14 @@ nvkm_pcie_init(struct nvkm_pci *pci)
>  	return 0;
>  }
>  
> +int
> +nvkm_pcie_fini(struct nvkm_pci *pci)
> +{
> +	if (!IS_ERR_VALUE(pci->pcie.def_speed))
> +		return nvkm_pcie_set_link(pci, pci->pcie.def_speed, 16);
> +	return 0;
> +}
> +
>  int
>  nvkm_pcie_set_link(struct nvkm_pci *pci, enum nvkm_pcie_speed speed, u8
> width)
>  {
> diff --git a/drm/nouveau/nvkm/subdev/pci/priv.h
> b/drm/nouveau/nvkm/subdev/pci/priv.h
> index dc3ae3cd..e7744671 100644
> --- a/drm/nouveau/nvkm/subdev/pci/priv.h
> +++ b/drm/nouveau/nvkm/subdev/pci/priv.h
> @@ -62,4 +62,5 @@ int gk104_pcie_version_supported(struct nvkm_pci *);
>  int nvkm_pcie_oneinit(struct nvkm_pci *);
>  int nvkm_pcie_preinit(struct nvkm_pci *);
>  int nvkm_pcie_init(struct nvkm_pci *);
> +int nvkm_pcie_fini(struct nvkm_pci *);
>  #endif
-- 
Cheers,
	Lyude Paul



More information about the Nouveau mailing list