答复: [PATCH] drm/amdgpu: fix baco handling for soc15

Qu, Jim Jim.Qu at amd.com
Mon Jan 28 05:26:36 UTC 2019


Reviewed-by: Jim Qu <Jim.Qu at amd.com>

Thanks
JimQu

________________________________________
发件人: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> 代表 Grodzovsky, Andrey <Andrey.Grodzovsky at amd.com>
发送时间: 2019年1月26日 5:03:30
收件人: Alex Deucher; amd-gfx at lists.freedesktop.org
抄送: Deucher, Alexander
主题: Re: [PATCH] drm/amdgpu: fix baco handling for soc15

Reviewed-and-Tested-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>

Andrey


On 01/25/2019 03:31 PM, Alex Deucher wrote:
> Need to check if the operation is one that involves
> registers before getting the register offset.  Fixes a
> crash in when handling commands without a register offset,
> e.g., wait.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>   drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c b/drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c
> index 002693c421d2..9c57c1f67749 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c
> @@ -84,11 +84,14 @@ bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr,
>                                const u32 array_size)
>   {
>       struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
> -     u32 i, reg;
> +     u32 i, reg = 0;
>
>       for (i = 0; i < array_size; i++) {
> -             reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg]
> -                     + entry[i].reg_offset;
> +             if ((entry[i].cmd == CMD_WRITE) ||
> +                 (entry[i].cmd == CMD_READMODIFYWRITE) ||
> +                 (entry[i].cmd == CMD_WAITFOR))
> +                     reg = adev->reg_offset[entry[i].hwip][entry[i].inst][entry[i].seg]
> +                             + entry[i].reg_offset;
>               if (!baco_cmd_handler(hwmgr, entry[i].cmd, reg, entry[i].mask,
>                                    entry[i].shift, entry[i].val, entry[i].timeout))
>                       return false;

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list