From patchwork Mon May 15 09:08:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13240984 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 A8869C7EE22 for ; Mon, 15 May 2023 09:09:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 443DE900006; Mon, 15 May 2023 05:09:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F286900002; Mon, 15 May 2023 05:09:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BA72900006; Mon, 15 May 2023 05:09:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 1D1E9900002 for ; Mon, 15 May 2023 05:09:33 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D9F9AA1390 for ; Mon, 15 May 2023 09:09:32 +0000 (UTC) X-FDA: 80791916184.04.8D1133E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 1ADE2120009 for ; Mon, 15 May 2023 09:09:29 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CUIOMLhF; spf=pass (imf29.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.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=1684141770; 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=4rIuSWqi3GEP/Jv79CEPULZ2sl34NSoHdPKg6SWQDJNJUDhCXujKeFVKzRLjrUqCrWpT+D UPbbfIP0oV02JbqvPDUKDLNQemUx86F5AxAFrcdhgsjsfv/MUUHHVjOXTf0YOjLtMYx5jj DlTCDMP8Hu4BAiMhYllLmhEcU/79HfA= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CUIOMLhF; spf=pass (imf29.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.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=1684141770; a=rsa-sha256; cv=none; b=Ao7jGvTXTgO+MLOm7V2Evi999Fm2+NEwMUtE3jNGyEjYQ7W6ceMsiXBq+veF/mGEBndXvl 7H9DfMbvyd6Gx26aKz+78Wx8jAvAPk+mL+UGv2tbdMriyBjeMajQd9p/tjLnwc3bhbS+Xj LE71WRmYJWx1f3Eyh/NRmH/UUPG7zUI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684141769; 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=CUIOMLhFqXoMmNzwyJpNa4ORFdydvVtpkvgA2U+17WVeNJYVlB0zJV++A9B1Qv19D72w+X 5zovLSkMV39mLEkCw9sfhOtwFop/q8Dx+MLlLXYH0hoJPJnoFU/OY8lx3DhWcsjLxVCiBx 29iQaczgy+RG0gJr2eT7fKinZ9b9qCE= 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-390-F9OGOUBiNvmyjtoAQ6ukpQ-1; Mon, 15 May 2023 05:09:25 -0400 X-MC-Unique: F9OGOUBiNvmyjtoAQ6ukpQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB38B1C08780; Mon, 15 May 2023 09:09:24 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-32.pek2.redhat.com [10.72.12.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1006440C2063; Mon, 15 May 2023 09:09:15 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, 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, willy@infradead.org, deller@gmx.de, Baoquan He , Jonas Bonn , Stefan Kristiansson , openrisc@lists.librecores.org Subject: [PATCH v5 RESEND 03/17] openrisc: mm: remove unneeded early ioremap code Date: Mon, 15 May 2023 17:08:34 +0800 Message-Id: <20230515090848.833045-4-bhe@redhat.com> In-Reply-To: <20230515090848.833045-1-bhe@redhat.com> References: <20230515090848.833045-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Stat-Signature: 43j8mkns1s9pfnikpx3ff7rzwxi6txqa X-Rspamd-Server: rspam05 X-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N46p6Iw9/5Dy/30L1fv0z1Cs/rD+DIHtkbc4p307KN9VYz7ku+zfZegeLjKlz8H0m3EQK8ZzTLxC48crBGrzgSwF31Dk9XxbfkT52ENlOQdyrjJB/WXMiUNac2wkFsQBHm0du+fv9q1+9jiIm9VXLnKa8FINU/dOK479XturxzcwmMvkASUpH2JNIm5UNExQOUBip/e5bxPQxUQ4vQveLzHRThR+SFRbKvvbmnB8a0Ygy5v9ep6LIfCtNA7RT8RbPVs+yUdkk24o8ARLL0omEJsSaakrI 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 Reviewed-by: Christoph Hellwig --- 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; }