From patchwork Fri Oct 23 12:21:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11853219 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=-9.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 B9CC9C55179 for ; Fri, 23 Oct 2020 12:26:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4906A2168B for ; Fri, 23 Oct 2020 12:26:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="avHw04bd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="I4RFwd2e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4906A2168B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wJvtdw2tjFE+YJ7lJpWzpN3hg3nvCGE/RzdYnAnSsbw=; b=avHw04bdYA2pzCiiLAwM4XoXy BEBJQT+4E2ikD+5yOIcyzy877AK/Lt2ad6UCuWGE5zF0J6FDahdh2fetlCB8wqcM/KIIkUeDrjO7G nwYTxRzKVx2lpx++LTHPNj8stFYOLo1nMNBLe9/3SRIVmpzjZTPSUaW83r1LoVCRYeg5jaJzO1YyS DjyqtLpEfprNKf1PYwGpQ1I+NYBDzOkPBb2iMDx521T7H7g81H84YUzUsrlFw5yM0y+o9ZImtyD5y 3caGRW/rKWQAENSo0dB+kNeN6IHqvBFSEpqiGNT77KT2ZhXfoKlxhT1pFezO8x9pFera8UCgK2fBb +hxuCudJQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVw7S-0000A9-KC; Fri, 23 Oct 2020 12:24:30 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVw61-0007ru-Jj for linux-arm-kernel@lists.infradead.org; Fri, 23 Oct 2020 12:23:09 +0000 Received: by mail-wm1-x343.google.com with SMTP id c16so1300352wmd.2 for ; Fri, 23 Oct 2020 05:23:01 -0700 (PDT) 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=fm+L1OZ5vnKeOGH1XwjpH65CAXQE2qGCwQHeV0BfCbo=; b=I4RFwd2eW9iNL5qH7GC2GN+bOEbVbW0io2ha60AXzDjB/0yYw4W1JK6yrbHeRAL0iY ISW+gqIaC+vP2a2lhS4YPj3Em5r0tFkHvuJ7lEUT60inNY0XgrlVSxFy5WXKshps7csM du6jwmFk8hHJwEqDf96AP/6FrBQrEHzL9do1E= 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=fm+L1OZ5vnKeOGH1XwjpH65CAXQE2qGCwQHeV0BfCbo=; b=iN6RzqXjavNmxjqKNisNuGHMwFGskEtVBuslEYvXMrr5YbwntSiRxp9I2ygBzum/vc A8JcshGCCdrF+R5SujlxNAxOkKIhWWZ8g7phodkPBcBevduTbyADjAW07zerK+kQwUi0 DMgCjdC3w3VSG2l6zUGORk7mjfeDFyM8HivPmRyv25HG1Fm9zo/qVMWZ03D2vLghuz3R IUzSK3eVUSls6x44d8QWJODS/nVtHThZGKBSjjKFN7OYSmlmtUeWLk4+U5RTPV8RvQhW QLvtUY5MFdQTdCXxaik2ho/nE9LWKdLESn5nICMnOv1HWQPirK7Ty+j3PQYAHX4cZZrS Tnxw== X-Gm-Message-State: AOAM531lZoxCs+vzpCwF8nFg1jZEldoS/3IHuKLZNb79joDUlHKeCGok 8gDoTG3RE54LFyGgnkj1UYiUZg== X-Google-Smtp-Source: ABdhPJyGjziGYIZ7LCrUaPvnmjitFLFb8BHzU6RIkZE3cezG0NmOKu92ESUHVoVpHKIYbtJBpxbBNA== X-Received: by 2002:a1c:7409:: with SMTP id p9mr1939536wmc.167.1603455780340; Fri, 23 Oct 2020 05:23:00 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y4sm3056484wrp.74.2020.10.23.05.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 05:22:59 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 33/65] misc/habana: Use FOLL_LONGTERM for userptr Date: Fri, 23 Oct 2020 14:21:44 +0200 Message-Id: <20201023122216.2373294-33-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201023122216.2373294-1-daniel.vetter@ffwll.ch> References: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> <20201023122216.2373294-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201023_082301_741834_B1D731A9 X-CRM114-Status: GOOD ( 15.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oded Gabbay , linux-samsung-soc@vger.kernel.org, Jan Kara , linux-mm@kvack.org, Pawel Piskorski , Daniel Vetter , Intel Graphics Development , Greg Kroah-Hartman , Ofir Bitton , Jason Gunthorpe , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Tomer Tayar , Omer Shpigelman , John Hubbard , Daniel Vetter , Andrew Morton , Moti Haimovski , Dan Williams , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These are persistent, not just for the duration of a dma operation. Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Andrew Morton Cc: John Hubbard Cc: Jérôme Glisse Cc: Jan Kara Cc: Dan Williams Cc: linux-mm@kvack.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: Oded Gabbay Cc: Omer Shpigelman Cc: Ofir Bitton Cc: Tomer Tayar Cc: Moti Haimovski Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Pawel Piskorski Signed-off-by: Daniel Vetter --- drivers/misc/habanalabs/common/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c index 327b64479f97..767d3644c033 100644 --- a/drivers/misc/habanalabs/common/memory.c +++ b/drivers/misc/habanalabs/common/memory.c @@ -1288,7 +1288,8 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size, return -ENOMEM; } - rc = pin_user_pages_fast(start, npages, FOLL_FORCE | FOLL_WRITE, + rc = pin_user_pages_fast(start, npages, + FOLL_FORCE | FOLL_WRITE | FOLL_LONGTERM, userptr->pages); if (rc != npages) {