Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp399352iob; Wed, 11 May 2022 17:31:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoauefbiHDTG74MMyeiAPhoXsd8K86yxtnmM6kbmbGyXhsTY59eRENN15rvu3FxbTTiyb4 X-Received: by 2002:a17:903:1c5:b0:15e:a42b:7b4a with SMTP id e5-20020a17090301c500b0015ea42b7b4amr27786314plh.111.1652315467960; Wed, 11 May 2022 17:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652315467; cv=none; d=google.com; s=arc-20160816; b=R1erfYi0uDFokkYOgXIG9R1LqaL4H0RJpcA7as1idiJiJJTYN8QZzp7ho0PYDGwjKz nvN+rZ+/LVJCmytCmE5BYkjzTQ/0FjcWk56RCiFWBGlc+HnyXakNcziHVROHG51o0Ynx TKJOnDgeKyKauhfXjJZ3HIk/OeEcLlRKjs5qhWzbvSAT4MpV7MtfkJ0En+GLqeTKEl9F oCjqss7EEfBeIJz+zoLOXNCoRJUsbgSBXb2x7kd51ozZsRTBiYrYkOXoSite1CIhtajq xPBwuM6i+7IF6EAT4OxiRn0QOX7RbvEZhCMmhEL28xcnYTeVOg1CE7ZTDsWoOy0EVEOm 8W7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=HTfrM8QlqH4nkEPasmY9G3S9KMcBiT9YOE6IBgway5Q=; b=FlanInC3DC+gWL6mt6js08V2PWLfD/WqqYWgzaDESQR1W5feSmfkFnc2+F1IAU7Ynt FDTM+uqt2T5ABdUlVWk9pvEbYfkYI/5FSCO7KzsItCo2t0S59Df+EH6dOBwiuWwyARbb LMcu9HVM27cJ/BG7Q6Ty+7QZz6IiUtka1EyO6S0YPQ00Kx3hsGFh6LtvbmxhJV7xognc lQyYqBC5ZemXgPTMTZoq5eaTSTBaPtazu5AxY5/4iaa3ljWCeqx4rziWKLdGoq7wdFZd LFUstbrAwYV8QGoU+z0Pw+p7v/h+P5+fr+uVnndBcw7MDHUIzLpAnje9+XRMJhCPf9lA dnpA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020aa780cd000000b004fa831f601csi3683543pfn.231.2022.05.11.17.30.43; Wed, 11 May 2022 17:31:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238514AbiEKLZb (ORCPT + 99 others); Wed, 11 May 2022 07:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiEKLY7 (ORCPT ); Wed, 11 May 2022 07:24:59 -0400 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C138D233A7C for ; Wed, 11 May 2022 04:24:21 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R331e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0VCvu-9A_1652268255; Received: from localhost(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0VCvu-9A_1652268255) by smtp.aliyun-inc.com(127.0.0.1); Wed, 11 May 2022 19:24:16 +0800 From: Xianting Tian To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, akpm@linux-foundation.org, anup@brainfault.org, wangkefeng.wang@huawei.com, rppt@kernel.org, alex@ghiti.fr, twd2.me@gmail.com, david@redhat.com, seanjc@google.com, petr.pavlu@suse.com, atishp@rivosinc.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, guoren@kernel.org, jianghuaming.jhm@alibaba-inc.com, Xianting Tian , Nick Kossifidis Subject: [PATCH] RISC-V: Remove IORESOURCE_BUSY flag for no-map reserved memory Date: Wed, 11 May 2022 19:24:13 +0800 Message-Id: <20220511112413.559734-1-xianting.tian@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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 Commit 00ab027a3b82 ("RISC-V: Add kernel image sections to the resource tree") added IORESOURCE_BUSY flag for no-map reserved memory, this casued devm_ioremap_resource() failed for the no-map reserved memory in subsequent operations of related driver, so remove the IORESOURCE_BUSY flag. The code to reproduce the issue, dts: mem0: memory@a0000000 { reg = <0x0 0xa0000000 0 0x1000000>; no-map; }; &test { status = "okay"; memory-region = <&mem0>; }; code: np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0); ret = of_address_to_resource(np, 0, &r); base = devm_ioremap_resource(&pdev->dev, &r); // base = -EBUSY Fixes: 00ab027a3b82 ("RISC-V: Add kernel image sections to the resource tree") Reported-by: Huaming Jiang Reviewed-by: Guo Ren CC: Nick Kossifidis Signed-off-by: Xianting Tian --- arch/riscv/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 834eb652a7b9..71f2966b1474 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -214,7 +214,7 @@ static void __init init_resources(void) if (unlikely(memblock_is_nomap(region))) { res->name = "Reserved"; - res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; + res->flags = IORESOURCE_MEM; } else { res->name = "System RAM"; res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; -- 2.17.1