Skip to content

Commit 555e917

Browse files
firmware: arm_scmi: Add support for debug counter decrement
Introduce a new `scmi_dec_count` helper to complement the existing `scmi_inc_count`, allowing controlled decrement of SCMI debug counters. This provides symmetry in debug counter management and enables accurate tracking of counters that may both increase and decrease, such as those used for in-flight message tracking. Only active when CONFIG_ARM_SCMI_DEBUG_COUNTERS is enabled. Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Philip Radford <philip.radford@arm.com> Message-Id: <20250630105544.531723-2-philip.radford@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
1 parent ad28fc3 commit 555e917

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/firmware/arm_scmi/common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ static inline void scmi_inc_count(atomic_t *arr, int stat)
314314
atomic_inc(&arr[stat]);
315315
}
316316

317+
static inline void scmi_dec_count(atomic_t *arr, int stat)
318+
{
319+
if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS))
320+
atomic_dec(&arr[stat]);
321+
}
322+
317323
enum scmi_bad_msg {
318324
MSG_UNEXPECTED = -1,
319325
MSG_INVALID = -2,

0 commit comments

Comments
 (0)