From patchwork Tue Oct 30 23:07:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 991177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T9+XqIFM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y5lqsB1L"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42l6cK0mPlz9s8r for ; Wed, 31 Oct 2018 10:09:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=H0L8bNgsTf/a+5VjDN+DlyaCrdU4VjCoEU9gRwajF6s=; b=T9+XqIFMY6MKqeeLbSaD4+SWjd 1CZMgMIba6EPxQEHUr/z5pg/2j94NV34w8pIrC+pBCVPRepYEQOvKyaZPL92rS4E7EgKz90954st5 3vF38rl9Jq4ofh+mtrHjYZVcx3c8gHodIImO3enNhA2BUjD7s1052PpgzSEJ/2BvvNt+wZQqPEL+i 9TQJBhIXTfntxhCcsacskqAOuiuDumFmjTJ7L8gCifyt2oMdeqXtWkttbK/FF3OHPhoB3rpVi9hn/ tlf10V+ZLySf2EHroGL8edSR1diZEw5sSexMYiMzJkhsQABCNzYcKHtJ+20MLV29STkpkAD3oU7+F Lx3eND6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHd8f-0004nU-UE; Tue, 30 Oct 2018 23:09:33 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHd7G-0002xk-U3; Tue, 30 Oct 2018 23:08:11 +0000 Received: by mail-pl1-x643.google.com with SMTP id f10-v6so6310542plr.1; Tue, 30 Oct 2018 16:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+6N59L7uziOsAgqyzMTMg5i7pzRvo06QUV0Qk4gJdCk=; b=Y5lqsB1LgOfxx/6499Fqa4AUIsjBk42mCDBfZsLZVekA1MCAdylnlDRhb20aBFoXJu BaQI7HEK48j8zOiBgokkAKxTFfQv3JyG5UyliaFQkG7bCsktN1hzOD6jGKor3cQ5hQR1 eES0B3Q7/bHbaxNGh1hagCi56P9Vqclo3mmA+ofJKs7pKbmh10vkQHK71zTFrFJQyu4i AgilZ2T2t0Q8ra7+12DEHpndfFHNipxepyFcf2rc4GUh8sULediv+12EH234rwaX5SYv v09ECYSrYEM7Cgb7yrgp7lHMVcY3018DU1qPiaGpxWcGCkbOLPy7l4vfy+Ey+1briBog 6vyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+6N59L7uziOsAgqyzMTMg5i7pzRvo06QUV0Qk4gJdCk=; b=ncb25RUYtcx0LjnWG06ad78/W+V9UdIZnd4oy0M/eNCN6sYH+dfZjOXhIdIb/sUFZh 2iW4DZCs4CMDT76E1PQsmpczYaFdMQ7da7FEP2sydJOrEq6idl+/9fQXRP+ATp9o0aDH Oiv89G2o7PZvRYK/7nlEmkOnFY4V5NdPHJ32suO6FmkCGA/rfUUWLZ8OkT9sNQ6tm7xI qdkdZqrYDDa42R3aXhJxmMnaYKiCcQMVuUDnZirrJZYnq/IFSHTyhQ1WQuvOqlQd+vSa dgDlcKg1DqAwDegtFYG3TrXl1Cc2Q4RGw9U6iM2BeJoxUQL6J2vOkG1sCLusaeyw+rct rNng== X-Gm-Message-State: AGRZ1gLi2b8ohfeeQsEmZiXbfKFSXe1qCmBJPIo7Pbz7I3w999UHa+Sh 4vBsQMdPckI4t0nlI17z40Q= X-Google-Smtp-Source: AJdET5e6Tm0V1+7ThnrWuHbriYgLtVlcTsTc7PUBcGRqkVYR8PmLtYFIK6zqxKx4hbSb69j3aXQ7CA== X-Received: by 2002:a17:902:9a94:: with SMTP id w20-v6mr684585plp.115.1540940875965; Tue, 30 Oct 2018 16:07:55 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id f14-v6sm3431689pgr.87.2018.10.30.16.07.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 16:07:54 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] of/fdt: Remove custom __early_init_dt_declare_initrd() implementation Date: Tue, 30 Oct 2018 16:07:20 -0700 Message-Id: <20181030230721.28429-6-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181030230721.28429-1-f.fainelli@gmail.com> References: <20181030230721.28429-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_160807_473675_34ACE73F X-CRM114-Status: GOOD ( 14.59 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that ARM64 uses phys_initrd_start/phys_initrd_size, we can get rid of its custom __early_init_dt_declare_initrd() which causes a fair amount of objects rebuild when changing CONFIG_BLK_DEV_INITRD. In order to make sure ARM64 does not produce a BUG() when VM debugging is turned on though, we must avoid early calls to __va() which is what __early_init_dt_declare_initrd() does and wrap this around to avoid running that code on ARM64. Signed-off-by: Florian Fainelli --- arch/arm64/include/asm/memory.h | 8 -------- drivers/of/fdt.c | 9 +++++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index b96442960aea..dc3ca21ba240 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -168,14 +168,6 @@ #define IOREMAP_MAX_ORDER (PMD_SHIFT) #endif -#ifdef CONFIG_BLK_DEV_INITRD -#define __early_init_dt_declare_initrd(__start, __end) \ - do { \ - initrd_start = (__start); \ - initrd_end = (__end); \ - } while (0) -#endif - #ifndef __ASSEMBLY__ #include diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index e34cb49231b5..f2b5becae96a 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -892,15 +892,20 @@ const void * __init of_flat_dt_match_machine(const void *default_match, } #ifdef CONFIG_BLK_DEV_INITRD -#ifndef __early_init_dt_declare_initrd static void __early_init_dt_declare_initrd(unsigned long start, unsigned long end) { + /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is + * enabled since __va() is called too early. ARM64 does make use + * of phys_initrd_start/phys_initrd_size so we can skip this + * conversion. + */ +#if (!IS_ENABLED(CONFIG_ARM64)) initrd_start = (unsigned long)__va(start); initrd_end = (unsigned long)__va(end); initrd_below_start_ok = 1; -} #endif +} /** * early_init_dt_check_for_initrd - Decode initrd location from flat tree