Merge "msm: camera: reqmgr: Work queue names added" into camera-kernel.lnx.4.0

This commit is contained in:
Camera Software Integration
2020-06-18 17:17:27 -07:00
committed by Gerrit - the friendly Code Review server
10 changed files with 91 additions and 19 deletions

View File

@@ -3522,6 +3522,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;
@@ -3600,7 +3605,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);
@@ -3709,7 +3715,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);

View File

@@ -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);

View File

@@ -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()