Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Huang Ying | 25c38d3f | 2009-02-19 14:33:40 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Workqueue for crypto subsystem |
| 4 | * |
| 5 | * Copyright (c) 2009 Intel Corp. |
| 6 | * Author: Huang Ying <ying.huang@intel.com> |
Huang Ying | 25c38d3f | 2009-02-19 14:33:40 +0800 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <linux/workqueue.h> |
Paul Gortmaker | 4bb33cc | 2011-05-27 14:41:48 -0400 | [diff] [blame] | 10 | #include <linux/module.h> |
Huang Ying | 25c38d3f | 2009-02-19 14:33:40 +0800 | [diff] [blame] | 11 | #include <crypto/algapi.h> |
| 12 | #include <crypto/crypto_wq.h> |
| 13 | |
| 14 | struct workqueue_struct *kcrypto_wq; |
| 15 | EXPORT_SYMBOL_GPL(kcrypto_wq); |
| 16 | |
| 17 | static int __init crypto_wq_init(void) |
| 18 | { |
Tejun Heo | c73b7d0 | 2011-01-04 15:38:44 +1100 | [diff] [blame] | 19 | kcrypto_wq = alloc_workqueue("crypto", |
| 20 | WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1); |
Huang Ying | 25c38d3f | 2009-02-19 14:33:40 +0800 | [diff] [blame] | 21 | if (unlikely(!kcrypto_wq)) |
| 22 | return -ENOMEM; |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | static void __exit crypto_wq_exit(void) |
| 27 | { |
| 28 | destroy_workqueue(kcrypto_wq); |
| 29 | } |
| 30 | |
Tim Chen | 130fa5b | 2014-03-17 16:52:26 -0700 | [diff] [blame] | 31 | subsys_initcall(crypto_wq_init); |
Huang Ying | 25c38d3f | 2009-02-19 14:33:40 +0800 | [diff] [blame] | 32 | module_exit(crypto_wq_exit); |
| 33 | |
| 34 | MODULE_LICENSE("GPL"); |
| 35 | MODULE_DESCRIPTION("Workqueue for crypto subsystem"); |