Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp667897rwd; Tue, 16 May 2023 06:24:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60L6/Axha8dcOoO/XZZjlGl5/yt5/znxQY1OUW4zmxwmL9qMcNB09LjXCUKpQukCdZr/DF X-Received: by 2002:a05:6a20:7349:b0:106:b4d9:8de4 with SMTP id v9-20020a056a20734900b00106b4d98de4mr5039054pzc.5.1684243489629; Tue, 16 May 2023 06:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684243489; cv=none; d=google.com; s=arc-20160816; b=Fzfh7aLtRQRBSsz93ByVSRScws++CaA7yHh3qdYJ7Sp/tn312Q7P3RxUCVXkCwfmbk SB4TZpjNK9y8rZsgHQD/485INh5vqeu4ncEpSTA4iAxKL9jVFk1D09eqABUFDlc+ihfm mLz37H/Fnwz1iGM59WK25wRMJbTp9hSHp6axhJYUeNF3OcfavcoagAdfNP/iG4LBU48/ y0W4FhPloNNgFqRq6O4xxAmZBKurA2qSGnwb10CqWfV6dfsZKfnnXqxdOoEV9IwYnkUJ x9gGEm+DKUApB3S79zrCblMGIeSemCtVjBXlY0j42RJ6xEQh3QD5uVcC3BHvRUukTbmX FIUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tINlKvgyQ2vAChliCA1uarlkfAXboH0fEYXvp0VtNa8=; b=ZcT2lo6aGxHKlaQdTYcShvdkQAsw7wEGmlYAn7s1X0UfWLkF3Y+PrVizMqzGeKtgxg Wo9z6FKr6CjXxDw3RQ8zd6g6xrl8y3IBS3aXGABNYp8cX51RnjvZ4HBEOvD475WS5wL2 iJ4p6qeJEVVlXNuuLgSPrb/FKSmPq/66MtCaQA2bHUY0n6f65q66IS2jN+P3+ga0evl7 rVA0eYZEL2zrpy5sDG3pDX8Gs9bH0lGy1MnTE2SVGGx7ANspIHZszaVSmVkGIMDDQhwT elle41DCI1CX6mFUuRJKqShhbLhxNk90+0CM6LU2vntNJCrbWLEPdO05DLVEqDtge3v/ s8MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YVwN4ss6; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b24-20020aa79518000000b006434a04f2fcsi19460381pfp.297.2023.05.16.06.24.33; Tue, 16 May 2023 06:24:49 -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=@redhat.com header.s=mimecast20190719 header.b=YVwN4ss6; 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 S233462AbjEPNFx (ORCPT + 99 others); Tue, 16 May 2023 09:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233522AbjEPNF2 (ORCPT ); Tue, 16 May 2023 09:05:28 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A1D13AB5 for ; Tue, 16 May 2023 06:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684242226; 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: in-reply-to:in-reply-to:references:references; bh=tINlKvgyQ2vAChliCA1uarlkfAXboH0fEYXvp0VtNa8=; b=YVwN4ss6jwJEsfHE+3sIoruLuIflHiNgq9Oim+Lfupv8uY2PKSe70Y52pmFBafUnfFRKfp 5uS9psnP9kHTWiwlncNc/40erE46546ngljvk6Za0ob+YEHor5yplpRD/Lj1QMSsaXk92V BGEvKBMKKdU04TrT/dEKR5h+ohllVz4= 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-264-RiGwLzi-MrG956DbXJ3JHg-1; Tue, 16 May 2023 09:03:42 -0400 X-MC-Unique: RiGwLzi-MrG956DbXJ3JHg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96A52101A551; Tue, 16 May 2023 13:03:41 +0000 (UTC) Received: from localhost (ovpn-12-79.pek2.redhat.com [10.72.12.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EDF3C63F5F; Tue, 16 May 2023 13:03:39 +0000 (UTC) Date: Tue, 16 May 2023 21:03:36 +0800 From: Baoquan He To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, 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, Jonas Bonn , Stefan Kristiansson , openrisc@lists.librecores.org Subject: Re: [PATCH v5 RESEND 03/17] openrisc: mm: remove unneeded early ioremap code Message-ID: References: <20230515090848.833045-1-bhe@redhat.com> <20230515090848.833045-4-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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,T_SCC_BODY_TEXT_LINE 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 On 05/16/23 at 09:17am, Mike Rapoport wrote: > On Mon, May 15, 2023 at 05:08:34PM +0800, Baoquan He wrote: > > 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. > > It looks like early ioremap was the only user of fixmap on openrisc, so it > can be removed as well. You are right, and you are saying the relic in iounmap() about fixmap handling, hope I got it right. I will remove it, the code will be more cleaner. Thanks. > > > 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; > > } > > > > -- > > 2.34.1 > > > > > > -- > Sincerely yours, > Mike. >