Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intel Arc A770: Kernel panic on kldload i915kms.ko #315

Open
kenrap opened this issue Aug 31, 2024 · 7 comments
Open

Intel Arc A770: Kernel panic on kldload i915kms.ko #315

kenrap opened this issue Aug 31, 2024 · 7 comments

Comments

@kenrap
Copy link

kenrap commented Aug 31, 2024

Describe the bug
From using a drm-kmod build from efd9167, the i915kms driver kernel panics when using an (Acer Predator BiFrost) Intel Arc A770 graphics card. And the kernel panic still persists even when using an Intel onboard GPU with the same graphics card installed.

FreeBSD version

FreeBSD freebsd 15.0-CURRENT FreeBSD 15.0-CURRENT #0 main-n271909-28294dc92476: Fri Aug 30 08:28:17 PDT 2024     root@freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1500023 1500023

DRM KMOD version
My own "custom derived" graphics/drm-66-kmod port with GH_TAGNAME pointing to efd9167.

Also git-clone(1) from linux-firmware and copied all of the i915/dg2_* firmware bins to /boot/modules and renamed them appropriately to match the filename style there.

To Reproduce
Boot into the system with either i915kms using kld_list inside /etc/rc.conf or kldload it manually.

Additional context
core.txt.0 dump

@kenrap
Copy link
Author

kenrap commented Aug 31, 2024

My bad, I didn't see about the "Intel DG2 GUC/HUC support" not being implemented yet from PR #283.

Closing therefore.

I'm reopening this to have it serve as a milestone issue.

I figured why have it be closed anyway since the issue is still valid and my reporting could be useful?

@kenrap kenrap closed this as completed Aug 31, 2024
@kenrap kenrap reopened this Oct 2, 2024
@wulf7
Copy link
Contributor

wulf7 commented Oct 2, 2024

dg2_dmc_ver2_08.bin: could not load binary firmware /boot/firmware/dg2_dmc_ver2_08.bin either
i915/dg2_dmc_ver2_08.bin: could not load binary firmware /boot/firmware/i915/dg2_dmc_ver2_08.bin either
i915_dg2_dmc_ver2_08.bin: could not load binary firmware /boot/firmware/i915_dg2_dmc_ver2_08.bin either
i915_dg2_dmc_ver2_08_bin: could not load binary firmware /boot/firmware/i915_dg2_dmc_ver2_08_bin either
i915_dg2_dmc_ver2_08_bin: could not load binary firmware /boot/firmware/i915_dg2_dmc_ver2_08_bin either
drmn0: could not load firmware image 'i915/dg2_dmc_ver2_08.bin'
drmn0: [drm] Failed to load DMC firmware i915/dg2_dmc_ver2_08.bin. Disabling runtime power management.
drmn0: [drm] Run pkg install gpu-firmware-kmod to install it

You may start with adding dg2_dmc_ver2_08.bin to firmwares

@wulf7
Copy link
Contributor

wulf7 commented Oct 2, 2024

But I doubt that it will help

@kenrap
Copy link
Author

kenrap commented Oct 2, 2024

I'll try that out and report back.

I also updated my bug description to be more specific.

@kenrap
Copy link
Author

kenrap commented Oct 2, 2024

But I doubt that it will help

And you're right, it didn't.

After trying a couple more ideas, I spent a good amount of time re-learning how to create a new core dump of the kernel panic with the firmware(s) loaded. Sorry for the delay.

core.txt.1 dump

@wulf7
Copy link
Contributor

wulf7 commented Oct 2, 2024

After taking a look at the code around faulted line, I have got an impression that it can happen due to missing vmap_pfn() implementation.
It is rather easy to check. Just with replacing of return NULL; line in i915_gem_object_map_pfn() function located in drivers/gpu/drm/i915/gem/i915_gem_pages.c file of drm-kmod with panic("oops"); or return ERR_PTR(-ENOSUP);

@kenrap
Copy link
Author

kenrap commented Oct 2, 2024

It seems you're correct about the missing vmap_pfn() implementation. It triggered an "oops" panic by using the panic("oops"); based on your instructions.

What I did was created this custom patch to put into my /usr/ports/graphics/drm-66-kmod/files:

--- drivers/gpu/drm/i915/gem/i915_gem_pages.c.orig
+++ drivers/gpu/drm/i915/gem/i915_gem_pages.c
@@ -329,7 +329,7 @@ static void *i915_gem_object_map_pfn(struct drm_i915_gem_object *obj,
 {
 #ifdef __FreeBSD__
        // BSDFIXME: Need vmap_pfn() implementation.
-       return NULL;
+       panic("oops");
 #else
        resource_size_t iomap = obj->mm.region->iomap.base -
                obj->mm.region->region.start;

And rebuilt and reinstalled the package of my derived port. Then I did my usual testing and grabbed a new core dump which shows the "oops" panic. Yay! \o/

core.txt.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants