Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41223 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935563AbeFGO6v (ORCPT ); Thu, 7 Jun 2018 10:58:51 -0400 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "=?UTF-8?q?Christian=20K=C3=B6nig?=" , "Alex Deucher" , "Thomas Hellstrom" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: Subject: [PATCH 3.16 142/410] drm/ttm: fix adding foreign BOs to the swap LRU In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Christian König commit ed704a43e84cc536081423dcd3491acf2791aaeb upstream. It doesn't make any sense to try to swap out imported BOs. Reviewed-by: Thomas Hellstrom Signed-off-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Ben Hutchings --- drivers/gpu/drm/ttm/ttm_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -175,7 +175,7 @@ void ttm_bo_add_to_lru(struct ttm_buffer list_add_tail(&bo->lru, &man->lru); kref_get(&bo->list_kref); - if (bo->ttm != NULL) { + if (bo->ttm && !(bo->ttm->page_flags & TTM_PAGE_FLAG_SG)) { list_add_tail(&bo->swap, &bo->glob->swap_lru); kref_get(&bo->list_kref); }