[PATCH] drm/amdgpu:fix vpost_needed routine

Deucher, Alexander Alexander.Deucher at amd.com
Fri Nov 11 15:05:10 UTC 2016


> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Monk Liu
> Sent: Friday, November 11, 2016 5:04 AM
> To: amd-gfx at freedesktop.org
> Cc: Liu, Monk
> Subject: [PATCH] drm/amdgpu:fix vpost_needed routine
> 
> 1,cleanup description/comments
> 2,for FIJI & passthrough, force post when smc fw version below 22.15
> 3,for other cases, follow regular rules
> 
> Change-Id: Iecdeec1801a920c1f4ea9c8fd40be9ac2f1f3c51
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>

Can you rebase this against amd-staging-4.7?  We reworked this code once we fixed the firmware version tracking in the firmware itself.  The firmware prior to that has a fixed version so we can check for that and special case it.

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 27 +++++++---------------
> -----
>  1 file changed, 7 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 5970c40..dbfe471 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -637,12 +637,10 @@ static bool amdgpu_vpost_needed(struct
> amdgpu_device *adev)
>  		return false;
> 
>  	if (amdgpu_passthrough(adev)) {
> -		/* for FIJI: In whole GPU pass-through virtualization case
> -		 * old smc fw won't clear some registers (e.g. MEM_SIZE,
> BIOS_SCRATCH)
> -		 * so amdgpu_card_posted return false and driver will
> incorrectly skip vPost.
> -		 * but if we force vPost do in pass-through case, the driver
> reload will hang.
> -		 * whether doing vPost depends on amdgpu_card_posted if
> smc version is above
> -		 * 00160e00 for FIJI.
> +		/* for FIJI: In whole GPU pass-through virtualization case,
> after VM reboot
> +		 * some old smc fw still need driver do vPost otherwise gpu
> hang, while
> +		 * those smc fw version above 22.15 doesn't have this flaw,
> so we force
> +		 * vpost executed for smc version below 22.15
>  		 */
>  		if (adev->asic_type == CHIP_FIJI) {
>  			int err;
> @@ -653,22 +651,11 @@ static bool amdgpu_vpost_needed(struct
> amdgpu_device *adev)
>  				return true;
> 
>  			fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
> -			if (fw_ver >= 0x00160e00)
> -				return !amdgpu_card_posted(adev);
> +			if (fw_ver < 0x00160e00)
> +				return true;
>  		}
> -	} else {
> -		/* in bare-metal case, amdgpu_card_posted return false
> -		 * after system reboot/boot, and return true if driver
> -		 * reloaded.
> -		 * we shouldn't do vPost after driver reload otherwise GPU
> -		 * could hang.
> -		 */
> -		if (amdgpu_card_posted(adev))
> -			return false;
>  	}
> -
> -	/* we assume vPost is neede for all other cases */
> -	return true;
> +	return !amdgpu_card_posted(adev);
>  }
> 
>  /**
> --
> 1.9.1
> 
> _______________________________________________
> 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