From 6bcffd57bb1e7653541fcfc38a4140a67e26a8a6 Mon Sep 17 00:00:00 2001 From: Asutosh Mohapatra Date: Wed, 17 Aug 2022 16:04:02 +0530 Subject: [PATCH] qcacmn: Handle gracefully if scheduler cb is not registered Currently when firmware crashes during driver load, message queue handlers for scheduler context are not registered. While handling the FW down event, driver posts the message to scheduler queue. Since the queue handler is not registered, it results in crash. To address this issue, handle the msg gracefully and return error in case callback is not registered. CRs-Fixed: 3251983 Change-Id: I5dd55e701cf332153dca1f6678271506b9690f6e --- scheduler/src/scheduler_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scheduler/src/scheduler_api.c b/scheduler/src/scheduler_api.c index a01f8ffacd9b..07d2b7605a6e 100644 --- a/scheduler/src/scheduler_api.c +++ b/scheduler/src/scheduler_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. - * + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -288,7 +288,7 @@ QDF_STATUS scheduler_post_msg_by_priority(uint32_t qid, } if (!sched_ctx->queue_ctx.scheduler_msg_process_fn[qidx]) { - QDF_DEBUG_PANIC("callback not registered for qid[%d]", que_id); + sched_err("callback not registered for qid[%d]", que_id); return QDF_STATUS_E_FAILURE; }