Re: [PATCH 3/3] drm/amdgpu/pm: inform PMFW rlc status before start/stop rlc for vangogh

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

 



On Tue, Dec 08, 2020 at 09:39:18PM +0800, Lazar, Lijo wrote:
> [AMD Public Use]
> 
> > You can create two new callbacks in ppt_funcs->inform_rlc(smu, on), and set on as bool type
> 
> We can't keep adding ASIC specific workarounds as ppt_funcs. We should make use of the existing ones or have something generic to handle these quirks. System features control is one generic place in the logic which is used to control features. It's used in dGPU context only now, but it may be repurposed for FW notifications.

Actually, it's the new API for all future APUs (gfx10 and later). So we
want to add the callbacks. APU don't have the API to disable/enable DPM
like dGPU because it's handled by sbios. Once we do suspend, before we stop
RLC, we have to inform SMU to stop issuing the DPM request with this
message.

And yes, I am fine to move it into system feature control. Because it
noifies SMU to re-enable RLC again.

> 
> Thanks,
> Lijo
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Huang Rui
> Sent: Tuesday, December 8, 2020 6:39 PM
> To: Hou, Xiaomeng (Matthew) <Xiaomeng.Hou@xxxxxxx>
> Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Quan, Evan <Evan.Quan@xxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH 3/3] drm/amdgpu/pm: inform PMFW rlc status before start/stop rlc for vangogh
> 
> [CAUTION: External Email]
> 
> On Tue, Dec 08, 2020 at 07:19:42PM +0800, Hou, Xiaomeng (Matthew) wrote:
> > RLC is halted when system suspend/shutdown. However, due to DPM 
> > enabled, PMFM is unaware of RLC being halted and will continue sending 
> > messages, which would eventually caused ACPI related hang. So send 
> > message to inform PMFM the rlc status before start/stop rlc.
> >
> > Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@xxxxxxx>
> > Change-Id: I7b1a04f6e249ac6753109079ecb3019c99161d9f
> > ---
> >  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c 
> > b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> > index cf999b7a2164..42a32c0e5bab 100644
> > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> > @@ -920,6 +920,14 @@ static int smu_smc_hw_setup(struct smu_context *smu)
> >       uint32_t pcie_gen = 0, pcie_width = 0;
> >       int ret = 0;
> >
> > +     if (adev->in_suspend && smu->is_apu) {
> > +             ret = smu_notify_rlc_status(smu, 1);
> 
> You can create two new callbacks in ppt_funcs->inform_rlc(smu, on), and set on as bool type.
> 
> Then you can use below macros to implement this callback with RLC notify SMC message.
> 
> /* RLC Power Status */
> #define RLC_STATUS_OFF          0
> #define RLC_STATUS_NORMAL       1
> 
> Others look good for me.
> 
> Thanks,
> Ray
> 
> > +             if (ret) {
> > +                     dev_info(adev->dev, "Failed to notify rlc status!\n");
> > +                     return ret;
> > +             }
> > +     }
> > +
> >       if (adev->in_suspend && smu_is_dpm_running(smu)) {
> >               dev_info(adev->dev, "dpm has been enabled\n");
> >               /* this is needed specifically */ @@ -1213,6 +1221,14 @@ 
> > static int smu_disable_dpms(struct smu_context *smu)
> >                       dev_err(adev->dev, "Failed to disable smu features.\n");
> >       }
> >
> > +     if (smu->is_apu) {
> > +             ret = smu_notify_rlc_status(smu, 0);
> > +             if (ret) {
> > +                     dev_info(adev->dev, "Failed to notify rlc status!\n");
> > +                     return ret;
> > +             }
> > +     }
> > +
> >       if (adev->asic_type >= CHIP_NAVI10 &&
> >           adev->gfx.rlc.funcs->stop)
> >               adev->gfx.rlc.funcs->stop(adev);
> > --
> > 2.17.1
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Clijo.lazar%40amd.com%7C346c5521a1e848a40efe08d89b7a6ca7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637430297401242320%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=6t589ueoS0x26%2FdpzSdtQmjkRygo4ez11t0GuBMacyg%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux