Message ID | 99962272-12ff-975d-bf7f-7fd5d95a2df5@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEEF5C7EE2E for <linux-mm@archiver.kernel.org>; Thu, 8 Jun 2023 19:33:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F4508E0005; Thu, 8 Jun 2023 15:33:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A4068E0001; Thu, 8 Jun 2023 15:33:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66E918E0005; Thu, 8 Jun 2023 15:33:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 599408E0001 for <linux-mm@kvack.org>; Thu, 8 Jun 2023 15:33:48 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2D28D1C7A1C for <linux-mm@kvack.org>; Thu, 8 Jun 2023 19:33:48 +0000 (UTC) X-FDA: 80880580536.28.78D22C9 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by imf18.hostedemail.com (Postfix) with ESMTP id 59A661C001E for <linux-mm@kvack.org>; Thu, 8 Jun 2023 19:33:46 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=1MipXBHl; spf=pass (imf18.hostedemail.com: domain of hughd@google.com designates 209.85.219.182 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686252826; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Tza8VZpBdDATlz3Dj70XvbHnC1ZhEpBq1MlG3gUrqGw=; b=tes8uNJzICiy/IatO/OUHG2XqoxjlZMuE1qtM2GPwsM0hpVV7bDEy2kN0Z/V3U+LkgMi+5 LYPu3E2iZdkYBIrTDcNyWsB2LdOeKokfVXXz+zYlyQKpdgJLRRO58uM24/3Aw8AwZ84QRt q0gPOS5s2yOzkktmXBCsgSoRpY4RiIQ= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=1MipXBHl; spf=pass (imf18.hostedemail.com: domain of hughd@google.com designates 209.85.219.182 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686252826; a=rsa-sha256; cv=none; b=Shl+Vjh3G3f91akQPameHdRH2jEoLwOoaP+wl/6Rkjj4YfAJrSkJsKATuJGcm/1nnxeSAu l8RP3HspNjVO62fftrUR5Z3zJvMpsGdw8HvXP13WfqbYcIsUc5ldYMZBlTr47+2xnmDqTA 2oAyu/5k+dc6tW2F/+IaBfcBssDXmUI= Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-bad142be0ebso1045118276.3 for <linux-mm@kvack.org>; Thu, 08 Jun 2023 12:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686252825; x=1688844825; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=Tza8VZpBdDATlz3Dj70XvbHnC1ZhEpBq1MlG3gUrqGw=; b=1MipXBHlCgYLfuzhfDW5ZwUI8FUsKSE60AsqsEXw+S0tSnJg5UOmjRzYFHDLdCAJt8 yMkipeQIgxyZw78rcQRYlMT5UpzdJcWoIksfCpz/ydUZz6ZkI9xKVrX6kds0LvhIjEzt HS+XptOf+RYBmq4zm9J7IFzhbS7dVhum1cFHfBZOiQ+s0XEOXeKn/G9+gcrTCmXECFnx 8UoS3IHRM3ERDzeB2SU7OV6jhVelmg9iMKHzFrc8fJmEIq5uTYUBI9N7JZJvtQPChnnD 4+2NEzxtpjJGm4NjJthMMPpAkAfI8kDJwzbA28gjtv0iKudNeA4e3nFqgNhPbC/JEIjR C7cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686252825; x=1688844825; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Tza8VZpBdDATlz3Dj70XvbHnC1ZhEpBq1MlG3gUrqGw=; b=HDG7sRnL3aSakEqzHHEpe/6sI2z6Lrqovl+FMcrMfYtVXTO0A+BJrtYgYHNqFkJNJ4 VdXKRKCtU8tnxPRNEyWdzV1xbSrU2msrcYLNk+lFaoT88OWpzKt14kKV+gBBHOvQ92BL X7ngZXmBN3FNF8jbbGJD8ooQjFKMhVqPzBNSPR127Nh/TlZmt5NjvQFKmyfVNAvE1aTV gIVvNd7jYWKgBa0974zGE0+Aa69NEEF2rrfIGANS1iMQR3hlLpiD1vajNPClDnKm3qhi TIFUp/lTIjTvNTi8pX+IEsmoMynTR1ULgLYjlAnYE4A1RMf447BtZ5shEWUEG9Wjy3ia HmAw== X-Gm-Message-State: AC+VfDynrUODJvF7rmZFGEWREuOMUjbWGkyBKsF/08V5DTn6M2lWKJMo HDtqF7aktSAA9SJv2U4UUBzXfg== X-Google-Smtp-Source: ACHHUZ5fRes1KtQJuT48o2Wy/FuADD12yA75OXTij0wfUrs7MG5//8NY8cIlqChq28IRelwNgydDPg== X-Received: by 2002:a25:868e:0:b0:bad:1055:c9fd with SMTP id z14-20020a25868e000000b00bad1055c9fdmr569763ybk.49.1686252825296; Thu, 08 Jun 2023 12:33:45 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id e188-20020a251ec5000000b00baca49c80dcsm448503ybe.28.2023.06.08.12.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 12:33:44 -0700 (PDT) Date: Thu, 8 Jun 2023 12:33:40 -0700 (PDT) From: Hugh Dickins <hughd@google.com> X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton <akpm@linux-foundation.org> cc: Mike Kravetz <mike.kravetz@oracle.com>, Mike Rapoport <rppt@kernel.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, Suren Baghdasaryan <surenb@google.com>, Qi Zheng <zhengqi.arch@bytedance.com>, Peter Zijlstra <peterz@infradead.org>, Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Greg Ungerer <gerg@linux-m68k.org>, Michal Simek <monstr@monstr.eu>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Helge Deller <deller@gmx.de>, John David Anglin <dave.anglin@bell.net>, "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>, Michael Ellerman <mpe@ellerman.id.au>, Alexandre Ghiti <alexghiti@rivosinc.com>, Palmer Dabbelt <palmer@dabbelt.com>, Heiko Carstens <hca@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, "David S. Miller" <davem@davemloft.net>, Chris Zankel <chris@zankel.net>, Max Filippov <jcmvbkbc@gmail.com>, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 20/23] sparc: iounit and iommu use pte_offset_kernel() In-Reply-To: <a4963be9-7aa6-350-66d0-2ba843e1af44@google.com> Message-ID: <99962272-12ff-975d-bf7f-7fd5d95a2df5@google.com> References: <a4963be9-7aa6-350-66d0-2ba843e1af44@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 59A661C001E X-Rspam-User: X-Stat-Signature: 1i4swzo5q63xqjzyas67pbdx8wqy1zty X-Rspamd-Server: rspam01 X-HE-Tag: 1686252826-618491 X-HE-Meta: U2FsdGVkX1+GWZsATPt2FDy2aOrSpheE/pMFfzTREgsCc4IILSGQO9rO+TTb8DlWwJwiGOA+1E1oF4R1Ghh79nwR9p96k0elf9JmFqbaLoPGVRzcQhN6waOQh+Frk9FKupncY5278wr6SdetNdfkaItOY44lBe1zzv2O2nJHp1Q+gCfewizdC4yQhXqntQL3L1WGR5vvQo/kndwlFGuKSEd/nur9XGX/NLV9nwt9FrW50HjPHhtUOi0EtfFadp96LVj67aml1hq2ITqOeOUzKllE0mKHIwJL4MjlyGEN0BdB1lLwYbFJygXzUTqncNxslsDnCs4XpUV4VBHNjU4DVQGUHVICLED2TQ1dp/DUwxiE2Oij8vCVT+4CKKDNToRkAuzt6mkbApmgsHgudxg1CTFBkc/Ml1C1D0Npg5P+Uvxmn1JbGUpfttK4TzrFNFRZoxZX3JFwPxf9YxQdYPvGlyYA9fiExyeIlPEsQOwr3+3iMeFe6DNbiyLu/8mwZyqsuwpWn1abjh+K0PT45B0V7fnZb/GmH4ND7wyXbn1Diu0kmifHdX3S7nHU11+Qq+AcE9UokERMilInCcrihBOV/lmmUsDfFR0QqESxLbcLsawpA0Lte7czkQTO46tr9BaCS3d1nutwuWey/uqNDFS61vB2RWvde40wodwRqyifbHxpT8g7CYHDXZuITh17ULgrsPXrfMmZxEJRfmaZ+3S7GyAqh++dWbgYUIqIrejlHZd1Hte4xNuRt3FKzQZa9uIR0XPNmLV1aU6bvPDR3hoK4y0WqRnXU/Sz+zvUMj/+eiow6tXePdIDo57PiL5KXshx96At3cBFeaYfyjX8tBiu/7sTLVKxnndcZslvEMxhibXZkPbbMhx0xGNP10Xv349fQek20brBTYbdnWg+jlhj5OuSkwx7tsgtqZyClApFKhIwgQsZbT4aPiUha001ipIU7bIAv5uVUZAIuO6oAo/ 430+IrVD 6n5Qra8EH/6PQVrJUMKTfyvPPvK5HGCmDajaAx1W5tcuc9MIpU9W69OmFUWvVQvTK8vWQYkClRE0p7UpQd018mK5x6jFpLDIwvLfZ9uofl0Tgksio+4/6JvtwxzicFtnTljetX/sV8EMbcdY3mu/fbJorMKOnup3zBzKzlLdmZf+3EvOTokTeTYnBBj+pzNWa8JwJOR8UD9/Lnrg88GFhNDZiPilMWvMgD1OUz8HUWqOlO8Ss+BelOwCBCVYjFHyrCEkwSXs0TZsoxQyvJE1QuHW/D1CPhqcIMHL8tJfifgHlqIq7NbCfT2TxySMR2kZ6mltmgm1tCCIfibvu6vhPUtLF4sPV03IRSaUL28Y/bnubRvxU2rzlneK0AjPE0NKdFfEgKvgvm9ToFO3s/jE8vrNAhGhWhw5EbQzx+JV6/+gMmmfuXh/vJXS4Kg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
arch: allow pte_offset_map[_lock]() to fail
|
expand
|
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index bf3e6d2fe5d9..133dd42570d6 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c @@ -244,7 +244,7 @@ static void *iounit_alloc(struct device *dev, size_t len, long i; pmdp = pmd_off_k(addr); - ptep = pte_offset_map(pmdp, addr); + ptep = pte_offset_kernel(pmdp, addr); set_pte(ptep, mk_pte(virt_to_page(page), dvma_prot)); diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index 9e3f6933ca13..3a6caef68348 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c @@ -358,7 +358,7 @@ static void *sbus_iommu_alloc(struct device *dev, size_t len, __flush_page_to_ram(page); pmdp = pmd_off_k(addr); - ptep = pte_offset_map(pmdp, addr); + ptep = pte_offset_kernel(pmdp, addr); set_pte(ptep, mk_pte(virt_to_page(page), dvma_prot)); }
iounit_alloc() and sbus_iommu_alloc() are working from pmd_off_k(), so should use pte_offset_kernel() instead of pte_offset_map(), to avoid the question of whether a pte_unmap() will be needed to balance. Signed-off-by: Hugh Dickins <hughd@google.com> --- arch/sparc/mm/io-unit.c | 2 +- arch/sparc/mm/iommu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)