Clean pins structure in case of disconnected pin

In cases when only one type of device (PSS or EEC) is connected, the ptp
notification app stay stuck in FAILURE-NOFIX even when the disconnected
device change to connected status.

To solve this, the pins structure is cleaned when only one device is
connected (PSS or EEC) forcing a new pin read on the next validation.

TEST PLAN:
PASS: Status change to FAILURE_NOFIX in case of disconnected pin
PASS: Status change to LOCK_HO_ACQ in case of connected pins in EEC and
      PPS devices

Closes-bug: #2121704

Change-Id: Ib78331f2526add179a65f094e2646b472e27be5c
Signed-off-by: Eduardo Alberti <eduardo.alberti@windriver.com>
This commit is contained in:
Eduardo Alberti
2025-08-29 14:03:58 -03:00
parent dcb4d0d66d
commit 8a77c31594

View File

@@ -151,6 +151,7 @@ class CguHandler:
NetlinkException: error when Netlink wasn't initialized, or no info
is read.
"""
LOG.debug("Reading all devices")
try:
get_pins = self._dpll.get_all_pins()\
.filter_by_device_clock_id(self._clock_id)\
@@ -174,11 +175,13 @@ class CguHandler:
NetlinkException: error when Netlink wasn't initialized, or no info
is read.
"""
LOG.debug("Reading only filtered pins")
try:
new_pins = DpllPins()
# Create a set of pins to read
pin_ids = {x.pin_id for x in self._pins}
LOG.debug("Filtered pin IDs: %s", pin_ids)
for pin_id in pin_ids:
# Get pin (for each pin_id) and filter by device_id.
@@ -238,6 +241,7 @@ class CguHandler:
pin = self._pins.filter_by_device_type(device_type)
if len(pin) == 0:
self._pins = None
return LockStatus.UNDEFINED.value
return next(iter(pin)).lock_status.value