FreeBSDDesktop / DEPRECATED-freebsd-base-graphics

Fork of FreeBSD's base repository to work on graphics-stack-related projects
Other
49 stars 13 forks source link

device_if.h not getting populated at buidkernel #136

Closed Beeblebrox-BSD closed 7 years ago

Beeblebrox-BSD commented 7 years ago

ERROR: In file included from /asp/git/srcdrm/sys/amd64/amd64/genassym.c:47: /asp/git/srcdrm/sys/sys/bus.h:730:10: fatal error: 'device_if.h' file not found

include device_if.h

markjdb commented 7 years ago

Why --branch master? Are you building the drm-next branch? Which kernel config are you using?

Beeblebrox-BSD commented 7 years ago

Why --branch master? Are you building the drm-next branch? Which kernel config are you using?

My mistake on the branch, repo is tracking drm-next

In case my post was unclear, I'm doing

Regards.

markjdb commented 7 years ago

I have no such problems when building GENERIC_DRM with either a FreeBSD or drm-next world, so it's presumably some sort of environmental problem. Could you please paste your buildkernel invocation and output?

Beeblebrox-BSD commented 7 years ago

I have no such problems when building GENERIC_DRM with either a FreeBSD or drm-next world, so it's presumably some sort of environmental problem. Could you please paste your buildkernel invocation and output?

The command is straightforward with only KERNCONF flag invoked. Attached is kernel build log, my src.conf and output of $env

Regards

Edit: Seems txt attachments did not go through src.conf.txt env.txt bk-gendrm.txt

Beeblebrox-BSD commented 7 years ago

Can anyone give suggesions regarding where to look & what to try for debugging this issue?

The problem persists with ccache disabled and completely fresh (emptied /usr/obj) buildworld. Only settings in /etc/make.conf: NOPORTS=yes, NOSRC=yes, NODOC=yes, MALLOC_PRODUCTION=yes

weabot commented 7 years ago

Had this issue on GENERIC_DRM-NODEBUG, it went away after I added linuxkpi_gplv2 to MODULES_OVERRIDE. It seems you guys simply forgot to update the NODEBUG config file.

markjdb commented 7 years ago

@weabot Thanks for the hint, fixed. GENERIC_DRM-NODEBUG should really just include GENERIC_DRM and disable some options, but for now I just added linuxkpi_gplv2 to the module list.

@Beeblebrox-BSD Were you indeed using GENERIC_DRM-NODEBUG?

Beeblebrox-BSD commented 7 years ago

Unfortunately, weabot's issue is not related to what I reported. However, I've made progress.

I have found that prior to the start of stage "3.1: building everything", 4 files that should exist do not get populated under $WRKDIRPREFIX/drm-next/sys/KERNEL-NAME/. These are: device_if.c/h & bus_if.c/h

As a temporary work around, I copied these 4 files from a folder containing a kernel build from regular Head repo, into the folder named above, then re-started buildkernel with NOCLEAN.

My custom kernelbuild completed without any further errors, and I did not need to modify it as suggested by weabot.

Regards.

Beeblebrox-BSD commented 7 years ago

When I enable ccache, I see a lot of output of: Unknown modifier 'c' Probably not significant though, since no error occurs.

Unfortunately the latest Radeonkms kernel module still panics with mtx_lock() of spin mutex (null) @ sys/compat/linuxkpi/common/src/linux_idr.c:138 Card: RS880 / HD4250

markjdb commented 7 years ago

I'm still at a loss to explain the build failure. The log you posted doesn't appear to contain an actual error message. Can you try with a pristine objdir? That is, wipe out everything in /asp/obj/asp/git, or try with a tmp objdir.

The panic suggests that the per-CPU idr mutexes are somehow not initialized. The patch here adds a few debug prints containing the string "idr_preload_init"; could you see if they appear in the dmesg during boot (or when linuxkpi.ko is loaded)? Could you also obtain the stack trace of the panic?

https://people.freebsd.org/~markj/patches/idr_debug1.diff

Beeblebrox-BSD commented 7 years ago

I'm still at a loss to explain the build failure. The log you posted doesn't appear to contain an actual error message.

The very fist post on this issue has the error code - a simple file not found error for device_if.h called on line 730 of file sys/sys/bus.h. If I were to provide missing file from other source (per last posted work-around) the next error would be for bus_if.h in line 731 of same file. Those two just don't get populated.

Can you try with a pristine objdir? That is, wipe out everything in /asp/obj/asp/git, or try with a tmp objdir.

All testing & debug has been with pristine world / kernel build every time. Never reported without pristine attempts.

RE the patch: Applied and rebuilt kernel. Panicked upon loading radeonkms. PM sent for email re kernel dump.

Beeblebrox-BSD commented 7 years ago

Latest version of repo (3cc9d4f9747) no longer has this error, closing PR.

World does not build with ccache however, just an FYI.