From patchwork Mon Nov 7 16:17:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 16552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2152334wru; Mon, 7 Nov 2022 08:23:10 -0800 (PST) X-Google-Smtp-Source: AMsMyM51B47y8q3p45CfMVy7hmiO6moUyS3dqjwfeeFxx+gHHuWGQQEuyu9UVJQ540bY+ZWkH6Ja X-Received: by 2002:a17:90b:1c87:b0:20a:e485:4e21 with SMTP id oo7-20020a17090b1c8700b0020ae4854e21mr52224964pjb.194.1667838189832; Mon, 07 Nov 2022 08:23:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667838189; cv=none; d=google.com; s=arc-20160816; b=Bp/tREuR9tVF6fjt/r/Xsap4ArDczDnwkJePgTzNb2V9nbQix4/MfJ16jO+To7vuMa Om73Y3Ri5WsMexs5EizK0N9pX5rMDFeiny5CJtAvO7AqiKchxMQqo+whlnmJSlRbRL8b dQd1pQKfuZ3mXQlkj+dcXfcSv2tSUL3VHRGcBu4s0n/dL7AkuGjfSKB3voA4YyEYyajc AaqjLvTmHKlP0Z7E3SJn5lOmH+9esymgnSQbHHUSNhYEX77Vti2SWSt/A+htn57LfZPZ gIO1hjcoUNs6WD8AfiGz4t91eGUAXTj9F0P5PATjDFRtAURuI6VTNZJF2j1BPoqZZVwe tWqQ== 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=DuB2xXWo7LwhnuotOHRyBqnGxRkaEWf9/y+D6i6uzJ8=; b=MsxeuHIuVxJKmNyrz4OP39K0c2mJroIYS+UWh02ky/BdGXFjURKXGRzHZHYJksR7VA i6MkLffZEje1KGCipdywQ5T+9KWFa8gexZ3tQNgSMfhjXGDrMCDRCpWVfIBoCxxh6t57 XCW7Cxz2omR1cOTFDXZ9rVoCCuBI864V+yW/vNtC7II3SJbMHAk1uxICKMFbXue3Ee6X Mt8pjTOGFFJF9IVEVnw1D8t3sytjnv+Xu9ooj3DKcUVHrbf65yWw6FKDKBAiaZv5vwbW LM/2S55rVd1fsAKTAQ4LIHpimdvvPpE/Wnx1X5YNgPTQBl/suYmxY3w1FUdUP13O/Kjv ZVRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=irkARvPF; 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 f35-20020a17090a28a600b002142213dedasi12415724pjd.40.2022.11.07.08.22.55; Mon, 07 Nov 2022 08:23:09 -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=irkARvPF; 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 S232431AbiKGQWU (ORCPT + 99 others); Mon, 7 Nov 2022 11:22:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbiKGQVJ (ORCPT ); Mon, 7 Nov 2022 11:21:09 -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 825F72BEB for ; Mon, 7 Nov 2022 08:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667837994; 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=DuB2xXWo7LwhnuotOHRyBqnGxRkaEWf9/y+D6i6uzJ8=; b=irkARvPFTMrNDJzdZPsYNjvOWspbi8W8GSwmfy7j3kkN4wzVMP3BADdynW+/13ypqe/Ph2 OO4u5DR+RAkSFWE5TpS8greLqexdA472EDPAIZhJZUq7g4PchWL1RXBjvZymxTLamKFAyw l9jdU0rDHF9je4FnR4YHKVXEPIqOglo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-Jw4agQGfPwGSW7qMCb5CiQ-1; Mon, 07 Nov 2022 11:19:51 -0500 X-MC-Unique: Jw4agQGfPwGSW7qMCb5CiQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7457B296A60A; Mon, 7 Nov 2022 16:19:49 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.195.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFEFE4B3FC6; Mon, 7 Nov 2022 16:19:43 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-kselftest@vger.kernel.org, David Hildenbrand , 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 , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann Subject: [PATCH RFC 19/19] habanalabs: remove FOLL_FORCE usage Date: Mon, 7 Nov 2022 17:17:40 +0100 Message-Id: <20221107161740.144456-20-david@redhat.com> In-Reply-To: <20221107161740.144456-1-david@redhat.com> References: <20221107161740.144456-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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?1748855097919586578?= X-GMAIL-MSGID: =?utf-8?q?1748855097919586578?= FOLL_FORCE is really only for debugger 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. Cc: Oded Gabbay Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: David Hildenbrand Acked-by: Oded Gabbay --- 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) {