blob: 80501928e0bbdc69a7507ac464a71660922d9c8c [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Huang Ying25c38d3f2009-02-19 14:33:40 +08002/*
3 * Workqueue for crypto subsystem
4 *
5 * Copyright (c) 2009 Intel Corp.
6 * Author: Huang Ying <ying.huang@intel.com>
Huang Ying25c38d3f2009-02-19 14:33:40 +08007 */
8
9#include <linux/workqueue.h>
Paul Gortmaker4bb33cc2011-05-27 14:41:48 -040010#include <linux/module.h>
Huang Ying25c38d3f2009-02-19 14:33:40 +080011#include <crypto/algapi.h>
12#include <crypto/crypto_wq.h>
13
14struct workqueue_struct *kcrypto_wq;
15EXPORT_SYMBOL_GPL(kcrypto_wq);
16
17static int __init crypto_wq_init(void)
18{
Tejun Heoc73b7d02011-01-04 15:38:44 +110019 kcrypto_wq = alloc_workqueue("crypto",
20 WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1);
Huang Ying25c38d3f2009-02-19 14:33:40 +080021 if (unlikely(!kcrypto_wq))
22 return -ENOMEM;
23 return 0;
24}
25
26static void __exit crypto_wq_exit(void)
27{
28 destroy_workqueue(kcrypto_wq);
29}
30
Tim Chen130fa5b2014-03-17 16:52:26 -070031subsys_initcall(crypto_wq_init);
Huang Ying25c38d3f2009-02-19 14:33:40 +080032module_exit(crypto_wq_exit);
33
34MODULE_LICENSE("GPL");
35MODULE_DESCRIPTION("Workqueue for crypto subsystem");