From patchwork Wed Nov 16 10:26:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 20911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp69258wru; Wed, 16 Nov 2022 02:42:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf4BcJ66gaL+jsDEyTRwJX85TLZTXfoJmvgGCogNwVPbyAgnU7lMXF1LWVIjJVCgjkg3NAC+ X-Received: by 2002:a63:b5b:0:b0:46e:a4ed:467e with SMTP id a27-20020a630b5b000000b0046ea4ed467emr20186587pgl.319.1668595378906; Wed, 16 Nov 2022 02:42:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668595378; cv=none; d=google.com; s=arc-20160816; b=b2rpOW4jTo/xuE7UhRvSszHf+Vz9bgZd6PFop94RIcphTTOIaxxfAVcS/KgPC+4zKo 8tt6bXAukLfQIC1oL6KPd8Qx+fjBCDS8CRfez1X45wbsMWc44L/JYj3D7O9DYu61TQT/ pIn2qnLKn3Oo68Y61kMgxNvRu6hwvf+QnT3WExqaBR+8c+udJaZnr4V5l2TkcfprvKKr E1AqT8OtU98AYk6B9R9m/9Y281zuhHbsmzXb3VbNC5Im/J12b8TCxiNhAUNmCel1fs5B zAQxQdFxPSTEHOJ3tsBPLS3w8PGklFoywM2b/5IVtpOzrTjb4k0+Uu3RSAtUGCAl1DJD zMyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AW87fgh+ucyp6GPfn9nwvdCWqoK4NWdmiMJ3qK4gV9o=; b=rtKHojQf7EHTZXmvCCKElOw49I3tJUlZ0e3KOr2NCZfSs+A3qIek54WkpwQ2PKEN7u 33jgKwESDRig88PlBb1TD/5atEqRZVXJO6p696YybEXqwFMIequXCq9F1VNDH4w2WgCF 3IlU8ueY8B7oh85Lx9UrOCLZSQOrnj9Jz2W2zmnVMxg/mld7s25PiytJmvFzQackHOMj t1vTJ5LEv/gZpUi3Ju5O1DltN3FIZqBLXlvdfCuw3UP83zW3adHX7e0Q/4FjwnoprJ2p bhvxmYTrKbR3xVVc7reB8Yjf76eYki5Ek2DHc3h7IDQKu0TDOfePMvlWaknbHaiLd2PJ 9Kew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YzfTmHen; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a630a13000000b0046eca85c48dsi14408455pgk.110.2022.11.16.02.42.45; Wed, 16 Nov 2022 02:42:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YzfTmHen; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233578AbiKPKmX (ORCPT + 99 others); Wed, 16 Nov 2022 05:42:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232881AbiKPKlI (ORCPT ); Wed, 16 Nov 2022 05:41:08 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 139023FBA8 for ; Wed, 16 Nov 2022 02:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668594592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AW87fgh+ucyp6GPfn9nwvdCWqoK4NWdmiMJ3qK4gV9o=; b=YzfTmHenzVjFzwCRu5tnXCPCpbkjxKgI/mFsWqByBYhXkZnnE61IeW/diMUPbbS3KVRvbV vtHbUnWGaui/FJ9RSafP5fi3iOYy7UjuQL6V7NcMDiZb216inSW6l7Ze09KkwfZnHIoH5z WR2pLokjzNDBOKpReK6jKFGPBblTWe4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-2lbboRpqNXmL5tQ6NMs1RA-1; Wed, 16 Nov 2022 05:29:49 -0500 X-MC-Unique: 2lbboRpqNXmL5tQ6NMs1RA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E748387A9E1; Wed, 16 Nov 2022 10:29:47 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.193.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD0942028E8F; Wed, 16 Nov 2022 10:29:40 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, Linus Torvalds , Andrew Morton , Jason Gunthorpe , John Hubbard , Peter Xu , Greg Kroah-Hartman , Andrea Arcangeli , Hugh Dickins , Nadav Amit , Vlastimil Babka , Matthew Wilcox , Mike Kravetz , Muchun Song , Shuah Khan , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann , Christoph Hellwig , Alex Williamson , David Hildenbrand Subject: [PATCH mm-unstable v1 19/20] habanalabs: remove FOLL_FORCE usage Date: Wed, 16 Nov 2022 11:26:58 +0100 Message-Id: <20221116102659.70287-20-david@redhat.com> In-Reply-To: <20221116102659.70287-1-david@redhat.com> References: <20221116102659.70287-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749649068262065387?= X-GMAIL-MSGID: =?utf-8?q?1749649068262065387?= FOLL_FORCE is really only for ptrace access. As we unpin the pinned pages using unpin_user_pages_dirty_lock(true), the assumption is that all these pages are writable. FOLL_FORCE in this case seems to be due to copy-and-past from other drivers. Let's just remove it. Acked-by: Oded Gabbay Cc: Oded Gabbay Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: David Hildenbrand --- drivers/misc/habanalabs/common/memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c index ef28f3b37b93..e35cca96bbef 100644 --- a/drivers/misc/habanalabs/common/memory.c +++ b/drivers/misc/habanalabs/common/memory.c @@ -2312,8 +2312,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size, if (!userptr->pages) return -ENOMEM; - rc = pin_user_pages_fast(start, npages, - FOLL_FORCE | FOLL_WRITE | FOLL_LONGTERM, + rc = pin_user_pages_fast(start, npages, FOLL_WRITE | FOLL_LONGTERM, userptr->pages); if (rc != npages) {