Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4692571ybi; Tue, 30 Jul 2019 06:33:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWLG6IJX6UDtltupksmTjMruN1+xZvFygOqEGQI0RvznkRInGNYRsiUn3kM3BSTwDH4SfC X-Received: by 2002:a17:90a:3aed:: with SMTP id b100mr117894499pjc.63.1564493590829; Tue, 30 Jul 2019 06:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564493590; cv=none; d=google.com; s=arc-20160816; b=zwoeSqPfBocoU8lHrlW695SLXZGYJrUJADqOSVdjY02ErnHwxvB62f0dAnp+tb/DF4 5HS5f+O0zNDnZ7/RXwfHwyrwfpUmPre+CND/QvFlgrlwyitSZCCrbBKqL/W3aMhdnzHu VpAk+cFE2EUpsW3wZC9G3VoohneQsY0lsY/dXKTiOnySx2M5pxzNptYykrAOD6MPGTMZ xSqITzAOh3OOK+/J8ozoksiuYQINVW2/JlpVKuJDulQ5QH6XtYSJmy787ECjutQqGf5M /6ERJUYEb1GM5BV9LLciP3ERlvksdLyABbo3ZkgCsKa1gHR4dwwcjJ66n8mLWJXzw6oR hVGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bXbV3qDGfzrx7WoIjFecJlqT5ZuyvFJhVzdpdqMjsLk=; b=lZKitGLBm3o4ETs1MzaffRf2KK+rZNnMFtIbhZ73qtS+uI1W/Wf2MiiL2VoiixqbZv g8COa2Sy3L1FHRMyU8SlSa9ha9HIsbuMmkUNVhBB6EhjrE2tENoQJP/GixQuhYfBjW1w o8fgYnfG0VeZ2n79t/6ZDSHGFE6f3TzzmMWFKwj+6Mfzh1zZCeNyOCPGfmL/HXizecvg fEps5flpHp/gv7q+MHvf7vrOoUs9hKGsYS8ZmNjAl99EWQQpYtAVBSZEq/luLS7UY8+3 jX8y7mspdYPUKskiQ0j7O5eHc7U/5HV39OMAzEzrrN2ALIaOWedTpKjqe+wvOUoLRnoH qGTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P6NBNZSe; 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 j12si29853608pfe.188.2019.07.30.06.32.23; Tue, 30 Jul 2019 06:33:10 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P6NBNZSe; 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 S1728195AbfG3Fw3 (ORCPT + 99 others); Tue, 30 Jul 2019 01:52:29 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46144 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbfG3Fw1 (ORCPT ); Tue, 30 Jul 2019 01:52:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bXbV3qDGfzrx7WoIjFecJlqT5ZuyvFJhVzdpdqMjsLk=; b=P6NBNZSercDK8PYpn8hH4MT1dI LpeRr03gX2BviYGoHk1vN9m29L2aP2JhMjHHKYLSgQm/itVvfO8okrbldueEpgHoKa86lEIRMpOb3 Vadg+4NxBVvm9X02muhLuK9XEa07t1zyqX82xhH+XnZCyZUzTvEDSdfex9WY0BKYXunC85J5XmVjC h+fn0T7fEHa9Kh7H8LMhMwKH6XegmVI8DqDmLPtmEV4p+LQ9BAyqkcXhjbIGixsN6bXWtF7i7uc2Q 6n/rnpFHFsp8rPWmIOvJj+RA9WpDkFQkiAYcd6WMzaNCgY+bK/6n3141sAZN02rOHPPE+SpY+MKVp HCEwdPvA==; Received: from [195.167.85.94] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hsL3f-00015T-Jl; Tue, 30 Jul 2019 05:52:24 +0000 From: Christoph Hellwig To: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Jason Gunthorpe , Ben Skeggs , Felix Kuehling Cc: Ralph Campbell , linux-mm@kvack.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/13] nouveau: pass struct nouveau_svmm to nouveau_range_fault Date: Tue, 30 Jul 2019 08:51:53 +0300 Message-Id: <20190730055203.28467-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190730055203.28467-1-hch@lst.de> References: <20190730055203.28467-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This avoid having to abuse the vma field in struct hmm_range to unlock the mmap_sem. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_svm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index a74530b5a523..b889d5ec4c7e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_svm.c +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c @@ -485,14 +485,14 @@ nouveau_range_done(struct hmm_range *range) } static int -nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range) +nouveau_range_fault(struct nouveau_svmm *svmm, struct hmm_range *range) { long ret; range->default_flags = 0; range->pfn_flags_mask = -1UL; - ret = hmm_range_register(range, mirror, + ret = hmm_range_register(range, &svmm->mirror, range->start, range->end, PAGE_SHIFT); if (ret) { @@ -689,7 +689,7 @@ nouveau_svm_fault(struct nvif_notify *notify) range.values = nouveau_svm_pfn_values; range.pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT; again: - ret = nouveau_range_fault(&svmm->mirror, &range); + ret = nouveau_range_fault(svmm, &range); if (ret == 0) { mutex_lock(&svmm->mutex); if (!nouveau_range_done(&range)) { -- 2.20.1