Lines Matching +full:static +full:- +full:config
1 // SPDX-License-Identifier: GPL-2.0-or-later OR copyleft-next-0.3.1
14 * tools/testing/selftests/kmod/kmod.sh --help
35 static bool force_init_test = false;
43 static DEFINE_MUTEX(reg_dev_mutex);
44 static LIST_HEAD(reg_test_devs);
50 static int num_test_devs;
53 * enum kmod_test_case - linker table test case
83 * struct kmod_test_device_info - thread info
92 * (module_put(fs_sync->owner)) when done, otherwise you will not be able
93 * to unload the respective modules and re-test. We use this to keep
107 * struct kmod_test_device - test device to help test kmod
110 * @config: configuration for the test
124 struct test_config config; member
140 static const char *test_case_str(enum kmod_test_case test_case) in test_case_str()
152 static struct miscdevice *dev_to_misc_dev(struct device *dev) in dev_to_misc_dev()
157 static struct kmod_test_device *misc_dev_to_test_dev(struct miscdevice *misc_dev) in misc_dev_to_test_dev()
162 static struct kmod_test_device *dev_to_test_dev(struct device *dev) in dev_to_test_dev()
172 static void kmod_test_done_check(struct kmod_test_device *test_dev, in kmod_test_done_check()
175 struct test_config *config = &test_dev->config; in kmod_test_done_check() local
177 test_dev->done++; in kmod_test_done_check()
178 dev_dbg(test_dev->dev, "Done thread count: %u\n", test_dev->done); in kmod_test_done_check()
180 if (test_dev->done == config->num_threads) { in kmod_test_done_check()
181 dev_info(test_dev->dev, "Done: %u threads have all run now\n", in kmod_test_done_check()
182 test_dev->done); in kmod_test_done_check()
183 dev_info(test_dev->dev, "Last thread to run: %u\n", idx); in kmod_test_done_check()
184 complete(&test_dev->kthreads_done); in kmod_test_done_check()
188 static void test_kmod_put_module(struct kmod_test_device_info *info) in test_kmod_put_module()
190 struct kmod_test_device *test_dev = info->test_dev; in test_kmod_put_module()
191 struct test_config *config = &test_dev->config; in test_kmod_put_module() local
193 if (!info->need_mod_put) in test_kmod_put_module()
196 switch (config->test_case) { in test_kmod_put_module()
200 if (info->fs_sync && info->fs_sync->owner) in test_kmod_put_module()
201 module_put(info->fs_sync->owner); in test_kmod_put_module()
207 info->need_mod_put = true; in test_kmod_put_module()
210 static int run_request(void *data) in run_request()
213 struct kmod_test_device *test_dev = info->test_dev; in run_request()
214 struct test_config *config = &test_dev->config; in run_request() local
216 switch (config->test_case) { in run_request()
218 info->ret_sync = request_module("%s", config->test_driver); in run_request()
221 info->fs_sync = get_fs_type(config->test_fs); in run_request()
222 info->need_mod_put = true; in run_request()
227 return -EINVAL; in run_request()
230 dev_dbg(test_dev->dev, "Ran thread %u\n", info->thread_idx); in run_request()
234 mutex_lock(&test_dev->thread_mutex); in run_request()
235 info->task_sync = NULL; in run_request()
236 kmod_test_done_check(test_dev, info->thread_idx); in run_request()
237 mutex_unlock(&test_dev->thread_mutex); in run_request()
242 static int tally_work_test(struct kmod_test_device_info *info) in tally_work_test()
244 struct kmod_test_device *test_dev = info->test_dev; in tally_work_test()
245 struct test_config *config = &test_dev->config; in tally_work_test() local
248 switch (config->test_case) { in tally_work_test()
254 if (info->ret_sync != 0) in tally_work_test()
255 err_ret = info->ret_sync; in tally_work_test()
256 dev_info(test_dev->dev, in tally_work_test()
258 info->thread_idx, info->ret_sync); in tally_work_test()
262 if (!info->fs_sync) in tally_work_test()
263 err_ret = -EINVAL; in tally_work_test()
264 dev_info(test_dev->dev, "Sync thread %u fs: %s\n", in tally_work_test()
265 info->thread_idx, info->fs_sync ? config->test_fs : in tally_work_test()
284 static void tally_up_work(struct kmod_test_device *test_dev) in tally_up_work()
286 struct test_config *config = &test_dev->config; in tally_up_work() local
292 mutex_lock(&test_dev->thread_mutex); in tally_up_work()
294 dev_info(test_dev->dev, "Results:\n"); in tally_up_work()
296 for (idx=0; idx < config->num_threads; idx++) { in tally_up_work()
297 info = &test_dev->info[idx]; in tally_up_work()
307 config->test_result = err_ret; in tally_up_work()
309 mutex_unlock(&test_dev->thread_mutex); in tally_up_work()
312 static int try_one_request(struct kmod_test_device *test_dev, unsigned int idx) in try_one_request()
314 struct kmod_test_device_info *info = &test_dev->info[idx]; in try_one_request()
315 int fail_ret = -ENOMEM; in try_one_request()
317 mutex_lock(&test_dev->thread_mutex); in try_one_request()
319 info->thread_idx = idx; in try_one_request()
320 info->test_dev = test_dev; in try_one_request()
321 info->task_sync = kthread_run(run_request, info, "%s-%u", in try_one_request()
324 if (!info->task_sync || IS_ERR(info->task_sync)) { in try_one_request()
325 test_dev->test_is_oom = true; in try_one_request()
326 dev_err(test_dev->dev, "Setting up thread %u failed\n", idx); in try_one_request()
327 info->task_sync = NULL; in try_one_request()
330 dev_dbg(test_dev->dev, "Kicked off thread %u\n", idx); in try_one_request()
332 mutex_unlock(&test_dev->thread_mutex); in try_one_request()
337 info->ret_sync = fail_ret; in try_one_request()
338 mutex_unlock(&test_dev->thread_mutex); in try_one_request()
343 static void test_dev_kmod_stop_tests(struct kmod_test_device *test_dev) in test_dev_kmod_stop_tests()
345 struct test_config *config = &test_dev->config; in test_dev_kmod_stop_tests() local
349 dev_info(test_dev->dev, "Ending request_module() tests\n"); in test_dev_kmod_stop_tests()
351 mutex_lock(&test_dev->thread_mutex); in test_dev_kmod_stop_tests()
353 for (i=0; i < config->num_threads; i++) { in test_dev_kmod_stop_tests()
354 info = &test_dev->info[i]; in test_dev_kmod_stop_tests()
355 if (info->task_sync && !IS_ERR(info->task_sync)) { in test_dev_kmod_stop_tests()
356 dev_info(test_dev->dev, in test_dev_kmod_stop_tests()
357 "Stopping still-running thread %i\n", i); in test_dev_kmod_stop_tests()
358 kthread_stop(info->task_sync); in test_dev_kmod_stop_tests()
362 * info->task_sync is well protected, it can only be in test_dev_kmod_stop_tests()
366 * check -- just in case. in test_dev_kmod_stop_tests()
368 if (info->task_sync && info->need_mod_put) in test_dev_kmod_stop_tests()
372 mutex_unlock(&test_dev->thread_mutex); in test_dev_kmod_stop_tests()
381 static int try_requests(struct kmod_test_device *test_dev) in try_requests()
383 struct test_config *config = &test_dev->config; in try_requests() local
388 for (idx=0; idx < config->num_threads; idx++) { in try_requests()
389 if (test_dev->test_is_oom) { in try_requests()
402 test_dev->test_is_oom = false; in try_requests()
403 dev_info(test_dev->dev, in try_requests()
405 wait_for_completion(&test_dev->kthreads_done); in try_requests()
408 test_dev->test_is_oom = true; in try_requests()
409 dev_info(test_dev->dev, in try_requests()
412 return -ENOMEM; in try_requests()
418 static int run_test_driver(struct kmod_test_device *test_dev) in run_test_driver()
420 struct test_config *config = &test_dev->config; in run_test_driver() local
422 dev_info(test_dev->dev, "Test case: %s (%u)\n", in run_test_driver()
423 test_case_str(config->test_case), in run_test_driver()
424 config->test_case); in run_test_driver()
425 dev_info(test_dev->dev, "Test driver to load: %s\n", in run_test_driver()
426 config->test_driver); in run_test_driver()
427 dev_info(test_dev->dev, "Number of threads to run: %u\n", in run_test_driver()
428 config->num_threads); in run_test_driver()
429 dev_info(test_dev->dev, "Thread IDs will range from 0 - %u\n", in run_test_driver()
430 config->num_threads - 1); in run_test_driver()
435 static int run_test_fs_type(struct kmod_test_device *test_dev) in run_test_fs_type()
437 struct test_config *config = &test_dev->config; in run_test_fs_type() local
439 dev_info(test_dev->dev, "Test case: %s (%u)\n", in run_test_fs_type()
440 test_case_str(config->test_case), in run_test_fs_type()
441 config->test_case); in run_test_fs_type()
442 dev_info(test_dev->dev, "Test filesystem to load: %s\n", in run_test_fs_type()
443 config->test_fs); in run_test_fs_type()
444 dev_info(test_dev->dev, "Number of threads to run: %u\n", in run_test_fs_type()
445 config->num_threads); in run_test_fs_type()
446 dev_info(test_dev->dev, "Thread IDs will range from 0 - %u\n", in run_test_fs_type()
447 config->num_threads - 1); in run_test_fs_type()
452 static ssize_t config_show(struct device *dev, in config_show()
457 struct test_config *config = &test_dev->config; in config_show() local
460 mutex_lock(&test_dev->config_mutex); in config_show()
466 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
468 config->num_threads); in config_show()
470 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
472 test_case_str(config->test_case), in config_show()
473 config->test_case); in config_show()
475 if (config->test_driver) in config_show()
476 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
478 config->test_driver); in config_show()
480 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
483 if (config->test_fs) in config_show()
484 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
486 config->test_fs); in config_show()
488 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
491 mutex_unlock(&test_dev->config_mutex); in config_show()
495 static DEVICE_ATTR_RO(config);
501 static int __trigger_config_run(struct kmod_test_device *test_dev) in __trigger_config_run()
503 struct test_config *config = &test_dev->config; in __trigger_config_run() local
505 test_dev->done = 0; in __trigger_config_run()
507 switch (config->test_case) { in __trigger_config_run()
513 dev_warn(test_dev->dev, in __trigger_config_run()
515 config->test_case); in __trigger_config_run()
516 return -EINVAL; in __trigger_config_run()
520 static int trigger_config_run(struct kmod_test_device *test_dev) in trigger_config_run()
522 struct test_config *config = &test_dev->config; in trigger_config_run() local
525 mutex_lock(&test_dev->trigger_mutex); in trigger_config_run()
526 mutex_lock(&test_dev->config_mutex); in trigger_config_run()
531 dev_info(test_dev->dev, "General test result: %d\n", in trigger_config_run()
532 config->test_result); in trigger_config_run()
537 * then userspace must just check the result of config->test_result. in trigger_config_run()
543 * through the trigger it also us to run tests with set -e and only in trigger_config_run()
550 mutex_unlock(&test_dev->config_mutex); in trigger_config_run()
551 mutex_unlock(&test_dev->trigger_mutex); in trigger_config_run()
556 static ssize_t
564 if (test_dev->test_is_oom) in trigger_config_store()
565 return -ENOMEM; in trigger_config_store()
584 return -EINVAL; in trigger_config_store()
590 static DEVICE_ATTR_WO(trigger_config);
597 static int __kstrncpy(char **dst, const char *name, size_t count, gfp_t gfp) in __kstrncpy()
601 return -ENOSPC; in __kstrncpy()
605 static int config_copy_test_driver_name(struct test_config *config, in config_copy_test_driver_name() argument
609 return __kstrncpy(&config->test_driver, name, count, GFP_KERNEL); in config_copy_test_driver_name()
613 static int config_copy_test_fs(struct test_config *config, const char *name, in config_copy_test_fs() argument
616 return __kstrncpy(&config->test_fs, name, count, GFP_KERNEL); in config_copy_test_fs()
619 static void __kmod_config_free(struct test_config *config) in __kmod_config_free() argument
621 if (!config) in __kmod_config_free()
624 kfree_const(config->test_driver); in __kmod_config_free()
625 config->test_driver = NULL; in __kmod_config_free()
627 kfree_const(config->test_fs); in __kmod_config_free()
628 config->test_fs = NULL; in __kmod_config_free()
631 static void kmod_config_free(struct kmod_test_device *test_dev) in kmod_config_free()
633 struct test_config *config; in kmod_config_free() local
638 config = &test_dev->config; in kmod_config_free()
640 mutex_lock(&test_dev->config_mutex); in kmod_config_free()
641 __kmod_config_free(config); in kmod_config_free()
642 mutex_unlock(&test_dev->config_mutex); in kmod_config_free()
645 static ssize_t config_test_driver_store(struct device *dev, in config_test_driver_store()
650 struct test_config *config = &test_dev->config; in config_test_driver_store() local
653 mutex_lock(&test_dev->config_mutex); in config_test_driver_store()
655 kfree_const(config->test_driver); in config_test_driver_store()
656 config->test_driver = NULL; in config_test_driver_store()
658 copied = config_copy_test_driver_name(config, buf, count); in config_test_driver_store()
659 mutex_unlock(&test_dev->config_mutex); in config_test_driver_store()
667 static ssize_t config_test_show_str(struct mutex *config_mutex, in config_test_show_str()
680 static ssize_t config_test_driver_show(struct device *dev, in config_test_driver_show()
685 struct test_config *config = &test_dev->config; in config_test_driver_show() local
687 return config_test_show_str(&test_dev->config_mutex, buf, in config_test_driver_show()
688 config->test_driver); in config_test_driver_show()
690 static DEVICE_ATTR_RW(config_test_driver);
692 static ssize_t config_test_fs_store(struct device *dev, in config_test_fs_store()
697 struct test_config *config = &test_dev->config; in config_test_fs_store() local
700 mutex_lock(&test_dev->config_mutex); in config_test_fs_store()
702 kfree_const(config->test_fs); in config_test_fs_store()
703 config->test_fs = NULL; in config_test_fs_store()
705 copied = config_copy_test_fs(config, buf, count); in config_test_fs_store()
706 mutex_unlock(&test_dev->config_mutex); in config_test_fs_store()
711 static ssize_t config_test_fs_show(struct device *dev, in config_test_fs_show()
716 struct test_config *config = &test_dev->config; in config_test_fs_show() local
718 return config_test_show_str(&test_dev->config_mutex, buf, in config_test_fs_show()
719 config->test_fs); in config_test_fs_show()
721 static DEVICE_ATTR_RW(config_test_fs);
723 static int trigger_config_run_type(struct kmod_test_device *test_dev, in trigger_config_run_type()
728 struct test_config *config = &test_dev->config; in trigger_config_run_type() local
730 mutex_lock(&test_dev->config_mutex); in trigger_config_run_type()
734 kfree_const(config->test_driver); in trigger_config_run_type()
735 config->test_driver = NULL; in trigger_config_run_type()
736 copied = config_copy_test_driver_name(config, test_str, in trigger_config_run_type()
740 kfree_const(config->test_fs); in trigger_config_run_type()
741 config->test_fs = NULL; in trigger_config_run_type()
742 copied = config_copy_test_fs(config, test_str, in trigger_config_run_type()
746 mutex_unlock(&test_dev->config_mutex); in trigger_config_run_type()
747 return -EINVAL; in trigger_config_run_type()
750 config->test_case = test_case; in trigger_config_run_type()
752 mutex_unlock(&test_dev->config_mutex); in trigger_config_run_type()
755 test_dev->test_is_oom = true; in trigger_config_run_type()
756 return -ENOMEM; in trigger_config_run_type()
759 test_dev->test_is_oom = false; in trigger_config_run_type()
764 static void free_test_dev_info(struct kmod_test_device *test_dev) in free_test_dev_info()
766 vfree(test_dev->info); in free_test_dev_info()
767 test_dev->info = NULL; in free_test_dev_info()
770 static int kmod_config_sync_info(struct kmod_test_device *test_dev) in kmod_config_sync_info()
772 struct test_config *config = &test_dev->config; in kmod_config_sync_info() local
775 test_dev->info = in kmod_config_sync_info()
777 config->num_threads)); in kmod_config_sync_info()
778 if (!test_dev->info) in kmod_config_sync_info()
779 return -ENOMEM; in kmod_config_sync_info()
789 static unsigned int kmod_init_test_thread_limit(void) in kmod_init_test_thread_limit()
794 static unsigned int kmod_init_test_thread_limit(void) in kmod_init_test_thread_limit()
800 static int __kmod_config_init(struct kmod_test_device *test_dev) in __kmod_config_init()
802 struct test_config *config = &test_dev->config; in __kmod_config_init() local
803 int ret = -ENOMEM, copied; in __kmod_config_init()
805 __kmod_config_free(config); in __kmod_config_init()
807 copied = config_copy_test_driver_name(config, TEST_START_DRIVER, in __kmod_config_init()
812 copied = config_copy_test_fs(config, TEST_START_TEST_FS, in __kmod_config_init()
817 config->num_threads = kmod_init_test_thread_limit(); in __kmod_config_init()
818 config->test_result = 0; in __kmod_config_init()
819 config->test_case = TEST_START_TEST_CASE; in __kmod_config_init()
825 test_dev->test_is_oom = false; in __kmod_config_init()
830 test_dev->test_is_oom = true; in __kmod_config_init()
831 WARN_ON(test_dev->test_is_oom); in __kmod_config_init()
833 __kmod_config_free(config); in __kmod_config_init()
838 static ssize_t reset_store(struct device *dev, in reset_store()
845 mutex_lock(&test_dev->trigger_mutex); in reset_store()
846 mutex_lock(&test_dev->config_mutex); in reset_store()
850 ret = -ENOMEM; in reset_store()
851 dev_err(dev, "could not alloc settings for config trigger: %d\n", in reset_store()
860 mutex_unlock(&test_dev->config_mutex); in reset_store()
861 mutex_unlock(&test_dev->trigger_mutex); in reset_store()
865 static DEVICE_ATTR_WO(reset);
867 static int test_dev_config_update_uint_sync(struct kmod_test_device *test_dev, in test_dev_config_update_uint_sync()
869 unsigned int *config, in test_dev_config_update_uint_sync() argument
880 mutex_lock(&test_dev->config_mutex); in test_dev_config_update_uint_sync()
882 old_val = *config; in test_dev_config_update_uint_sync()
883 *(unsigned int *)config = val; in test_dev_config_update_uint_sync()
887 *(unsigned int *)config = old_val; in test_dev_config_update_uint_sync()
892 mutex_unlock(&test_dev->config_mutex); in test_dev_config_update_uint_sync()
893 return -EINVAL; in test_dev_config_update_uint_sync()
896 mutex_unlock(&test_dev->config_mutex); in test_dev_config_update_uint_sync()
901 static int test_dev_config_update_uint_range(struct kmod_test_device *test_dev, in test_dev_config_update_uint_range()
903 unsigned int *config, in test_dev_config_update_uint_range() argument
915 return -EINVAL; in test_dev_config_update_uint_range()
917 mutex_lock(&test_dev->config_mutex); in test_dev_config_update_uint_range()
918 *config = val; in test_dev_config_update_uint_range()
919 mutex_unlock(&test_dev->config_mutex); in test_dev_config_update_uint_range()
925 static int test_dev_config_update_int(struct kmod_test_device *test_dev, in test_dev_config_update_int()
927 int *config) in test_dev_config_update_int() argument
936 mutex_lock(&test_dev->config_mutex); in test_dev_config_update_int()
937 *config = val; in test_dev_config_update_int()
938 mutex_unlock(&test_dev->config_mutex); in test_dev_config_update_int()
943 static ssize_t test_dev_config_show_int(struct kmod_test_device *test_dev, in test_dev_config_show_int()
945 int config) in test_dev_config_show_int() argument
949 mutex_lock(&test_dev->config_mutex); in test_dev_config_show_int()
950 val = config; in test_dev_config_show_int()
951 mutex_unlock(&test_dev->config_mutex); in test_dev_config_show_int()
956 static ssize_t test_dev_config_show_uint(struct kmod_test_device *test_dev, in test_dev_config_show_uint()
958 unsigned int config) in test_dev_config_show_uint() argument
962 mutex_lock(&test_dev->config_mutex); in test_dev_config_show_uint()
963 val = config; in test_dev_config_show_uint()
964 mutex_unlock(&test_dev->config_mutex); in test_dev_config_show_uint()
969 static ssize_t test_result_store(struct device *dev, in test_result_store()
974 struct test_config *config = &test_dev->config; in test_result_store() local
977 &config->test_result); in test_result_store()
980 static ssize_t config_num_threads_store(struct device *dev, in config_num_threads_store()
985 struct test_config *config = &test_dev->config; in config_num_threads_store() local
988 &config->num_threads, in config_num_threads_store()
992 static ssize_t config_num_threads_show(struct device *dev, in config_num_threads_show()
997 struct test_config *config = &test_dev->config; in config_num_threads_show() local
999 return test_dev_config_show_int(test_dev, buf, config->num_threads); in config_num_threads_show()
1001 static DEVICE_ATTR_RW(config_num_threads);
1003 static ssize_t config_test_case_store(struct device *dev, in config_test_case_store()
1008 struct test_config *config = &test_dev->config; in config_test_case_store() local
1011 &config->test_case, in config_test_case_store()
1013 __TEST_KMOD_MAX - 1); in config_test_case_store()
1016 static ssize_t config_test_case_show(struct device *dev, in config_test_case_show()
1021 struct test_config *config = &test_dev->config; in config_test_case_show() local
1023 return test_dev_config_show_uint(test_dev, buf, config->test_case); in config_test_case_show()
1025 static DEVICE_ATTR_RW(config_test_case);
1027 static ssize_t test_result_show(struct device *dev, in test_result_show()
1032 struct test_config *config = &test_dev->config; in test_result_show() local
1034 return test_dev_config_show_int(test_dev, buf, config->test_result); in test_result_show()
1036 static DEVICE_ATTR_RW(test_result);
1040 static struct attribute *test_dev_attrs[] = {
1042 TEST_KMOD_DEV_ATTR(config),
1056 static int kmod_config_init(struct kmod_test_device *test_dev) in kmod_config_init()
1060 mutex_lock(&test_dev->config_mutex); in kmod_config_init()
1062 mutex_unlock(&test_dev->config_mutex); in kmod_config_init()
1067 static struct kmod_test_device *alloc_test_dev_kmod(int idx) in alloc_test_dev_kmod()
1077 mutex_init(&test_dev->config_mutex); in alloc_test_dev_kmod()
1078 mutex_init(&test_dev->trigger_mutex); in alloc_test_dev_kmod()
1079 mutex_init(&test_dev->thread_mutex); in alloc_test_dev_kmod()
1081 init_completion(&test_dev->kthreads_done); in alloc_test_dev_kmod()
1089 test_dev->dev_idx = idx; in alloc_test_dev_kmod()
1090 misc_dev = &test_dev->misc_dev; in alloc_test_dev_kmod()
1092 misc_dev->minor = MISC_DYNAMIC_MINOR; in alloc_test_dev_kmod()
1093 misc_dev->name = kasprintf(GFP_KERNEL, "test_kmod%d", idx); in alloc_test_dev_kmod()
1094 if (!misc_dev->name) { in alloc_test_dev_kmod()
1095 pr_err("Cannot alloc misc_dev->name\n"); in alloc_test_dev_kmod()
1098 misc_dev->groups = test_dev_groups; in alloc_test_dev_kmod()
1112 static void free_test_dev_kmod(struct kmod_test_device *test_dev) in free_test_dev_kmod()
1115 kfree_const(test_dev->misc_dev.name); in free_test_dev_kmod()
1116 test_dev->misc_dev.name = NULL; in free_test_dev_kmod()
1124 static struct kmod_test_device *register_test_dev_kmod(void) in register_test_dev_kmod()
1141 ret = misc_register(&test_dev->misc_dev); in register_test_dev_kmod()
1149 test_dev->dev = test_dev->misc_dev.this_device; in register_test_dev_kmod()
1150 list_add_tail(&test_dev->list, ®_test_devs); in register_test_dev_kmod()
1151 dev_info(test_dev->dev, "interface ready\n"); in register_test_dev_kmod()
1162 static int __init test_kmod_init(void) in test_kmod_init()
1170 return -ENODEV; in test_kmod_init()
1175 * testing with this driver built-in, for now this seems in test_kmod_init()
1195 static
1198 mutex_lock(&test_dev->trigger_mutex); in unregister_test_dev_kmod()
1199 mutex_lock(&test_dev->config_mutex); in unregister_test_dev_kmod()
1203 dev_info(test_dev->dev, "removing interface\n"); in unregister_test_dev_kmod()
1204 misc_deregister(&test_dev->misc_dev); in unregister_test_dev_kmod()
1206 mutex_unlock(&test_dev->config_mutex); in unregister_test_dev_kmod()
1207 mutex_unlock(&test_dev->trigger_mutex); in unregister_test_dev_kmod()
1212 static void __exit test_kmod_exit(void) in test_kmod_exit()
1218 list_del(&test_dev->list); in test_kmod_exit()