From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Deucher, Alexander" Subject: Re: [PATCH] drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset Date: Mon, 19 Nov 2018 20:26:17 +0000 Message-ID: References: <1542318992-12464-1-git-send-email-Felix.Kuehling@amd.com> , Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0777635485==" Return-path: In-Reply-To: Content-Language: en-US List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: "Kuehling, Felix" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" Cc: Joerg Roedel --===============0777635485== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN6PR12MB1809FF355A404034F416D304F7D80BN6PR12MB1809namp_" --_000_BN6PR12MB1809FF355A404034F416D304F7D80BN6PR12MB1809namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I'll grab it for my -fixes pull this week. Alex ________________________________ From: Kuehling, Felix Sent: Monday, November 19, 2018 3:02:27 PM To: Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Cc: Joerg Roedel Subject: Re: [PATCH] drm/amdgpu: Fix oops when pp_funcs->switch_power_profi= le is unset I pushed the change to amd-staging-drm-next. I'd also like to get it into drm-fixes. Should I cherry-pick it to your drm-fixes-4.20 branch on fd.o? Thanks, Felix On 2018-11-15 4:59 p.m., Deucher, Alexander wrote: > > Reviewed-by: Alex Deucher > > ------------------------------------------------------------------------ > *From:* amd-gfx on behalf of > Kuehling, Felix > *Sent:* Thursday, November 15, 2018 4:56:51 PM > *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > *Cc:* Kuehling, Felix; Joerg Roedel > *Subject:* [PATCH] drm/amdgpu: Fix oops when > pp_funcs->switch_power_profile is unset > > On Vega20 and other pre-production GPUs, powerplay is not enabled yet. > Check for NULL pointers before calling pp_funcs function pointers. > > Also affects Kaveri. > > CC: Joerg Roedel > Signed-off-by: Felix Kuehling > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > index a9c7597..1c1fed6 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > @@ -503,8 +503,11 @@ void amdgpu_amdkfd_set_compute_idle(struct > kgd_dev *kgd, bool idle) > { > struct amdgpu_device *adev =3D (struct amdgpu_device *)kgd; > > - amdgpu_dpm_switch_power_profile(adev, > - PP_SMC_POWER_PROFILE_COMPUTE, > !idle); > + if (adev->powerplay.pp_funcs && > + adev->powerplay.pp_funcs->switch_power_profile) > + amdgpu_dpm_switch_power_profile(adev, > + > PP_SMC_POWER_PROFILE_COMPUTE, > + !idle); > } > > bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid) > -- > 2.7.4 > > _______________________________________________ > amd-gfx mailing list > amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx --_000_BN6PR12MB1809FF355A404034F416D304F7D80BN6PR12MB1809namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I'll grab it for my -fixes pull t= his week.


Alex


From: Kuehling, Felix
Sent: Monday, November 19, 2018 3:02:27 PM
To: Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Joerg Roedel
Subject: Re: [PATCH] drm/amdgpu: Fix oops when pp_funcs->switch_p= ower_profile is unset
 
I pushed the change to amd-staging-drm-next. I'd a= lso like to get it
into drm-fixes. Should I cherry-pick it to your drm-fixes-4.20 branch on fd.o?


Thanks,
  Felix


On 2018-11-15 4:59 p.m., Deucher, Alexander wrote:
>
> Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>
> ----------------------------------------------------------------------= --
> *From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behal= f of
> Kuehling, Felix <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
> *Sent:* Thursday, November 15, 2018 4:56:51 PM
> *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> *Cc:* Kuehling, Felix; Joerg Roedel
> *Subject:* [PATCH] drm/amdgpu: Fix oops when
> pp_funcs->switch_power_profile is unset
>  
> On Vega20 and other pre-production GPUs, powerplay is not enabled yet.=
> Check for NULL pointers before calling pp_funcs function pointers.
>
> Also affects Kaveri.
>
> CC: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>
> Signed-off-by: Felix Kuehling <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++&#= 43;+--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> index a9c7597..1c1fed6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> @@ -503,8 +503,11 @@ void amdgpu_amdkfd_set_compute_idle(struct > kgd_dev *kgd, bool idle)
>  {
>          struct amdgpu_device = *adev =3D (struct amdgpu_device *)kgd;
>  
> -       amdgpu_dpm_switch_power_profile(= adev,
> -           &nb= sp;            =             &nb= sp;  PP_SMC_POWER_PROFILE_COMPUTE,
> !idle);
> +       if (adev->powerplay.pp_fu= ncs &&
> +           adev= ->powerplay.pp_funcs->switch_power_profile)
> +           = ;    amdgpu_dpm_switch_power_profile(adev,
> +           = ;            &n= bsp;            = ;          
> PP_SMC_POWER_PROFILE_COMPUTE,
> +           = ;            &n= bsp;            = ;           !idle);
>  }
>  
>  bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 v= mid)
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> htt= ps://lists.freedesktop.org/mailman/listinfo/amd-gfx
--_000_BN6PR12MB1809FF355A404034F416D304F7D80BN6PR12MB1809namp_-- --===============0777635485== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============0777635485==--