All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] secboot/acr352: reset PMU after secboot
@ 2017-07-04 17:35 Karol Herbst
       [not found] ` <20170704173523.5308-1-karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Karol Herbst @ 2017-07-04 17:35 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

This is needed for using Nouveaus PMU image after performing secboot. This will
be helpfull for Maxwell2 reclocking on boards without externally controlled
fans like on most laptops or fanless boards.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
---
 drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
index a7213542..00095ef8 100644
--- a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
+++ b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
@@ -924,6 +924,19 @@ acr_r352_bootstrap(struct acr_r352 *acr, struct nvkm_secboot *sb)
 		}
 	}
 
+	/* reset the PMU if needed */
+	if (acr->base.boot_falcon == NVKM_SECBOOT_FALCON_PMU &&
+	    !nvkm_secboot_is_managed(sb, NVKM_SECBOOT_FALCON_PMU)) {
+		struct nvkm_pmu *pmu = subdev->device->pmu;
+		if (pmu) {
+			ret = nvkm_subdev_init(&pmu->subdev);
+			if (ret < 0) {
+				nvkm_error(subdev, "Failed to reset PMU\n");
+				return ret;
+			}
+		}
+	}
+
 	return 0;
 }
 
-- 
2.13.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] secboot/acr352: reset PMU after secboot
       [not found] ` <20170704173523.5308-1-karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-07-05  1:23   ` Ben Skeggs
       [not found]     ` <85f35af5-8ecc-63be-cd26-6b1566d5b3b0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Skeggs @ 2017-07-05  1:23 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1.1: Type: text/plain, Size: 1523 bytes --]

On 07/05/2017 03:35 AM, Karol Herbst wrote:
> This is needed for using Nouveaus PMU image after performing secboot. This will
> be helpfull for Maxwell2 reclocking on boards without externally controlled
> fans like on most laptops or fanless boards.
I get the idea in principal, but have some concerns:

- Does this screw up re-running secboot during channel recovery (ie.
page fault on gr)?
- What about the running of the unload blob?

It makes me angry that we even have to think about doing stuff like this! :P

Ben.

> 
> Signed-off-by: Karol Herbst <karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
> index a7213542..00095ef8 100644
> --- a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
> +++ b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
> @@ -924,6 +924,19 @@ acr_r352_bootstrap(struct acr_r352 *acr, struct nvkm_secboot *sb)
>  		}
>  	}
>  
> +	/* reset the PMU if needed */
> +	if (acr->base.boot_falcon == NVKM_SECBOOT_FALCON_PMU &&
> +	    !nvkm_secboot_is_managed(sb, NVKM_SECBOOT_FALCON_PMU)) {
> +		struct nvkm_pmu *pmu = subdev->device->pmu;
> +		if (pmu) {
> +			ret = nvkm_subdev_init(&pmu->subdev);
> +			if (ret < 0) {
> +				nvkm_error(subdev, "Failed to reset PMU\n");
> +				return ret;
> +			}
> +		}
> +	}
> +
>  	return 0;
>  }
>  
> 


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] secboot/acr352: reset PMU after secboot
       [not found]     ` <85f35af5-8ecc-63be-cd26-6b1566d5b3b0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-07-05  6:57       ` Karol Herbst
  0 siblings, 0 replies; 3+ messages in thread
From: Karol Herbst @ 2017-07-05  6:57 UTC (permalink / raw)
  To: Ben Skeggs; +Cc: ML nouveau

On Wed, Jul 5, 2017 at 3:23 AM, Ben Skeggs <skeggsb@gmail.com> wrote:
> On 07/05/2017 03:35 AM, Karol Herbst wrote:
>> This is needed for using Nouveaus PMU image after performing secboot. This will
>> be helpfull for Maxwell2 reclocking on boards without externally controlled
>> fans like on most laptops or fanless boards.
> I get the idea in principal, but have some concerns:
>
> - Does this screw up re-running secboot during channel recovery (ie.
> page fault on gr)?
> - What about the running of the unload blob?
>
> It makes me angry that we even have to think about doing stuff like this! :P
>
> Ben.
>

Yeah I know, but this was the best I came up with. In earlier attempts
I only came up with worse solutions.

I think it's technically fine, because nvkm_pmu_init calls
nvkm_pmu_reset and pmu->func->init. In prior versions I've also added
a fini call, but this made nouveau unhappy whenever I reclocked the
GPU and reloaded nouveau afterwards. I could do some more testing
though.

Good thing is that this is only a problem on GM20X GPUs and we only
need a proper solution for those.

>>
>> Signed-off-by: Karol Herbst <karolherbst@gmail.com>
>> ---
>>  drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
>> index a7213542..00095ef8 100644
>> --- a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
>> +++ b/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
>> @@ -924,6 +924,19 @@ acr_r352_bootstrap(struct acr_r352 *acr, struct nvkm_secboot *sb)
>>               }
>>       }
>>
>> +     /* reset the PMU if needed */
>> +     if (acr->base.boot_falcon == NVKM_SECBOOT_FALCON_PMU &&
>> +         !nvkm_secboot_is_managed(sb, NVKM_SECBOOT_FALCON_PMU)) {
>> +             struct nvkm_pmu *pmu = subdev->device->pmu;
>> +             if (pmu) {
>> +                     ret = nvkm_subdev_init(&pmu->subdev);
>> +                     if (ret < 0) {
>> +                             nvkm_error(subdev, "Failed to reset PMU\n");
>> +                             return ret;
>> +                     }
>> +             }
>> +     }
>> +
>>       return 0;
>>  }
>>
>>
>
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-05  6:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-04 17:35 [PATCH] secboot/acr352: reset PMU after secboot Karol Herbst
     [not found] ` <20170704173523.5308-1-karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-05  1:23   ` Ben Skeggs
     [not found]     ` <85f35af5-8ecc-63be-cd26-6b1566d5b3b0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-05  6:57       ` Karol Herbst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.