[PATCH V3] drm/amdgpu: Destroy psp ring in hw_fini

Huang Rui ray.huang at amd.com
Thu Apr 20 06:39:56 UTC 2017


On Thu, Apr 20, 2017 at 12:15:52PM +0800, Trigger Huang wrote:
> Fix issue that PSP initialization will fail if reload amdgpu module.
> That's because the PSP ring must be destroyed to be ready for the
> next time PSP initialization.
> 
> Changes in v2:
>         - Move psp_ring_destroy before all BOs free (suggested by
>           Ray Huang).
> Changes in v3:
>         - Check firmware load type, if it is not PSP, we should do
>           nothing in fw_fini(), and of course will not destroy
>           PSP ring too (suggested by Ray Huang).
> 
> Signed-off-by: Trigger Huang <trigger.huang at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |  9 +++++++--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h |  3 +++
>  drivers/gpu/drm/amd/amdgpu/psp_v3_1.c   | 27 +++++++++++++++++++++++++++
>  drivers/gpu/drm/amd/amdgpu/psp_v3_1.h   |  2 ++
>  4 files changed, 39 insertions(+), 2 deletions(-)
> 

...

> +       /* Write the ring destroy command to C2PMSG_64 */
> +       psp_ring_reg = 3 << 16;
> +       WREG32(SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64), psp_ring_reg);
> +
> +       /* there might be handshake issue with hardware which needs delay */
> +       mdelay(20);
> +
> +       /* Wait for response flag (bit 31) in C2PMSG_64 */
> +       ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_64),
> +                          0x80000000, 0x8000FFFF, false);
> +

The mask should be 0x80000000 not 0x8000FFFF. With this fixed, the patch is
Reviewed-by: Huang Rui <ray.huang at amd.com>.

Thanks,
Rui


More information about the amd-gfx mailing list