Skip to content

Commit cab4a9b

Browse files
b49020jenswi-linaro
authored andcommitted
tee: optee: Remove redundant custom workqueue
Global system workqueue is sufficient to suffice OP-TEE bus scanning work needs. So drop redundant usage of the custom workqueue. Tested-by: Jan Kiszka <jan.kiszka@siemens.com> Tested-by: Masahisa Kojima <masahisa.kojima@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
1 parent 7269cba commit cab4a9b

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

drivers/tee/optee/core.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/string.h>
1616
#include <linux/tee_drv.h>
1717
#include <linux/types.h>
18-
#include <linux/workqueue.h>
1918
#include "optee_private.h"
2019

2120
int optee_pool_op_alloc_helper(struct tee_shm_pool *pool, struct tee_shm *shm,
@@ -110,12 +109,7 @@ int optee_open(struct tee_context *ctx, bool cap_memref_null)
110109

111110
if (!optee->scan_bus_done) {
112111
INIT_WORK(&optee->scan_bus_work, optee_bus_scan);
113-
optee->scan_bus_wq = create_workqueue("optee_bus_scan");
114-
if (!optee->scan_bus_wq) {
115-
kfree(ctxdata);
116-
return -ECHILD;
117-
}
118-
queue_work(optee->scan_bus_wq, &optee->scan_bus_work);
112+
schedule_work(&optee->scan_bus_work);
119113
optee->scan_bus_done = true;
120114
}
121115
}
@@ -158,10 +152,7 @@ void optee_release_supp(struct tee_context *ctx)
158152
struct optee *optee = tee_get_drvdata(ctx->teedev);
159153

160154
optee_release_helper(ctx, optee_close_session_helper);
161-
if (optee->scan_bus_wq) {
162-
destroy_workqueue(optee->scan_bus_wq);
163-
optee->scan_bus_wq = NULL;
164-
}
155+
165156
optee_supp_release(&optee->supp);
166157
}
167158

drivers/tee/optee/optee_private.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ struct optee_ops {
178178
* @pool: shared memory pool
179179
* @rpc_param_count: If > 0 number of RPC parameters to make room for
180180
* @scan_bus_done flag if device registation was already done.
181-
* @scan_bus_wq workqueue to scan optee bus and register optee drivers
182181
* @scan_bus_work workq to scan optee bus and register optee drivers
183182
*/
184183
struct optee {
@@ -197,7 +196,6 @@ struct optee {
197196
struct tee_shm_pool *pool;
198197
unsigned int rpc_param_count;
199198
bool scan_bus_done;
200-
struct workqueue_struct *scan_bus_wq;
201199
struct work_struct scan_bus_work;
202200
};
203201

0 commit comments

Comments
 (0)