From patchwork Wed Oct 21 08:56:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11848789 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 10F9FC4363A for ; Wed, 21 Oct 2020 09:00:17 +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 483D62245D for ; Wed, 21 Oct 2020 09:00:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dTWxDcx6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="GPnXCMyD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 483D62245D 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=absJLRrTlKwM3Vpekns+vNkt+jObmIhjwmsFNcNKO1k=; b=dTWxDcx6Qq6+jezuI+s+gbQLP 1F04f+TxMl8VpelL4bH9jpsoYlpjhOEHCxZEk+cHMs/w3kg/00FrQWXF5Mk15owl+WB+098eKOtUw AzhLlvD0eo3lAiIOxivsrwEbjSolzUAgJA2DT7nFdKMatjCyvUb/m/zN4IdNdtyheu6QsThJTftDq 5dJmwQia2gtZo93wU0pea5fKUDAmjI8bg3N5X1VbEJVc+pcuYtPaB6zW9NDpVnuVFuRStbadeGcZS YBOxAC9yihioo6KZ1gSNaomEl982XAXNiFsLFqXNf9ciWyoWvbmxGxduLNYhIYRgwOIT17bjqx7Dr blX2C+C+w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kV9wr-0001cA-14; Wed, 21 Oct 2020 08:58:21 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kV9vh-00017j-2r for linux-arm-kernel@lists.infradead.org; Wed, 21 Oct 2020 08:57:13 +0000 Received: by mail-wr1-x442.google.com with SMTP id n18so2109499wrs.5 for ; Wed, 21 Oct 2020 01:57:08 -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=X91vcdrvFkENyRAE7ngumttfTvuoYERNqnOUmx1loc8=; b=GPnXCMyD+ghMvqTjeYNcG8HYusAwuJxpfHWnTLJKQIsMVr4ZAhrveCWfs4AXdeBUPw Y5mupIyBAV9NDJ8u8gy061IQONEWL5h8a9oYpovitSRm7WeaCy/YPrPbgEp1B6AXN1YC FZ2gAxPTsOCGgSfQP+HaV8u3GtfeNX/N9iPJ8= 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=X91vcdrvFkENyRAE7ngumttfTvuoYERNqnOUmx1loc8=; b=l6tlQSbcoAf4p3kGz8+OtMe3+YdMCyjhfo6NuNm122/bAN1SXTOGEA7fxDdeAigcJt VJWsIpmOQ1PSALgxgxG8ofn+reBTrsuQp1qPD7IWjh5wiRaPh/TbPBUVDzUtONd9jJWR V7t12GGY77zQENKCwSpfQJ5xqSFXCRu1O07qZTJ3NXJ/iNklPGfNyCJxPaB7B8uz219b Ns1p3nBFHRGsAE9vuaq1QIgGkFVWL2dgSsoGssFKpX8Jv15q9c77xZEz9L9+Coio5P/7 EQsygVYWdCIrCEhEDzLsshtYpr5kWAPXbJYhkuw+lNtkI45gNctLZ3xA50K0SlYwoO5O e6Hg== X-Gm-Message-State: AOAM5305Yaivbgv1hLhBBSpKa9fQPUopXlyhiNKGObk0UEjecRgJFogp MXYCK+gWNXKRVBcjLMn29qNrgg== X-Google-Smtp-Source: ABdhPJwRJSi1MhjUwKHGSaK47xh7Klwun5uHdPZbkNE0DXk17iEFA5dRgyjIq8Do+yUzr74H0TKxFQ== X-Received: by 2002:a5d:554b:: with SMTP id g11mr3494901wrw.370.1603270627906; Wed, 21 Oct 2020 01:57:07 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q8sm2675939wro.32.2020.10.21.01.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 01:57:07 -0700 (PDT) From: Daniel Vetter To: DRI Development , LKML Subject: [PATCH v3 04/16] misc/habana: Use FOLL_LONGTERM for userptr Date: Wed, 21 Oct 2020 10:56:43 +0200 Message-Id: <20201021085655.1192025-5-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201021085655.1192025-1-daniel.vetter@ffwll.ch> References: <20201021085655.1192025-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-20201021_045709_231734_D1A20BFE X-CRM114-Status: GOOD ( 15.84 ) 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: Jan Kara , kvm@vger.kernel.org, Daniel Vetter , linux-mm@kvack.org, Daniel Vetter , linux-s390@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Omer Shpigelman , Jason Gunthorpe , Daniel Vetter , Tomer Tayar , Moti Haimovski , linux-media@vger.kernel.org, John Hubbard , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Dan Williams , Ofir Bitton , linux-arm-kernel@lists.infradead.org, Oded Gabbay , Pawel Piskorski , Greg Kroah-Hartman , Andrew Morton 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) {