From 983ae86905cdbda5a15117f88a48f75f05e1851a Mon Sep 17 00:00:00 2001 From: Cyril Bur Date: Thu, 12 Apr 2018 16:01:57 +1000 Subject: libpdbg: Lazy probing When libpdbg runs though the device tree and calls probe() on all the targets it marks any node (and all its children) which fails to probe as "disabled". When pdbg recieves arguments to specifiy a pib, core or thread (-p -c -t) it runs though the device tree and marks nodes which do not match the specified -p -c or -t as "disabled". These two scenarios are related - that is we don't want to be operating on any disabled nodes. However, they are not the same. Consider HTM wanting to know if the machine has powersave disabled. A simple way would be to loop through all the threads and if any of them are not in "active" state then powersave must be enabled. In this scenario HTM want to be able to get the status of every thread on the machine regardless of -p -c -t flags but if the machine isn't fully speced out and has cores which didn't probe, HTM wants to know to ignore those threads. This patch introduces a "nonexistant" pdbg target status which is set during libpdbg probe() time. Later pdbg can mark nodes to targets that do 'exist' but it would like to avoid as "disabled". Attempting to solve the above problem with only a "nonexistant" flag would also require everything to be probed before selecting out chips and threads that the user is not interested in. This would be highly inefficient. This patch probes the system lazily. Signed-off-by: Alistair Popple Signed-off-by: Cyril Bur --- fake.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fake.dts') diff --git a/fake.dts b/fake.dts index 147785f..56bf35e 100644 --- a/fake.dts +++ b/fake.dts @@ -11,7 +11,7 @@ reg = <0x0 0x0 0x0>; index = <0x0>; - status = "hidden"; + status = "mustexist"; pib@0 { compatible = "ibm,fake-pib"; -- cgit v1.2.1