Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1137943rwd; Thu, 8 Jun 2023 12:47:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7QaDz5kHbRz6slLj188xlnfn7v+lludJITiiDwbdoz84Scv8H/CgD1PnAcY0thopyoMUj0 X-Received: by 2002:a05:6a20:6a0e:b0:10b:6265:6ddc with SMTP id p14-20020a056a206a0e00b0010b62656ddcmr5236129pzk.22.1686253633754; Thu, 08 Jun 2023 12:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686253633; cv=none; d=google.com; s=arc-20160816; b=CHl+nK/TbISGBX0C+eC5xDI5O4yVP1Vs0KkMmJmyB8Cn5NyGhhqFGhwZZpxFMaRLWg 3GEQzoiuUVD+2CXQLZcGtthF4R8hRkT27tWNVAp3Q1yzapAy0utwIGryRtrchBiLROsq zBh88ZSYj8irplwoiqkj96cgd9YyqlkcIZEECKv70A95ExBdK2Uwzfvmfzj+2Y+SYtYt H2IgdEwZ2w7D9u6lOsKdTY4aBreNhS6lnGWHhUOQQTBfegpdC35eDVJFs9uqhr/gxHcK ElR42Zq7F4m6IhB+IbbdzPYmnq7bwFEpKSTaiXhF8M08Gl/QQcbynxsUfeRhLVJUufXG 8alg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=Tza8VZpBdDATlz3Dj70XvbHnC1ZhEpBq1MlG3gUrqGw=; b=dVqq3TlqmLJ8kFIBEjvAsOhhVmgZ9Wfd1Ac5Nt2VHvQ36KA5qVqUHYMjDBZTOu+FAU ccAOrCovUg/vedoH2VRII0hJsIxehh79PSJ9iPo6wuU6dWtq8BLEVsiYECNujEVMie9o GN86XYLVmQapvuG4jJO8TlDpdbiLohtgFxpzVeCtQz23qiLPfQz1GHEsMhODEYokawmd Rw8XHlxb+sYP6UGEqWlEHcukS6r/F9dNnap2fcKOjQ4f4szT33QNwkATsTY2E1K+1KzA GWG8iW/YAQvGniIANtAPwWV9M0/3iGQ27avcSw4UCB2t0w85gVybz8jAUpluDVkiqZzj Q5sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=1MipXBHl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i64-20020a638743000000b00543d326f7acsi1315991pge.886.2023.06.08.12.46.58; Thu, 08 Jun 2023 12:47:13 -0700 (PDT) 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=@google.com header.s=20221208 header.b=1MipXBHl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233520AbjFHTdu (ORCPT + 99 others); Thu, 8 Jun 2023 15:33:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbjFHTds (ORCPT ); Thu, 8 Jun 2023 15:33:48 -0400 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A142129 for ; Thu, 8 Jun 2023 12:33:46 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-bad1ae90c2eso1048596276.2 for ; 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=Twer0s44dElTE3uNPUEoqE5JQ1P7NO04rkW6LjQTMWbYcqV1HtZU/OXQLueyoVd8YR UBThm0Kt2+MseRv09KO0T/wTC7uDQevW9oSol5QsqVFg3EPem1w5ez2OmIOpGa5xSm7X 7R2h4SxhF5hGQcSFgMR46r6EIqtTJG3ATnK6MEJfu4wibUAMNSWI3S3JOV6jLZ6aVt87 +4U9VzT9+c3LPrAZQlUeVA0R1tM5kgQkBFEzTEb9R6LXzFatZmGHcRlDo23vfz8VGCZ1 Mh75niEOB90NkOEwDzrBkslVF8mBZm/nXusIyjttS9efDDhAht/2eqf/e6FV8fVt8XN9 1gdw== X-Gm-Message-State: AC+VfDxMNCOQRDDBil23XPwoUJhL8yuSTmSpIqmDTB9VwfS1R1gTybXX APD7EnH6X2ymKUAb84qw08NUmg== 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 X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Peter Zijlstra , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Greg Ungerer , Michal Simek , Thomas Bogendoerfer , Helge Deller , John David Anglin , "Aneesh Kumar K.V" , Michael Ellerman , Alexandre Ghiti , Palmer Dabbelt , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , Alexander Gordeev , John Paul Adrian Glaubitz , "David S. Miller" , Chris Zankel , Max Filippov , 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: Message-ID: <99962272-12ff-975d-bf7f-7fd5d95a2df5@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 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 --- arch/sparc/mm/io-unit.c | 2 +- arch/sparc/mm/iommu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)); } -- 2.35.3