dahdi-linux: fix hrtimer_init/hrtimer_setup handling on kernel 6.12#944
dahdi-linux: fix hrtimer_init/hrtimer_setup handling on kernel 6.12#944AgustinLorenzo wants to merge 1 commit into
Conversation
Formality Check: Suggestions AvailableWe completed the verification flow. Please review the formatting overview logs below.
|
|
@BKPepe can you review that? The error with the formalities has been occurring ever since that commit was implemented. |
f556fa2 to
38a0750
Compare
|
At this point, you have the option to either ask the author who added it (i.e., @graysky2 in pull request #929), or you can add the header yourself on their behalf. There is actually nothing wrong with the bot, and it is correctly pointing this out. :) Ideally, we need to figure out why the patch is still necessary, whether it was reported as an upstream bug, etc. |
From what I can see, this has already been reported here: asterisk/dahdi-linux#93, and it has been fixed here: asterisk/dahdi-linux@0fc7bfe. However, no official release including these changes has been published yet. If we want to avoid applying these patches ourselves, we would need to stop using the 3.4.0 release and instead build from the latest commit on the |
|
But nobody ever said we want to avoid applying these patches ourselves. We must have misunderstood each other. Why don't we apply the patch exactly as it is here? https://github.com/asterisk/dahdi-linux/commit/0fc7bfe4adf9d0fdd9f1f84122306da196bc187a.patch It has a header, a commit subject, and an author, making it very easy to trace what it does, why it does it, and whether it's part of the upstream and is therefore a backport. |
Okay, we'll go in that direction. I'll update the PR later. |
38a0750 to
e32420a
Compare
e32420a to
7e01783
Compare
The local 210-kernel-h-Add-wrappers-for.patch added a hrtimer_init()
compat wrapper in include/dahdi/kernel.h guarded by
LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0). This guard is wrong:
hrtimer_setup() was only introduced in kernel 6.13 (upstream commit
ac8bca2e8f6b3406af10700c427eb9b405c34265), and hrtimer_init() was not
actually removed until kernel 6.15 (upstream commit
9779489a31d77a7b9cb6f20d2d2caced4e29dbe6, "hrtimers: Delete
hrtimer_init()"). As a result, on kernels 6.8-6.14 (including the 6.12
branch used by qualcommax/ipq807x) the wrapper collides with the
kernel's own extern declaration of hrtimer_init(), and also references
hrtimer_setup() before it exists on kernels 6.8-6.12, breaking the
build:
error: static declaration of 'hrtimer_init' follows non-static declaration
error: implicit declaration of function 'hrtimer_setup'
Rather than just fixing the version guard on the local wrapper, adopt
upstream's actual fix (asterisk/dahdi-linux@0fc7bfe,
"dahdi_dummy: Use hrtimer_setup on kernels >= 6.15.0."), which resolves
the same issue (asterisk/dahdi-linux#93) by switching between
hrtimer_setup() and hrtimer_init() at the call site in
drivers/dahdi/dahdi_dummy.c, guarded correctly by
LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0), instead of
reimplementing hrtimer_init() as a compat shim in kernel.h.
Fixes: 4d8d33a ("dahdi-linux: forward-port to 6.18 kernel APIs, fix build flags")
Signed-off-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
7e01783 to
8cae664
Compare
Description
The local 210-kernel-h-Add-wrappers-for.patch added a hrtimer_init() compat wrapper in include/dahdi/kernel.h guarded by LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0). This guard is wrong: hrtimer_setup() was only introduced in kernel 6.13 (upstream commit ac8bca2e8f6b3406af10700c427eb9b405c34265), and hrtimer_init() was not actually removed until kernel 6.15 (upstream commit 9779489a31d77a7b9cb6f20d2d2caced4e29dbe6, "hrtimers: Delete hrtimer_init()"). As a result, on kernels 6.8-6.14 (including the 6.12 branch used by qualcommax/ipq807x) the wrapper collides with the kernel's own extern declaration of hrtimer_init(), and also references hrtimer_setup() before it exists on kernels 6.8-6.12, breaking the build:
Rather than just fixing the version guard on the local wrapper, adopt upstream's actual fix (asterisk/dahdi-linux@0fc7bfe, "dahdi_dummy: Use hrtimer_setup on kernels >= 6.15.0."), which resolves the same issue (asterisk/dahdi-linux#93) by switching between hrtimer_setup() and hrtimer_init() at the call site in drivers/dahdi/dahdi_dummy.c, guarded correctly by LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0), instead of reimplementing hrtimer_init() as a compat shim in kernel.h.
To Reproduce
Build
kmod-dahdifor thequalcommax_ipq807xtarget with kernel 6.12.94.Build log
Regards, Agustin
FYI @dangowrt @robimarko