Received: by 10.223.185.116 with SMTP id b49csp5446955wrg; Wed, 7 Mar 2018 11:55:53 -0800 (PST) X-Google-Smtp-Source: AG47ELtCPRVvuWKjuoUdzohx6dQFbTMXNzw1YLt2kC4KcDip8TUB5sazaI+XUTJxWEXPK3r29pS5 X-Received: by 2002:a17:902:7282:: with SMTP id d2-v6mr21973850pll.303.1520452553370; Wed, 07 Mar 2018 11:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520452553; cv=none; d=google.com; s=arc-20160816; b=WrMF3GywoITXv6b2G1fnpVUKBuQBfy/HZIivAAfIcS8H/Xh9Pbt1DP1k35HV2WUwA3 iD2tbLm/pFkuLJ7IaNQHI2Oyia4Avh57qdBy3nPCarpYzfJqX7I1/PHqkOnsbp2bOuAJ SQx5IdTJXM+7X0dqHQL2HLz9NSCAchDEQ1/TLj5Mv3seiPE90YXWIEi2XAfS6DJh/GZi HwgiA2ebySXBpAN3ms8j+Cv30hyQbTZ/u+lTxwtvy5IMygF9V5cymrUACBvsh8VSVMFb Jz9A+dE2gosGZ/ijLtJ3MJ+2PUpHmS4eTyiRThfwaeRF46MxkjOavH8+dMxnMFAOR1Xe rGRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=NviWQDTcxYn0gEODKy+4bMwZ3NsYvVon1YbNOBUL+qY=; b=T8Xs8V3JTOJKlKwmcCtZwqn1vR+KtDYRVObuY7rPVS9S9H0YGUX4zuMZb8II4XDNys MzGa93I3lLoeSJPFhZRDIhF7pdgrmke3F1w5/N4dmR++gEMPUAd5D34mFxLsXZHu3722 UWYd92RAmlxSIUy3geZbioU3XzaI2lneBbsMm7LqRvdnbG6q0pegf4U1afgp5T7sV2Sl PKkgs5qEdSJEEgm3Ghrz42gCvfHFaEPY1wUM8m23g+boLYH8i4WQPMZJoofldbmCVZye SoQm0pCD5RABJpMkolRQmOvu8xOdsublIjLK/s/WQQu1JsISHge6Tf4DnwPYwi2BO71S jovw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si14443761pfb.232.2018.03.07.11.55.37; Wed, 07 Mar 2018 11:55:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965905AbeCGTyE (ORCPT + 99 others); Wed, 7 Mar 2018 14:54:04 -0500 Received: from mga06.intel.com ([134.134.136.31]:37690 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965786AbeCGTyA (ORCPT ); Wed, 7 Mar 2018 14:54:00 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 11:53:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,437,1515484800"; d="scan'208";a="26071900" Received: from dph9ls1.fm.intel.com (HELO intel.com) ([10.80.209.182]) by fmsmga002.fm.intel.com with ESMTP; 07 Mar 2018 11:53:59 -0800 Date: Wed, 7 Mar 2018 11:46:29 -0800 From: Ivan Gorinov To: Thomas Gleixner Cc: Linux Kernel Mailing List , Ingo Molnar , Rob Herring , Mark Rutland Subject: [PATCH v4 1/4] x86/devicetree: Initialize device tree before using it Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 08d53aa58cb162e6 ("of/fdt: export fdt blob as /sys/firmware/fdt") adds CRC32 calculation in early_init_dt_verify() and checking in late initcall of_fdt_raw_init(), making early_init_dt_verify() mandatory. Required call to early_init_dt_verify() was not added to the x86-specific implementation, causing failure to create sysfs entry in of_fdt_raw_init(). Signed-off-by: Ivan Gorinov --- arch/x86/kernel/devicetree.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 25de5f6..63d2ebc 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -270,14 +271,15 @@ static void __init x86_flattree_get_config(void) map_len = max(PAGE_SIZE - (initial_dtb & ~PAGE_MASK), (u64)128); - initial_boot_params = dt = early_memremap(initial_dtb, map_len); - size = of_get_flat_dt_size(); + dt = early_memremap(initial_dtb, map_len); + size = fdt_totalsize(dt); if (map_len < size) { early_memunmap(dt, map_len); - initial_boot_params = dt = early_memremap(initial_dtb, size); + dt = early_memremap(initial_dtb, size); map_len = size; } + early_init_dt_verify(dt); unflatten_and_copy_device_tree(); early_memunmap(dt, map_len); } -- 2.7.4