Re: [PATCH] drm/ttm: re-apply "make ttm_bo_unpin more defensive""

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

 



On Mon, Mar 29, 2021 at 12:43:56PM +0200, Christian König wrote:
> We still need this change in 5.11 to make radeon suspend/resume work.
> 
> As requested by Greg this is the upstream commit
> 6c5403173a13a08ff61dbdafa4c0ed4a9dedbfe0 rebase on branch linux-5.11.y.
> 
> Signed-off-by: Christian König <christian.koenig@xxxxxxx>
> ---
>  include/drm/ttm/ttm_bo_api.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
> index 2564e66e67d7..562cb5e45524 100644
> --- a/include/drm/ttm/ttm_bo_api.h
> +++ b/include/drm/ttm/ttm_bo_api.h
> @@ -612,8 +612,10 @@ static inline void ttm_bo_pin(struct ttm_buffer_object *bo)
>  static inline void ttm_bo_unpin(struct ttm_buffer_object *bo)
>  {
>  	dma_resv_assert_held(bo->base.resv);
> -	WARN_ON_ONCE(!bo->pin_count);
> -	--bo->pin_count;
> +	if (bo->pin_count)
> +		--bo->pin_count;
> +	else
> +		WARN_ON_ONCE(true);
>  }
>  
>  int ttm_mem_evict_first(struct ttm_bo_device *bdev,
> -- 
> 2.25.1
> 

Now queued up, thanks.

greg k-h



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux