msm: camera: reqmgr: Work queue names added
Added wrapper functions for each workq to enable workq names in log. CRs-Fixed: 2684378 Change-Id: If5b3671fbf20777cc891cba4b27cad6ed3a0d146 Signed-off-by: Wyes Karny <wkarny@codeaurora.org>
这个提交包含在:
@@ -3463,6 +3463,11 @@ end:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void cam_req_mgr_process_workq_link_worker(struct work_struct *w)
|
||||
{
|
||||
cam_req_mgr_process_workq(w);
|
||||
}
|
||||
|
||||
int cam_req_mgr_link(struct cam_req_mgr_ver_info *link_info)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -3541,7 +3546,8 @@ int cam_req_mgr_link(struct cam_req_mgr_ver_info *link_info)
|
||||
link_info->u.link_info_v1.session_hdl, link->link_hdl);
|
||||
wq_flag = CAM_WORKQ_FLAG_HIGH_PRIORITY | CAM_WORKQ_FLAG_SERIAL;
|
||||
rc = cam_req_mgr_workq_create(buf, CRM_WORKQ_NUM_TASKS,
|
||||
&link->workq, CRM_WORKQ_USAGE_NON_IRQ, wq_flag);
|
||||
&link->workq, CRM_WORKQ_USAGE_NON_IRQ, wq_flag,
|
||||
cam_req_mgr_process_workq_link_worker);
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_CRM, "FATAL: unable to create worker");
|
||||
__cam_req_mgr_destroy_link_info(link);
|
||||
@@ -3650,7 +3656,8 @@ int cam_req_mgr_link_v2(struct cam_req_mgr_ver_info *link_info)
|
||||
link_info->u.link_info_v2.session_hdl, link->link_hdl);
|
||||
wq_flag = CAM_WORKQ_FLAG_HIGH_PRIORITY | CAM_WORKQ_FLAG_SERIAL;
|
||||
rc = cam_req_mgr_workq_create(buf, CRM_WORKQ_NUM_TASKS,
|
||||
&link->workq, CRM_WORKQ_USAGE_NON_IRQ, wq_flag);
|
||||
&link->workq, CRM_WORKQ_USAGE_NON_IRQ, wq_flag,
|
||||
cam_req_mgr_process_workq_link_worker);
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_CRM, "FATAL: unable to create worker");
|
||||
__cam_req_mgr_destroy_link_info(link);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "cam_req_mgr_workq.h"
|
||||
@@ -88,7 +88,7 @@ static int cam_req_mgr_process_task(struct crm_workq_task *task)
|
||||
* cam_req_mgr_process_workq() - main loop handling
|
||||
* @w: workqueue task pointer
|
||||
*/
|
||||
static void cam_req_mgr_process_workq(struct work_struct *w)
|
||||
void cam_req_mgr_process_workq(struct work_struct *w)
|
||||
{
|
||||
struct cam_req_mgr_core_workq *workq = NULL;
|
||||
struct crm_workq_task *task;
|
||||
@@ -172,7 +172,7 @@ end:
|
||||
|
||||
int cam_req_mgr_workq_create(char *name, int32_t num_tasks,
|
||||
struct cam_req_mgr_core_workq **workq, enum crm_workq_context in_irq,
|
||||
int flags)
|
||||
int flags, void (*func)(struct work_struct *w))
|
||||
{
|
||||
int32_t i, wq_flags = 0, max_active_tasks = 0;
|
||||
struct crm_workq_task *task;
|
||||
@@ -202,7 +202,7 @@ int cam_req_mgr_workq_create(char *name, int32_t num_tasks,
|
||||
}
|
||||
|
||||
/* Workq attributes initialization */
|
||||
INIT_WORK(&crm_workq->work, cam_req_mgr_process_workq);
|
||||
INIT_WORK(&crm_workq->work, func);
|
||||
spin_lock_init(&crm_workq->lock_bh);
|
||||
CAM_DBG(CAM_CRM, "LOCK_DBG workq %s lock %pK",
|
||||
name, &crm_workq->lock_bh);
|
||||
|
@@ -98,6 +98,12 @@ struct cam_req_mgr_core_workq {
|
||||
} task;
|
||||
};
|
||||
|
||||
/**
|
||||
* cam_req_mgr_process_workq() - main loop handling
|
||||
* @w: workqueue task pointer
|
||||
*/
|
||||
void cam_req_mgr_process_workq(struct work_struct *w);
|
||||
|
||||
/**
|
||||
* cam_req_mgr_workq_create()
|
||||
* @brief : create a workqueue
|
||||
@@ -108,12 +114,13 @@ struct cam_req_mgr_core_workq {
|
||||
* @in_irq : Set to one if workq might be used in irq context
|
||||
* @flags : Bitwise OR of Flags for workq behavior.
|
||||
* e.g. CAM_REQ_MGR_WORKQ_HIGH_PRIORITY | CAM_REQ_MGR_WORKQ_SERIAL
|
||||
* @func : function pointer for cam_req_mgr_process_workq wrapper function
|
||||
* This function will allocate and create workqueue and pass
|
||||
* the workq pointer to caller.
|
||||
*/
|
||||
int cam_req_mgr_workq_create(char *name, int32_t num_tasks,
|
||||
struct cam_req_mgr_core_workq **workq, enum crm_workq_context in_irq,
|
||||
int flags);
|
||||
int flags, void (*func)(struct work_struct *w));
|
||||
|
||||
/**
|
||||
* cam_req_mgr_workq_destroy()
|
||||
|
在新工单中引用
屏蔽一个用户