meta-gbmc-staging: dbus-sensors: gpiosensor: Place initialized flag in object interface
Since the existing code has the `initialized` flag in the GPIOPresence
class directly, which is not supposed to keep `initialized` true for the
entire lifetime of the object, we move it under ObjIfaces to keep the
life cycle of the flag same as the object interface.
Therefore, we can avoid the issue reproduced by
1. Waiting for the sensor of GPIOStatus to be initialized
(Waiting for `initialized` to be true)
2. cp /usr/share/entity-manager/configurations/mobo.json mobo.json.bak
(Back up the original configuration file)
3. rm -r /usr/share/entity-manager/configurations/mobo.json
(Remove the configuration file as new change of the configuration to
gpiosensor)
4. ipmitool power cycle
(Trigger the gpiosensor to receive the new config without restarting
the service, `initialized` is still true)
5. cp mobo.json.bak /usr/share/entity-manager/configurations/mobo.json
(Restore the original configuration file)
6. ipmitool power cycle
(Trigger the gpiosensor to receive the new config without restarting
the service, `initialized` is still true, which misleading the
service that the objects have been created, skipping the
initialization of the interfaces, causing none of the sensors are
exposed on dbus)
Tested:
[After this change]
:~# ipmitool sensor list
BMC_P0_SLOT0_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BMC_P0_SLOT1_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BMC_P0_SLOT2_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BP_12V_CAB_PRSNT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
CPLD_BMC_M2_PRSN | 0x0 | discrete | 0x0100| na | na | na | na | na | na
CPU_PROCHOT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
FAN_BRD_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
FAN_P54V_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
HSBP_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
NCSI_PRSNT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_ALL_FAN | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P3V3_STBY_HSB | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P3V3_STBY_U2 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_DDR_ABD | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_DDR_EFH | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE0 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE1 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE2 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_00_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_01_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_02_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_03_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
THERMTRIP | 0x0 | discrete | 0x0100| na | na | na | na | na | na
...
:~# busctl tree xyz.openbmc_project.GPIOStatus
`- /xyz
`- /xyz/openbmc_project
`- /xyz/openbmc_project/inventory
`- /xyz/openbmc_project/inventory/item
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT0_PRS
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT1_PRS
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT2_PRS
|- /xyz/openbmc_project/inventory/item/BP_12V_CAB_PRSNT
|- /xyz/openbmc_project/inventory/item/CPLD_BMC_M2_PRSN
|- /xyz/openbmc_project/inventory/item/CPU_PROCHOT
|- /xyz/openbmc_project/inventory/item/FAN_BRD_CABLE
|- /xyz/openbmc_project/inventory/item/FAN_P54V_CABLE
|- /xyz/openbmc_project/inventory/item/HSBP_CABLE
|- /xyz/openbmc_project/inventory/item/NCSI_PRSNT
|- /xyz/openbmc_project/inventory/item/PG_ALL_FAN
|- /xyz/openbmc_project/inventory/item/PG_P12V_DDR_ABD
|- /xyz/openbmc_project/inventory/item/PG_P12V_DDR_EFH
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE0
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE1
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE2
|- /xyz/openbmc_project/inventory/item/PG_P3V3_STBY_HSBP
|- /xyz/openbmc_project/inventory/item/PG_P3V3_STBY_U2
|- /xyz/openbmc_project/inventory/item/SLIMSAS_00_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_01_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_02_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_03_CABLE
`- /xyz/openbmc_project/inventory/item/THERMTRIP
:~# cp /usr/share/entity-manager/configurations/mobo.json mobo.json.bak
:~# rm -r /usr/share/entity-manager/configurations/mobo.json
:~# ipmitool power cycle
Chassis Power Control: Cycle
:~# cp mobo.json.bak /usr/share/entity-manager/configurations/mobo.json
:~# ipmitool power cycle
Chassis Power Control: Cycle
:~# ipmitool sensor list
BMC_P0_SLOT0_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BMC_P0_SLOT1_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BMC_P0_SLOT2_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BP_12V_CAB_PRSNT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
CPLD_BMC_M2_PRSN | 0x0 | discrete | 0x0100| na | na | na | na | na | na
CPU_PROCHOT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
FAN_BRD_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
FAN_P54V_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
HSBP_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
NCSI_PRSNT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_ALL_FAN | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P3V3_STBY_HSB | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P3V3_STBY_U2 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_DDR_ABD | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_DDR_EFH | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE0 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE1 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE2 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_00_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_01_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_02_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_03_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
THERMTRIP | 0x0 | discrete | 0x0100| na | na | na | na | na | na
:~# busctl tree xyz.openbmc_project.GPIOStatus
`- /xyz
`- /xyz/openbmc_project
`- /xyz/openbmc_project/inventory
`- /xyz/openbmc_project/inventory/item
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT0_PRS
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT1_PRS
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT2_PRS
|- /xyz/openbmc_project/inventory/item/BP_12V_CAB_PRSNT
|- /xyz/openbmc_project/inventory/item/CPLD_BMC_M2_PRSN
|- /xyz/openbmc_project/inventory/item/CPU_PROCHOT
|- /xyz/openbmc_project/inventory/item/FAN_BRD_CABLE
|- /xyz/openbmc_project/inventory/item/FAN_P54V_CABLE
|- /xyz/openbmc_project/inventory/item/HSBP_CABLE
|- /xyz/openbmc_project/inventory/item/NCSI_PRSNT
|- /xyz/openbmc_project/inventory/item/PG_ALL_FAN
|- /xyz/openbmc_project/inventory/item/PG_P12V_DDR_ABD
|- /xyz/openbmc_project/inventory/item/PG_P12V_DDR_EFH
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE0
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE1
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE2
|- /xyz/openbmc_project/inventory/item/PG_P3V3_STBY_HSBP
|- /xyz/openbmc_project/inventory/item/PG_P3V3_STBY_U2
|- /xyz/openbmc_project/inventory/item/SLIMSAS_00_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_01_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_02_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_03_CABLE
`- /xyz/openbmc_project/inventory/item/THERMTRIP
[Before this change]
:~# ipmitool sensor list
BMC_P0_SLOT0_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BMC_P0_SLOT1_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BMC_P0_SLOT2_PRS | 0x0 | discrete | 0x0100| na | na | na | na | na | na
BP_12V_CAB_PRSNT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
CPLD_BMC_M2_PRSN | 0x0 | discrete | 0x0100| na | na | na | na | na | na
CPU_PROCHOT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
FAN_BRD_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
FAN_P54V_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
HSBP_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
NCSI_PRSNT | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_ALL_FAN | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P3V3_STBY_HSB | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P3V3_STBY_U2 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_DDR_ABD | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_DDR_EFH | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE0 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE1 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
PG_P12V_PE2 | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_00_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_01_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_02_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
SLIMSAS_03_CABLE | 0x0 | discrete | 0x0100| na | na | na | na | na | na
THERMTRIP | 0x0 | discrete | 0x0100| na | na | na | na | na | na
...
:~# busctl tree xyz.openbmc_project.GPIOStatus
`- /xyz
`- /xyz/openbmc_project
`- /xyz/openbmc_project/inventory
`- /xyz/openbmc_project/inventory/item
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT0_PRS
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT1_PRS
|- /xyz/openbmc_project/inventory/item/BMC_P0_SLOT2_PRS
|- /xyz/openbmc_project/inventory/item/BP_12V_CAB_PRSNT
|- /xyz/openbmc_project/inventory/item/CPLD_BMC_M2_PRSN
|- /xyz/openbmc_project/inventory/item/CPU_PROCHOT
|- /xyz/openbmc_project/inventory/item/FAN_BRD_CABLE
|- /xyz/openbmc_project/inventory/item/FAN_P54V_CABLE
|- /xyz/openbmc_project/inventory/item/HSBP_CABLE
|- /xyz/openbmc_project/inventory/item/NCSI_PRSNT
|- /xyz/openbmc_project/inventory/item/PG_ALL_FAN
|- /xyz/openbmc_project/inventory/item/PG_P12V_DDR_ABD
|- /xyz/openbmc_project/inventory/item/PG_P12V_DDR_EFH
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE0
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE1
|- /xyz/openbmc_project/inventory/item/PG_P12V_PE2
|- /xyz/openbmc_project/inventory/item/PG_P3V3_STBY_HSBP
|- /xyz/openbmc_project/inventory/item/PG_P3V3_STBY_U2
|- /xyz/openbmc_project/inventory/item/SLIMSAS_00_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_01_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_02_CABLE
|- /xyz/openbmc_project/inventory/item/SLIMSAS_03_CABLE
`- /xyz/openbmc_project/inventory/item/THERMTRIP
:~# cp /usr/share/entity-manager/configurations/mobo.json mobo.json.bak
:~# rm -r /usr/share/entity-manager/configurations/mobo.json
:~# ipmitool power cycle
Chassis Power Control: Cycle
:~# cp mobo.json.bak /usr/share/entity-manager/configurations/mobo.json
:~# ipmitool power cycle
Chassis Power Control: Cycle
:~# ipmitool sensor list
BMC_P0_SLOT0_PRS | na | discrete | na | na | na | na | na | na | na
BMC_P0_SLOT1_PRS | na | discrete | na | na | na | na | na | na | na
BMC_P0_SLOT2_PRS | na | discrete | na | na | na | na | na | na | na
BP_12V_CAB_PRSNT | na | discrete | na | na | na | na | na | na | na
CPLD_BMC_M2_PRSN | na | discrete | na | na | na | na | na | na | na
CPU_PROCHOT | na | discrete | na | na | na | na | na | na | na
FAN_BRD_CABLE | na | discrete | na | na | na | na | na | na | na
FAN_P54V_CABLE | na | discrete | na | na | na | na | na | na | na
HSBP_CABLE | na | discrete | na | na | na | na | na | na | na
NCSI_PRSNT | na | discrete | na | na | na | na | na | na | na
PG_ALL_FAN | na | discrete | na | na | na | na | na | na | na
PG_P3V3_STBY_HSB | na | discrete | na | na | na | na | na | na | na
PG_P3V3_STBY_U2 | na | discrete | na | na | na | na | na | na | na
PG_P12V_DDR_ABD | na | discrete | na | na | na | na | na | na | na
PG_P12V_DDR_EFH | na | discrete | na | na | na | na | na | na | na
PG_P12V_PE0 | na | discrete | na | na | na | na | na | na | na
PG_P12V_PE1 | na | discrete | na | na | na | na | na | na | na
PG_P12V_PE2 | na | discrete | na | na | na | na | na | na | na
SLIMSAS_00_CABLE | na | discrete | na | na | na | na | na | na | na
SLIMSAS_01_CABLE | na | discrete | na | na | na | na | na | na | na
SLIMSAS_02_CABLE | na | discrete | na | na | na | na | na | na | na
SLIMSAS_03_CABLE | na | discrete | na | na | na | na | na | na | na
THERMTRIP | na | discrete | na | na | na | na | na | na | na
...
:~# busctl tree xyz.openbmc_project.GPIOStatus
Only root object discovered.
Fusion-Link:
platform5: https://fusion2.corp.google.com/6892e471-137d-3958-86e0-b0060d895eb6
platform15: https://fusion2.corp.google.com/dbfae27e-b364-30f4-b47e-0a7cb12c2c2c
platform18: https://fusion2.corp.google.com/bd1ca786-08d5-37a0-a38b-21dff73a4dd8
platform17: https://fusion2.corp.google.com/408db29e-ac3e-32b6-b544-4d82cbfef12f
platform11+ext: https://fusion2.corp.google.com/e712c5fd-99af-3677-8bc3-98ecfd2d95bd
platform11: https://fusion2.corp.google.com/79a535aa-2e11-3c96-93ad-aba145035c57
Platforms-Affected: All
Google-Bug-Id: 489214332
Change-Id: I1c2c253df4a8a5a217aa1ce09e4e6a89fc5b7e29
Signed-off-by: Brian Chiang <chiang.brian@inventec.corp-partner.google.com>
1 file changed