From patchwork Thu Feb 16 12:34:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13143028 Return-Path: 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 17797C61DA4 for ; Thu, 16 Feb 2023 12:34:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A82616B007E; Thu, 16 Feb 2023 07:34:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A0C146B0080; Thu, 16 Feb 2023 07:34:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 886396B0081; Thu, 16 Feb 2023 07:34:53 -0500 (EST) 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 710C16B007E for ; Thu, 16 Feb 2023 07:34:53 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 444B11C5FFF for ; Thu, 16 Feb 2023 12:34:53 +0000 (UTC) X-FDA: 80473099266.07.ECE2107 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf13.hostedemail.com (Postfix) with ESMTP id 6F5BB20014 for ; Thu, 16 Feb 2023 12:34:51 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=V4Af0HwH; spf=pass (imf13.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676550891; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jHZa8mu+sMxKIWEAwvYcXi8mFXnonAyjIbMLTnXCGN4=; b=LtjtBM9ClqUO5Pi0YWSFf7qamMnTAgPODKTaaxpy8817mry8n3kF8BoXRCNABgwM4+5JCY GBJylcyX6CxbK7Fow5NZValtL6g/Oxmsp9F/82+YShrB2tC+N/OMj4PjH4OzHTZbPBp7D9 qgsHJa07Tyg+R5XqVL20ZTPuAfPPuRo= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=V4Af0HwH; spf=pass (imf13.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676550891; a=rsa-sha256; cv=none; b=a69KlBcVSq8zPiLyLY2ImF94yqkfPBNut0mFzZ0QPdGuDmXE9Y9pkq+WqTVIdSwHL/gmqR qL0w92gu2v5G0Jg6gNnoPisVZFXHgIY6to7SqoHDOAsmxNNP76ZfFa2yQPh3wxnQqHSxOD hcaWe8SjE+2TG9zcHVFlYieUCsLIk/8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676550890; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jHZa8mu+sMxKIWEAwvYcXi8mFXnonAyjIbMLTnXCGN4=; b=V4Af0HwHujc50s5GcEikCjDGl4by6OlV3YIFsKlBm5m/FUH6zyJVH4DtNKY2RblNxGAAQo ndHIsGUtXMmIy2mx8Xw+8/vPWYXeuD+ruyas7uA9p1ZoqHxuMKOyFIB8F36SY4UcdRtFRJ a0hKGi0Tm2alVR2C7dKOdXHhXCpQYGM= 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-29-221ga0mcOi6-Nz0bEIpEaw-1; Thu, 16 Feb 2023 07:34:47 -0500 X-MC-Unique: 221ga0mcOi6-Nz0bEIpEaw-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 A725A101A52E; Thu, 16 Feb 2023 12:34:46 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-99.pek2.redhat.com [10.72.12.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52401492C3C; Thu, 16 Feb 2023 12:34:38 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, christophe.leroy@csgroup.eu, hch@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@ACULAB.COM, shorne@gmail.com, arnd@arndb.de, Baoquan He , Jonas Bonn , Stefan Kristiansson , openrisc@lists.librecores.org Subject: [PATCH v4 02/16] openrisc: mm: remove unneeded early ioremap code Date: Thu, 16 Feb 2023 20:34:05 +0800 Message-Id: <20230216123419.461016-3-bhe@redhat.com> In-Reply-To: <20230216123419.461016-1-bhe@redhat.com> References: <20230216123419.461016-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 8qsj37s4r16jac3orwpyw9dc6rp9oa6s X-Rspamd-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fYLCNxwQPzv8vHUTfs59mXiSo/qewJPuluuIz66R7P9wLJ4u5NRvBCjj/6gfbJDAJyUrSyzeh71AZ2sp9x9DL0+grnROQq7tmHrikUKRI2HF6sMw7CKAq8TuuoRxCLQodTwTNu28BHZoAYkLmSI4BRr+H3BqpTYM6RV1dSeZHgmmREHdm0njSrqA++kIPFHbg+Nz5PAIf0CiCfKGrfX8dnPkv7FUlFyYsUP9E7BKgPekHLeeRxcw4zq1z42zsV+ppEYujwCNgN4pginzI= 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: Under arch/openrisc, there isn't any place where ioremap() is called. It means that there isn't early ioremap handling needed in openrisc, So the early ioremap handling code in ioremap() of arch/openrisc/mm/ioremap.c is unnecessary and can be removed. Link: https://lore.kernel.org/linux-mm/YwxfxKrTUtAuejKQ@oscomms1/ Signed-off-by: Baoquan He Acked-by: Stafford Horne Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: openrisc@lists.librecores.org --- arch/openrisc/mm/ioremap.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c index 8ec0dafecf25..90b59bc53c8c 100644 --- a/arch/openrisc/mm/ioremap.c +++ b/arch/openrisc/mm/ioremap.c @@ -22,8 +22,6 @@ extern int mem_init_done; -static unsigned int fixmaps_used __initdata; - /* * Remap an arbitrary physical address space into the kernel virtual * address space. Needed when the kernel wants to access high addresses @@ -52,24 +50,14 @@ void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size) p = addr & PAGE_MASK; size = PAGE_ALIGN(last_addr + 1) - p; - if (likely(mem_init_done)) { - area = get_vm_area(size, VM_IOREMAP); - if (!area) - return NULL; - v = (unsigned long)area->addr; - } else { - if ((fixmaps_used + (size >> PAGE_SHIFT)) > FIX_N_IOREMAPS) - return NULL; - v = fix_to_virt(FIX_IOREMAP_BEGIN + fixmaps_used); - fixmaps_used += (size >> PAGE_SHIFT); - } + area = get_vm_area(size, VM_IOREMAP); + if (!area) + return NULL; + v = (unsigned long)area->addr; if (ioremap_page_range(v, v + size, p, __pgprot(pgprot_val(PAGE_KERNEL) | _PAGE_CI))) { - if (likely(mem_init_done)) - vfree(area->addr); - else - fixmaps_used -= (size >> PAGE_SHIFT); + vfree(area->addr); return NULL; }