sensors: occ: Fix the GPU detection code
sensors: occ: Fix the GPU detection code

commit bebe096ee242 ("sensors: occ: Skip GPU sensors for non-gpu
systems") assumes that presence of "ibm,power9-npu" compatible node
indicates the presence of GPUs. However this is incorrect, as even
OpenCAPI is supported via NPU. Thus ZZ systems, which have OpenCAPI
connectors but not GPUs will have "ibm,power9-npu" compatible nodes.
This results in OPAL creating device-tree entries for the GPU sensors
on ZZ systems which don't even have GPUs.

This patch fixes the GPU detection code in occ-sensors, by first
checking for "ibm,ioda2-npu2-phb" compatible node which indicates the
presence of nvlink. Only if such a node exists, do we check with the
OCC for presence of GPUs on systems to confirm the presence of the
GPU. Otherwise, we cut the GPU sensors.

Thanks to Frederic Barrat <c90240987c583ac0802fbeb88cb1684edc683e18@linux.ibm.com> for suggesting
"ibm,ioda2-npu2-phb" for detecting the presence of nvlink GPUs.

cc: 74fabe089ecbd0f3f71683991d9e2780a4de1f4a@lists.ozlabs.org
Fixes: commit bebe096ee242 ("sensors: occ: Skip GPU sensors for non-gpu
        systems")
Reported-by: Pavaman Subramaniyam <781f0612dbdfa73318771f7999a8669d76f0cbc5@in.ibm.com>
Tested-by: Pavaman Subramaniyam <781f0612dbdfa73318771f7999a8669d76f0cbc5@in.ibm.com>
Reviewed-by: Vaidyanathan Srinivasan <c012decff9dffda4c10860ab2ba9eb53320d90bc@linux.ibm.com>
Reviewed-by: Frederic Barrat <c90240987c583ac0802fbeb88cb1684edc683e18@linux.ibm.com>
Signed-off-by: Gautham R. Shenoy <c13571dbffa0eb89c7f8eebdce482897b0f5a685@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <3dfaff8fa6ae977f042064a112a6aac576279b9b@gmail.com>

legoater/skiboot,legoater/skiboot,shenki/skiboot,legoater/skiboot,shenki/skiboot,open-power/skiboot,qemu/skiboot,qemu/skiboot,shenki/skiboot,qemu/skiboot,open-power/skiboot,qemu/skiboot,legoater/skiboot,open-power/skiboot,open-power/skiboot,qemu/skiboot,shenki/skiboot,open-power/skiboot,legoater/skiboot,shenki/skiboot