cpuidle: Fix build for Linux v6.13

Commit ef4c675dc296 ("genirq: Unexport nr_irqs") unexported 'nr_irqs' in
Linux v6.13 and this breaks the build for the cpuidle-debugfs driver.
For Linux v6.13 the number of IRQs can be queried by using the function
irq_get_nr_irqs() instead. Fix the build by using conftest to detect if
the function irq_get_nr_irqs() and use this function if it is present.

Bug 4991705

Change-Id: I98d477896fcf9e8d2e1afa21e2f7ba4d071ab442
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261690
Reviewed-by: Ishan Shah <ishah@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Preetham Chandru R <pchandru@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-12-03 16:07:25 +00:00
parent 4b5bdb9393
commit c9d5d23a33
3 changed files with 36 additions and 5 deletions

View File

@@ -7459,6 +7459,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_IIO_DEV_OPAQUE_HAS_LOCK" "" "types"
;;
irq_get_nr_irqs)
#
# Determine if the function irq_get_nr_irqs() is present.
#
# Commit 5280a14a6079 ("genirq: Introduce irq_get_nr_irqs() and
# irq_set_nr_irqs()") added irq_get_nr_irqs() in Linux v6.13.
#
CODE="
#include <linux/irqnr.h>
void conftest_irq_get_nr_irqs(void) {
irq_get_nr_irqs();
}"
compile_check_conftest "$CODE" "NV_IRQ_GET_NR_IRQS_PRESENT" "" "functions"
;;
kthread_complete_and_exit)
#
# Determine if function kthread_complete_and_exit() is present.