Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1449494rdb; Fri, 16 Feb 2024 17:17:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXjXgnoO9sABpphi4EATIuBuI38FB7DK3V5Ykk/U2/y9IkCXqcqcpj2XSikDunf/ob0bMXPi0sxbQ2UPvaPwlzyIztQDisDmRHWee/x2Q== X-Google-Smtp-Source: AGHT+IEAYMX8KPxOfB5/ckKnAj7LVHM3ObOnUrMcHwCWL2s2vocLktJbGrwln35Mhzhi99tNf69U X-Received: by 2002:a05:6a20:c704:b0:19f:2df0:1410 with SMTP id hi4-20020a056a20c70400b0019f2df01410mr7382614pzb.53.1708132665013; Fri, 16 Feb 2024 17:17:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708132665; cv=pass; d=google.com; s=arc-20160816; b=pEhTbPJ3RaZ9mZ1JDa2jSYaT73AoeXXymv/MNzEEGLbn96VRoAqUbcRL08eqNFdUSv FsSU1U5pJAZEV7RcaIKZoddfMTswAXC4XsHAlU6a6Tomze0dHMXYnzUUkgJpOE6DpARv F+D/1SI2RugYufbL81Sh7xpDLBLzArnyhOzvlH71dXu2RxCXW5WFrQX7IDCiqETn0lZS 2TuLhY+wLH/WrCAcy8u62L+Qndb5MBbX3ByZGCSuCSgZHAfL5j35ZaxEpkd2su+zSUI/ HbTFjUwMry7IPYy+hbjHv3RIrDBcHyxbL2hcLUfkN+nJZ6yPmQ5DkLFjCXkXhxXV5Zlq 2A1w== 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=fu8ZVXP+jo7D5EaQ1/47p5cYa+9qDZG+rGOe1sBHnWk=; fh=sz1LeV376A5PAD24wWsZ2HxecezkpG42RO1kUhR4ZVE=; b=G2yAvcdw+ZjDjTSdMUX5X5k+tiQd7knkpbpyMuXRDot+gnj7z4LVf4b51FWDqiw2WW sCj5uRx97RPyYl9uPn8Z7Jcf4lzaGLUz77BzS8Xkjv5RV6NYmEm/qePCt3nbfLTUJmCr cww0TH5muse6qb+s4sLMWU1y4cTSQ3e+2gylvtGEuzwYrjRGKAYVeXBOW5Sygr8CL1Wb zwcwunAzxfM14CArAYEDKeJUstgJrONBaRL1tjZtJII+I6klCze9ZEESno4GIs77Ouka H33eH2DfzqYdrZwQUMmokk+uwEeU4G6ODPXA5CE5I0Fm+Yrj6iSpUB0YaIWMmZ7tH1St KZ4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nWHPrdK5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bn2-20020a056a02030200b005dc76f56a18si694154pgb.559.2024.02.16.17.17.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 17:17:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nWHPrdK5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69628-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 995D9B22099 for ; Sat, 17 Feb 2024 01:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C623B2033A; Sat, 17 Feb 2024 01:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nWHPrdK5" 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 C7B2F200AD; Sat, 17 Feb 2024 01:06:00 +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=1708131960; cv=none; b=hGhvUpypWcAef3fk7Kxsgi+YPWHKRqXjhvSqYMdmq974s1c15ysXi3gR1LZe4Jj7flw5j5OIOlawu3vP2e42ffnR4sJezwg7qHEmlqJ7QXiV9gKgUNIYo4m+rJ2NzLgbmiqqUMu2eajoq32vVxmWUReFq8PNRPq7VQXyI7hTGgw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708131960; c=relaxed/simple; bh=bAiFEbT58TXbP+zf0tFWIGODmRi8LJ7psP4/tHXmMrI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oipN2FitzHPpQwjTmbtft5MGZAoxajicanu/Uft9bBX/lzx5JWGNLo7ixPXY9Z+xID/wl+dP/OP6ji/2eXylsTOGydGFQg+97IE5K3O9QeMGKMFASRWt8dFdNzREft5vEa4sPu4DSe7hLPV+N9icjQnCHXIbxEmtXEd+aGJw3Cw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nWHPrdK5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBAC4C32789; Sat, 17 Feb 2024 01:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708131960; bh=bAiFEbT58TXbP+zf0tFWIGODmRi8LJ7psP4/tHXmMrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nWHPrdK51ANKmmUE3NqJATrEVu6sf4ZIcdhvGIb1FIOmfGEAlBBUzElIK3HXYvtau HM8OPq8HMxmE9tV8EHUsdjlUrBVacmJLtTFqEgDvSIkYu//JsuZnSiCygfMUAUP5p2 WzURYNN7LTNRzRNRTMPM9s9UNIbyHCFzBjQQSta0mjCFfUeA2MLNLYbltHu4sA/nRK xAhmAwqIQ5hcPyyiybY2EYhSeBudz+h/5mDdVenucdfsF+wgwIZur9UXrCkkKGQ4EE 8ioWUb7gB4t06y/Xgd2WQLhkZe9z3EacufoevPtfc57OygRYn0npOjK9jtlF4dknIo FNcCYQOdi1FQw== 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 , Richard Weinberger , Anton Ivanov , Johannes Berg Subject: [PATCH v4 3/7] um: Unconditionally call unflatten_device_tree() Date: Fri, 16 Feb 2024 17:05:52 -0800 Message-ID: <20240217010557.2381548-4-sboyd@kernel.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240217010557.2381548-1-sboyd@kernel.org> References: <20240217010557.2381548-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Call this function unconditionally so that we can populate an empty DTB on platforms that don't boot with a command line provided DTB. There's no harm in calling unflatten_device_tree() unconditionally. If there isn't a valid initial_boot_params dtb then unflatten_device_tree() returns early. Cc: Rob Herring Cc: Frank Rowand Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Cc: Signed-off-by: Stephen Boyd --- arch/um/kernel/dtb.c | 14 +++++++------- drivers/of/unittest.c | 4 ---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/um/kernel/dtb.c b/arch/um/kernel/dtb.c index 484141b06938..4954188a6a09 100644 --- a/arch/um/kernel/dtb.c +++ b/arch/um/kernel/dtb.c @@ -16,16 +16,16 @@ void uml_dtb_init(void) void *area; area = uml_load_file(dtb, &size); - if (!area) - return; + if (area) { + if (!early_init_dt_scan(area)) { + pr_err("invalid DTB %s\n", dtb); + memblock_free(area, size); + return; + } - if (!early_init_dt_scan(area)) { - pr_err("invalid DTB %s\n", dtb); - memblock_free(area, size); - return; + early_init_fdt_scan_reserved_mem(); } - early_init_fdt_scan_reserved_mem(); unflatten_device_tree(); } diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index cfd60e35a899..891752a20a5f 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -4087,10 +4087,6 @@ static int __init of_unittest(void) add_taint(TAINT_TEST, LOCKDEP_STILL_OK); /* adding data for unittest */ - - if (IS_ENABLED(CONFIG_UML)) - unittest_unflatten_overlay_base(); - res = unittest_data_add(); if (res) return res; -- https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/ https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git