Bug 279539 - graphics/nvidia-drm-515-kmod, graphics/nvidia-drm-61-kmod: Fails to build after stable/14 commit 183b64dfd84ad7fd504d04f40c90edad809083c1
Summary: graphics/nvidia-drm-515-kmod, graphics/nvidia-drm-61-kmod: Fails to build aft...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 280772
  Show dependency treegraph
 
Reported: 2024-06-05 09:08 UTC by Tomoaki AOKI
Modified: 2024-09-29 16:14 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (ashafer)


Attachments
Patch to fix build (944 bytes, patch)
2024-06-05 09:22 UTC, Tomoaki AOKI
junchoon: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomoaki AOKI 2024-06-05 09:08:59 UTC
graphics/nvidia-drm-515kmod and graphics/nvidia-drm-61-kmod starts failing build after stable/14 commit 183b64dfd84ad7fd504d04f40c90edad809083c1 [1].

Error part of build log is as follows.

     ===== Quot =====

nvidia-drm-fence.c:158:14: error: no member named 'm' in 'struct mtx'
  158 |     WARN_ON(!spin_is_locked(&nv_fence_context->lock));
      |              ^               ~~~~~~~~~~~~~~~~~~~~~~
./nvidia-drm-conftest.h:89:45: note: expanded from macro 'spin_is_locked'
   89 | #define spin_is_locked(lock) mtx_owned(lock.m)
      |                                        ~~~~ ^
/usr/src/sys/sys/mutex.h:478:33: note: expanded from macro 'mtx_owned'
  478 | #define mtx_owned(m)    (mtx_owner(m) == curthread)
      |                                    ^
/usr/src/sys/sys/mutex.h:476:50: note: expanded from macro 'mtx_owner'
  476 | #define mtx_owner(m)    lv_mtx_owner(MTX_READ_VALUE(m))
      |                                                     ^
/usr/src/sys/sys/mutex.h:470:29: note: expanded from macro 'MTX_READ_VALUE'
  470 | #define MTX_READ_VALUE(m)       ((m)->mtx_lock)
      |                                   ^
/usr/src/sys/sys/mutex.h:474:45: note: expanded from macro 'lv_mtx_owner'
  474 | #define lv_mtx_owner(v) ((struct thread *)((v) & ~MTX_FLAGMASK))
      |                                             ^

     ===== End quot =====

[1] https://cgit.freebsd.org/src/commit/?h=stable/14&id=183b64dfd84ad7fd504d04f40c90edad809083c1
Comment 1 Tomoaki AOKI 2024-06-05 09:22:32 UTC
Created attachment 251235 [details]
Patch to fix build

Attached patch fixed the build for stable/14.
As a large amount of builds are ongoing now, not yet tested wherher it breaks build on main or not.

Unfortunately, this patch has usually-fatal problem, as the __FreeBSD_version used for this is BEFORE THE PROBLEMATIC COMMIT.

But fortunately, the time window that is problematic is below 5 minutes.
Someone really unfortunate could be affected, but usually OK.

Another problem is that this kind of fix are needed again if the problematic commit is MFS'ed to releng/14.*.
Comment 2 Austin Shafer 2024-06-05 16:25:02 UTC
Patch LGTM thanks. I think that small gap between the __FreeBSD_versions is unfortunate but it is what it is. It should be unlikely to affect anyone as you said.

I don't have a commit bit, so someone else will have to commit this for me.
Comment 3 Tomoaki AOKI 2024-06-05 23:05:18 UTC
(In reply to Austin Shafer from comment #2)

Thanks! Now I can look for a committer to handle this.
Will post a mail to freebsd-ports ML as approved by maintainer soon.
Comment 4 Tomoaki AOKI 2024-06-16 01:43:49 UTC
Additional notes for triagers/committers kindly picking this.

Uploaded patch here is just a "build fix" for specific branch (stable/14).
So I think PORTREVISION bump is not needed here.

For main, this is already fixed. What I did is to adjust the scope of the fix.

For releng/14.1 and stable/13, just confirmed that the offending commit is not yet MFS'ed/MFC'ed at Jun.16, 2024 at 10:39:30 (JST, +9).
So currently stable/14 alone is affected.
Comment 5 Tomoaki AOKI 2024-08-12 13:46:57 UTC
Add Blocks: 280772 not to be missed when it lands.
Comment 6 Kevin Bowling freebsd_committer freebsd_triage 2024-09-29 09:45:56 UTC
Landed as 50bae2203980aacc742dbf1f69bcb5ead7bad4eb
Comment 7 Tomoaki AOKI 2024-09-29 16:14:13 UTC
(In reply to Kevin Bowling from comment #6)
Confirmed. Thanks!