Re: [PATCH v1] drivers/amd/kv_dpm: check the return value of amdgpu_kv_smc_bapm_enable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 22, 2022 at 8:04 PM Lazar, Lijo <lijo.lazar@xxxxxxx> wrote:
>
>
>
> On 9/23/2022 1:36 AM, Li Zhong wrote:
> > Check the return value of amdgpu_kv_smc_bapm_enable() and log the error
> > when it fails.
> >
> > Signed-off-by: Li Zhong <floridsleeves@xxxxxxxxx>
> > ---
> >   drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> > index 8fd0782a2b20..d392256effe2 100644
> > --- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> > +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> > @@ -1384,13 +1384,16 @@ static int kv_dpm_enable(struct amdgpu_device *adev)
> >   static void kv_dpm_disable(struct amdgpu_device *adev)
> >   {
> >       struct kv_power_info *pi = kv_get_pi(adev);
> > +     int err;
> >
> >       amdgpu_irq_put(adev, &adev->pm.dpm.thermal.irq,
> >                      AMDGPU_THERMAL_IRQ_LOW_TO_HIGH);
> >       amdgpu_irq_put(adev, &adev->pm.dpm.thermal.irq,
> >                      AMDGPU_THERMAL_IRQ_HIGH_TO_LOW);
> >
> > -     amdgpu_kv_smc_bapm_enable(adev, false);
> > +     err = amdgpu_kv_smc_bapm_enable(adev, false);
> > +     if (ret)
> > +             DRM_ERROR("amdgpu_kv_smc_bapm_enable failed\n");
>
> Return code is captured in 'err' and check is for ret' variable.
>
> BTW, does this code compile?
>
> Thanks,
> Lijo
>
> >
> >       if (adev->asic_type == CHIP_MULLINS)
> >               kv_enable_nb_dpm(adev, false);
> >

Thanks for your reply. So sorry for submitting the wrong commit. Now it's
fixed in v2 patch.



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux