This source file includes following definitions.
- kfd_init
- kfd_exit
- kgd2kfd_init
- kgd2kfd_exit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #include <linux/sched.h>
24 #include <linux/device.h>
25 #include "kfd_priv.h"
26 #include "amdgpu_amdkfd.h"
27
28 static int kfd_init(void)
29 {
30 int err;
31
32
33 if ((sched_policy < KFD_SCHED_POLICY_HWS) ||
34 (sched_policy > KFD_SCHED_POLICY_NO_HWS)) {
35 pr_err("sched_policy has invalid value\n");
36 return -EINVAL;
37 }
38
39
40 if ((max_num_of_queues_per_device < 1) ||
41 (max_num_of_queues_per_device >
42 KFD_MAX_NUM_OF_QUEUES_PER_DEVICE)) {
43 pr_err("max_num_of_queues_per_device must be between 1 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n");
44 return -EINVAL;
45 }
46
47 err = kfd_chardev_init();
48 if (err < 0)
49 goto err_ioctl;
50
51 err = kfd_topology_init();
52 if (err < 0)
53 goto err_topology;
54
55 err = kfd_process_create_wq();
56 if (err < 0)
57 goto err_create_wq;
58
59
60
61
62 kfd_procfs_init();
63
64 kfd_debugfs_init();
65
66 return 0;
67
68 err_create_wq:
69 kfd_topology_shutdown();
70 err_topology:
71 kfd_chardev_exit();
72 err_ioctl:
73 return err;
74 }
75
76 static void kfd_exit(void)
77 {
78 kfd_debugfs_fini();
79 kfd_process_destroy_wq();
80 kfd_procfs_shutdown();
81 kfd_topology_shutdown();
82 kfd_chardev_exit();
83 }
84
85 int kgd2kfd_init()
86 {
87 return kfd_init();
88 }
89
90 void kgd2kfd_exit(void)
91 {
92 kfd_exit();
93 }