From patchwork Wed Nov 25 16:25:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11931489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F1DEC64E7C for ; Wed, 25 Nov 2020 16:25:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 12F492083E for ; Wed, 25 Nov 2020 16:25:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="YUoZKq8L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12F492083E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 37AFF6B007E; Wed, 25 Nov 2020 11:25:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 32C816B0080; Wed, 25 Nov 2020 11:25:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F60A6B0081; Wed, 25 Nov 2020 11:25:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 0785E6B007E for ; Wed, 25 Nov 2020 11:25:47 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BBC0E180AD811 for ; Wed, 25 Nov 2020 16:25:46 +0000 (UTC) X-FDA: 77523466692.08.prose36_3b0cad627378 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 98A211819E621 for ; Wed, 25 Nov 2020 16:25:46 +0000 (UTC) X-HE-Tag: prose36_3b0cad627378 X-Filterd-Recvd-Size: 5218 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Nov 2020 16:25:45 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id p22so2509254wmg.3 for ; Wed, 25 Nov 2020 08:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lnj1vSewnYJ6/gw6qejvRzkdxRWgCvvqGMHaDGl+NSM=; b=YUoZKq8L06+FDLM6Fl810zMa4QNm9z7yylijbYlze6fR8otQLzenAvEmy/fayirA5N O41roW+Y0PCq5CiO8xCdkb7te5p4XNiNP2KMYNITnW7GvP766R3pheeUSYaMWtw/NCoq hiMpjQptcAu3Wxmv8w5zOIWpXb2cG4iSD2BBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lnj1vSewnYJ6/gw6qejvRzkdxRWgCvvqGMHaDGl+NSM=; b=MAsEHAdlei4HlnOak3i+AgfxxekWOAqE9f43Hu0YOv+Y1cw+VPArew3mDnprMEOFuA rxafQPbMH5ahvwqJPQ2irbzu2auGPX/TbK5NJ7RIqWN2XgTNGEsJ9F7zwHkXN7AWQFhq pajz42W7k/Pn3QvbL71/2K68TIO3ZW2z6WjsVk7Drg2EDj51AcpxoqU6s8J+uZSVhOr7 qogyB61DvUIE0utymzUUm60OLU8aWXvYQoENniZ5y0o13cc+N4kOZoDwsAVnQj4FMqsP cwcDvsufdTI1+RDIYjIXGilUZjcJKkbLikFV5hgnws/maY/G60hS9W4PbSI6qyhoTlPv qKuQ== X-Gm-Message-State: AOAM5330mhy9+GK1Ty9S5yxzfjeyAaigf+14AF17GZffnnmxAy8mjhso t29uukLjh/8vyJuXOoSugHIOsg== X-Google-Smtp-Source: ABdhPJzimL6dZ1eWi01TNV2dJDgqjd5jFZPTvE6ZnqLenNCICrynr5xXWljktH5hZBPm90Z1zf9kBQ== X-Received: by 2002:a7b:cf26:: with SMTP id m6mr4920447wmg.121.1606321544420; Wed, 25 Nov 2020 08:25:44 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id a21sm4855187wmb.38.2020.11.25.08.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 08:25:43 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, LKML , Daniel Vetter , Thomas Hellstrom , Brian Paul , Daniel Vetter , Christian Koenig , Huang Rui Subject: [PATCH] drm/ttm: don't set page->mapping Date: Wed, 25 Nov 2020 17:25:32 +0100 Message-Id: <20201125162532.1299794-5-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201125162532.1299794-1-daniel.vetter@ffwll.ch> References: <20201125162532.1299794-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Random observation while trying to review Christian's patch series to stop looking at struct page for dma-buf imports. This was originally added in commit 58aa6622d32af7d2c08d45085f44c54554a16ed7 Author: Thomas Hellstrom Date: Fri Jan 3 11:47:23 2014 +0100 drm/ttm: Correctly set page mapping and -index members Needed for some vm operations; most notably unmap_mapping_range() with even_cows = 0. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul but we do not have a single caller of unmap_mapping_range with even_cows == 0. And all the gem drivers don't do this, so another small thing we could standardize between drm and ttm drivers. Plus I don't really see a need for unamp_mapping_range where we don't want to indiscriminately shoot down all ptes. Cc: Thomas Hellstrom Cc: Brian Paul Signed-off-by: Daniel Vetter Cc: Christian Koenig Cc: Huang Rui --- drivers/gpu/drm/ttm/ttm_tt.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index da9eeffe0c6d..5b2eb6d58bb7 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -284,17 +284,6 @@ int ttm_tt_swapout(struct ttm_bo_device *bdev, struct ttm_tt *ttm) return ret; } -static void ttm_tt_add_mapping(struct ttm_bo_device *bdev, struct ttm_tt *ttm) -{ - pgoff_t i; - - if (ttm->page_flags & TTM_PAGE_FLAG_SG) - return; - - for (i = 0; i < ttm->num_pages; ++i) - ttm->pages[i]->mapping = bdev->dev_mapping; -} - int ttm_tt_populate(struct ttm_bo_device *bdev, struct ttm_tt *ttm, struct ttm_operation_ctx *ctx) { @@ -313,7 +302,6 @@ int ttm_tt_populate(struct ttm_bo_device *bdev, if (ret) return ret; - ttm_tt_add_mapping(bdev, ttm); ttm->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED; if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) { ret = ttm_tt_swapin(ttm);