From: Rob Herring <robh@kernel.org> Date: 2021-10-28 18:33:58
Use of of_scan_flat_dt() function predates libfdt and is discouraged as
libfdt provides a nicer set of APIs. Rework dt_scan_depth1_nodes to use
libfdt calls directly. Rather than searching for any node not /chosen or
/hypervisor, let's just check for something always required which is the
arch timer.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
arch/arm64/kernel/acpi.c | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
From: Mark Rutland <mark.rutland@arm.com> Date: 2021-10-29 09:38:54
Hi Rob,
On Thu, Oct 28, 2021 at 01:33:55PM -0500, Rob Herring wrote:
Use of of_scan_flat_dt() function predates libfdt and is discouraged as
libfdt provides a nicer set of APIs. Rework dt_scan_depth1_nodes to use
libfdt calls directly. Rather than searching for any node not /chosen or
/hypervisor, let's just check for something always required which is the
arch timer.
The reason for checking for /chosen and /hypervisor specifically was
that we specifically permit a "stub" DT which only contains those nodes
and nothing more. This is also mentioned in the comment block in
acpi_boot_table_init().
I'm not keen on this change because it opens the door for people to
place arbitrary things in the DT as long as they don't add a timer node,
and I'd prefer that we continue to check for /chosen and /hypervisor
specifically.
Can we re-implement the existing logic using libfdt calls? e.g. using
fdt_for_each_subnode() on the root node?
Thanks,
Mark.
From: Rob Herring <robh@kernel.org> Date: 2021-10-29 14:21:00
On Fri, Oct 29, 2021 at 4:38 AM Mark Rutland [off-list ref] wrote:
Hi Rob,
On Thu, Oct 28, 2021 at 01:33:55PM -0500, Rob Herring wrote:
quoted
Use of of_scan_flat_dt() function predates libfdt and is discouraged as
libfdt provides a nicer set of APIs. Rework dt_scan_depth1_nodes to use
libfdt calls directly. Rather than searching for any node not /chosen or
/hypervisor, let's just check for something always required which is the
arch timer.
The reason for checking for /chosen and /hypervisor specifically was
that we specifically permit a "stub" DT which only contains those nodes
and nothing more. This is also mentioned in the comment block in
acpi_boot_table_init().
There will be a compatibility problem if another node is ever added to the stub.
I'm not keen on this change because it opens the door for people to
place arbitrary things in the DT as long as they don't add a timer node,
and I'd prefer that we continue to check for /chosen and /hypervisor
specifically.
How would one use that? The DT is never unflattened. I guess
early_init_dt_scan() could find something.
Can we re-implement the existing logic using libfdt calls? e.g. using
fdt_for_each_subnode() on the root node?
From: kernel test robot <hidden> Date: 2021-10-29 15:34:06
Hi Rob,
I love your patch! Perhaps something to improve:
[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on arm-perf/for-next/perf arm/for-next soc/for-next kvmarm/next v5.15-rc7 next-20211029]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Rob-Herring/arm64-Simplify-checking-for-populated-DT/20211029-023532
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-c004-20211028 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>
cocci warnings: (new ones prefixed by >>)
quoted
arch/arm64/kernel/acpi.c:71:26-31: WARNING: conversion to bool not needed here