Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2300295imm; Thu, 7 Jun 2018 08:25:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIo3DWgISHqYBnXKV9tD026816kPojashCo6BpaJMLo8OHHr74QQfWiBx9+nZp2FITT3Wt2 X-Received: by 2002:a62:f407:: with SMTP id r7-v6mr2180239pff.47.1528385106627; Thu, 07 Jun 2018 08:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528385106; cv=none; d=google.com; s=arc-20160816; b=X1FK8Er8f6ZBxiJHGtsgaMsIlZjBHEYDYayrIa4UUkHVpSqZ6SRTQRyZB+gD9cOypk /hyfk0jzewqkWSRRT6kp2kriq9MyClwqRmoor+NDbGm9aJoI1V+o+E5WNHBNEVLX3ydO 23SEcnXSgWD6/07NHIFLZpTniHwpe30OyEo9PFrq4GuOCE1vL4MRbXyCAKhUzyToC07B hKHLamksrY8Oc5O9em4CEhI7a8Lt+zAmX7AkQHcE14qc6GAUYDxRTW8dyGjT3XquHRv9 LWPv3/HXoPNgj/mMl66uBYlQJAftJbqMzEF9QxO0nje3jjUU2+64OH5G4j2FDPLzIslf eOPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=yfxnB8DKnd2ABoo1Z9lrV/WS65pQKOSk37s1fld3twI=; b=hJwTp5qC8A4o3pTV1TzlMpSKeicaIC/FgFMdsbG7qZ/7aYevmfu723QHvUVLDcKhV6 DrDta6+8NoA+YG+az9J2oJqnpuYjxLmZKjcnMkx28i76b4jk321H72gu83QOpRPlF51h SuAnYj+wlLOi/VpMjS5SOFjdwRiSMDCg5JpngumIDVU1VWL4wddKHl18OYBqbKVfMxHd KGgi6ABumvd0OyIHhO8fFBC4ncAgvsOVf8RJcbj8nGA4uqRiGoBLQvwWCTMy9/ScH4gw WjhSbalxQLHb0RAlbv7G6RcwLxC+hgd46ABg6M5DfCxLPrMb5OJH5Lc338lKbjUEE1qM cQAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z70-v6si14204151pfi.7.2018.06.07.08.24.52; Thu, 07 Jun 2018 08:25:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935682AbeFGPWl (ORCPT + 99 others); Thu, 7 Jun 2018 11:22:41 -0400 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 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbm-0005hJ-QA; Thu, 07 Jun 2018 15:09:47 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb3-0002sk-6E; Thu, 07 Jun 2018 15:09:01 +0100 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: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 142/410] drm/ttm: fix adding foreign BOs to the swap LRU In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); }