Skip to content

QDMA: libqdma: select timer_container_of() on RHEL backports (9.8+/10.1+) - #392

Open
amd-vserbu wants to merge 1 commit into
Xilinx:masterfrom
amd-vserbu:fix/timer-rhel-backport
Open

QDMA: libqdma: select timer_container_of() on RHEL backports (9.8+/10.1+)#392
amd-vserbu wants to merge 1 commit into
Xilinx:masterfrom
amd-vserbu:fix/timer-rhel-backport

Conversation

@amd-vserbu

Copy link
Copy Markdown

Summary

from_timer() was renamed to timer_container_of() upstream in Linux v6.16 (commit 41cb08555c41). The existing guard in qdma_mbox.c keyed solely off LINUX_VERSION_CODE > KERNEL_VERSION(6, 16, 0), which misfires on RHEL-family kernels that backported the rename while keeping an older version string, breaking the build on RHEL/AlmaLinux/Rocky 9.8+ and 10.1+.

Fixes #391

Changes

  • Add a QDMA_HAVE_TIMER_CONTAINER_OF feature gate in qdma_compat.h that is defined when either:
    • LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0) (vanilla), or
    • RHEL_RELEASE_CODE indicates 9.8–9.x or 10.1+ (the backported streams: RHEL-115039 for el9, RHEL-114125 for el10).
  • The RHEL comparison is nested under #elif defined(RHEL_RELEASE_CODE) so that RHEL_RELEASE_VERSION(...) is never evaluated on non-RHEL kernels (where it is undefined and would otherwise be a preprocessor error).
  • qdma_mbox.c now selects the branch via #if defined(QDMA_HAVE_TIMER_CONTAINER_OF).
  • Tighten the upstream check from > to >= so a vanilla 6.16.0 kernel is also matched (the rename is present in 6.16).

Testing

Compile-tested make driver KDIR=<tree> against:

  • Ubuntu 6.8 kernel (24.04 HWE kernel) and Ubuntu 7.0 kernel (26.04 kernel)
  • AlmaLinux 9.8 (kernel-devel-5.14.0-687.12.1.el9_8).

Signed-off-by: Vlad-Gabriel Serbu <Vlad-Gabriel.Serbu@amd.com>
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

Successfully merging this pull request may close these issues.

QDMA: libqdma fails to build on RHEL/AlmaLinux/Rocky 9.8+ and 10.1+ (from_timer removed by backport)

1 participant