From patchwork Fri Feb 2 19:59:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 196016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp668475dyc; Fri, 2 Feb 2024 12:01:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsL5Z1eQEv5n6atBTGrvvhKlsWRn/NZ3vWEQZTvE8MXPAIP4eQo0TARW2RmWSr79gbM8Qn X-Received: by 2002:a67:f4d2:0:b0:46d:7a:70e7 with SMTP id s18-20020a67f4d2000000b0046d007a70e7mr2828288vsn.10.1706904086513; Fri, 02 Feb 2024 12:01:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706904086; cv=pass; d=google.com; s=arc-20160816; b=P9K9Ku+swhjJjJmL+344I47+DlCfs9Vm/rSwxAHig21kNfFOuQefuHTVwYfCBF4Cdd hyEbV+Z2rWV6whsE9ArtGtq4sOpVh5wtAG9pVEgsIFYfsGiL4FH0y8FpHTIK04V22lw5 TvDz0J5kaJVC/+Yb7f4bDzVx7Na23EYfHf1EhYpjENrmMzz528csT901bw1mWABI6pLt 5FebO+3ymEJCrQhmGE31ndysWSDOVbsozBReFFf5YxPIJUDzSIlHapK5Ep2ZUGxODVz2 rB0kKRrn8zPVMz/rffHfR+domfDh7TF0AZ3ZIDijDkEkWqbsT2I3Q1rIssOMmmvJKPh2 yFmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6ibBvNWtj9I8biZ96CkFZ4v4tfreGCPhIbpTACz17i8=; fh=h0xJcp2ZGP5h/yXu0TVeZ3UUUJGOKI4Q7upqZ8akbcU=; b=ZwmWf7dUKGEXcQwS0RlSYKRzPbf4tH8KPf9D/mtfkHbVOMMu1l73H7X3oKg5jK7/rT P5ybXKZGx6g+P7qnZTvUJU8vifx2ULvmfy5Pad2/wYLBluE+IgTKgNAQ12mkGyZthBaP 0grToTItRvRI9CU+XmsaKTCELfV5taaQhETfxeAzIPgjZCJoUCeM6m7Wvn25Um0wrpaF IDIIh5DUE0fvHYqmj55fmOas/+FoltGSAo9Bkwc2i5OaEm1ll6ohHpAUuE3oLcRhiYe7 Jb61/lqOq63idiUiDt6NFmI3Y8Q/FL4VuwYqhl5iRvWABEUfBSrOxV0RZ5CCmh4FQ1dC xpvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CKk7oRVP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50514-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50514-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWGrq5rcVXDVghffdGaa+NBFqlFPW1FPB3z5wOtD8xaphhnlhG1Mdr20XKkNPNeUoggmuy4T5H7aT7aa+Ar+bAdqztGmg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dd11-20020a056102568b00b0046b471d791bsi427153vsb.450.2024.02.02.12.01.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 12:01:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50514-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CKk7oRVP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50514-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50514-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4898E1C24B18 for ; Fri, 2 Feb 2024 20:01:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98F7312C7EA; Fri, 2 Feb 2024 19:59:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CKk7oRVP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B68CC81732; Fri, 2 Feb 2024 19:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706903955; cv=none; b=SZ9kB11jMULlBfJHTJh7tr9kwQK1sE68c5kDPaE80tbRnFH+W0C1slKHkUcpa6Y5SVkWtGBWz2taGPMhlxeCyBV0Ju0uW8net/Y9VTa59PvXqf/jPnBUldeVzA/C5mn3JMagYRFcwrN2TkOmw7viAihy86HgJd+wtErTG9Gac7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706903955; c=relaxed/simple; bh=Ik7PysFz2Q/PQymMpEmnCsC39bu2MIXYeb1T3HpNV9c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=plsQUWDOW+J4pBC4W5n8jkeSx+ZbdaaUPTxiPUknGRLE5WHrQB9k2/89O4pSTLzwZiPImNA7RwlzALUeM0DHopW1hEmj+fQnaWKUbnhxsIquqCmx0YAcoXfxiR7WZFisAMrXQd3ndPz1TtKBBjAQpJLRl1y5ujxzhtegvsBATsA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CKk7oRVP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A256FC43601; Fri, 2 Feb 2024 19:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706903955; bh=Ik7PysFz2Q/PQymMpEmnCsC39bu2MIXYeb1T3HpNV9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CKk7oRVPGb6C4HwkiFVL7iT8eK5Iik/EDFzYFOWPTWd77I5UUfPzNd7aKEoHobNdK k6Iw7l3n0kK1QlfHNjMomlOOIirYwU1YpZobTyaCqSTvK63/LTQWC3U/94Wr+aCo1K 394zegdhvm14D9LJ9NsIivpUSTTgKA8VMQ+qda/ZZNZWNO9pqhQWXlJ356r8GK1dg/ Y9EE2/Xe7HhWLyB8r206UzMDMPWCWCqSs4f0n5ApmA9aFdeFK0zgM70sRYd1vQf03A xHklCpZJB3PdHRb1/vDAF5/fzpbWmHhXlWWWVeSgi2bjCoLOEJCf9ZpZ0n4+cooxP7 oZE/QJs34kWsw== From: Stephen Boyd To: Rob Herring Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, devicetree@vger.kernel.org, Frank Rowand , Catalin Marinas , Will Deacon , Mark Rutland Subject: [PATCH v3 5/7] arm64: Unconditionally call unflatten_device_tree() Date: Fri, 2 Feb 2024 11:59:06 -0800 Message-ID: <20240202195909.3458162-6-sboyd@kernel.org> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog In-Reply-To: <20240202195909.3458162-1-sboyd@kernel.org> References: <20240202195909.3458162-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789818658916378796 X-GMAIL-MSGID: 1789818658916378796 Call this function unconditionally so that we can populate an empty DTB on platforms that don't boot with a firmware provided or builtin DTB. When ACPI is in use, unflatten_device_tree() ignores the 'initial_boot_params' pointer so the live DT on those systems won't be whatever that's pointing to. Similarly, when kexec copies the DT data the previous kernel to the new one on ACPI systems, of_kexec_alloc_and_setup_fdt() will ignore the live DT (the empty root one) and copy the 'initial_boot_params' data. Cc: Rob Herring Cc: Frank Rowand Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Signed-off-by: Stephen Boyd --- arch/arm64/kernel/setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 417a8a86b2db..ede3d59dabf0 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -351,8 +351,7 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p) /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); - if (acpi_disabled) - unflatten_device_tree(); + unflatten_device_tree(); bootmem_init();