linux/drivers/gpu/drm/amd/include
Oded Gabbay c68f4528a2 drm/amdkfd: Track when module's init is complete
Current dependencies between amdkfd and radeon/amdgpu force the loading
of amdkfd _before_ radeon and/or amdgpu are loaded. When all these kernel
drivers are built as modules, this ordering is enforced by the kernel
built-in mechanism of loading dependent modules.

However, there is no such mechanism in case where all these drivers are
compiled inside the kernel image (not as modules). The current way to
enforce loading of amdkfd before radeon/amdgpu, is to put amdkfd before
radeon/amdgpu in the drm Makefile, but that method is way too fragile.

In addition, there is no kernel mechanism to check whether a kernel
driver that is built inside the kernel image, has already been loaded.

To solve this, this patch adds to kfd_module.c a new static variable,
amdkfd_init_completed, that is set to 1 only when amdkfd's
module initialization function has been completed (successfully).

kgd2kfd_init(), which is the initialization function of the
kgd-->kfd interface, and which is the first function in amdkfd called by
radeon/amdgpu, will return successfully only if amdkfd_init_completed is
equal 1.

If amdkfd_init_completed is not equal to 1, kgd2kfd_init() will
return -EPROBE_DEFER to signal radeon/amdgpu they need to defer
their loading until amdkfd is loaded.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-27 22:52:40 +02:00
..
asic_reg drm/amd/include: Update dce 8 headers for dal 2016-02-12 15:31:47 -05:00
ivsrcid drm/amd: Adding IVSRC register headers 2016-02-10 16:09:04 -05:00
amd_acpi.h drm/amdgpu: mv amdgpu_acpi.h to amd/include/amd_acpi.h 2015-12-21 16:42:05 -05:00
amd_pcie_helpers.h drm/amd/powerplay: fix boolreturn.cocci warnings 2015-12-21 16:42:34 -05:00
amd_pcie.h drm/amdgpu: extract pcie helpers to common header 2015-12-21 16:42:30 -05:00
amd_shared.h drm/amd: add ACP driver support 2016-02-10 14:17:08 -05:00
atom-bits.h drm/amdgpu: move some atombios definitions to common folder (v2) 2015-08-17 16:50:19 -04:00
atom-names.h drm/amdgpu: move some atombios definitions to common folder (v2) 2015-08-17 16:50:19 -04:00
atom-types.h drm/amdgpu: move some atombios definitions to common folder (v2) 2015-08-17 16:50:19 -04:00
atombios.h drm/amd/powerplay: add/update headers for Fiji SMU and DPM 2015-12-21 16:42:15 -05:00
cgs_common.h drm/amdgpu/cgs: add an interface to access PCI resources 2016-01-11 09:52:43 -05:00
cgs_linux.h drm/amdgpu/cgs: remove import_gpu_mem 2015-09-30 12:44:16 -04:00
cik_structs.h drm/amd: Put cik structures in a common place 2015-01-02 23:18:39 +02:00
kgd_kfd_interface.h drm/amdkfd: Track when module's init is complete 2016-02-27 22:52:40 +02:00
pptable.h drm/amdgpu: add some pptable definitions 2015-08-17 16:50:21 -04:00
vi_structs.h drm/amdgpu: Add amdgpu <--> amdkfd gfx8 interface 2015-07-20 09:16:48 +03:00