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>
Not all kernel define the enum UFSHCD_QUIRK_BROKEN_PWR_SEQUENCE
Add conftest to find out whether kernel has define the enum
UFSHCD_QUIRK_BROKEN_PWR_SEQUENCE or not and then check for macro
before using it.
Bug 4911768
Change-Id: I4eba6f02ab79c1d4a5bdefb3ec831cc4ae34d527
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Use conftest for finding whether APIs tegra264_io_pad_power_*
are available or not before using it.
Bug 4911768
Change-Id: Ic8df4a0109a270d5a486a67900ed7fe4c57b79be
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
In Linux v6.12 the definition 'no_llseek' was finally removed. Since
Linux v6.0 it had been redefined as NULL. Add a test to conftest to
determine if 'no_llseek' is present and if not then it is no longer
necessary to populate this and we can leave as NULL.
Bug 4876974
Change-Id: I051fdb285b32260b5913dad89cabe0be04253f67
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3222106
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.12, commit 88a2f6468d01 ("struct fd: representation change")
removed the 'struct file' pointer from 'struct fd'. This breaks building
the NVSCIIPC driver that tries to directly access the 'file' pointer
from the 'fd' structure. Fix this by using the helper macros 'fd_empty'
and 'fd_file' as necessary to fix the build.
Bug 4593750
Change-Id: I0f84736b408f533a732476175a8745091bc8542f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3217429
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Since Linux 6.5, get_trip_type function pointer is removed from
thermal_zone_device_ops struct. For drivers that need to get the trip
type should directly access trips array inside the thermal_zone_device
struct.
Bug 4740200
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I5fca83c215adaf937a2acc81a943c455e2280a04
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197038
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
For Linux v6.11, the 'pci_epc_event_ops' structure 'core_init' callback
was renamed to 'epc_init' and a new 'epc_deinit' callback was added.
Update the PCI endpoint drivers for Linux v6.11 by:
1. Adding tests to conftest to detect the presence of 'epc_init' and
'epc_deinit'.
2. Update the drivers as necessary to use the appropriate callback
depending upon what is present in the kernel.
Bug 4749580
Change-Id: Ife7e2d5d18332bf84f22142c9727dc1ece913c49
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3186686
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. This change impacts all OOT
platform drivers and so instead of editing each manually, add a
coccinelle script to handle updating all platform drivers. This script
is ran by executing the following command ...
$ spatch --in-place \
--sp-file /path/to/scripts/coccinelle/platform_driver_remove.cocci
<driver-source-directory>
Finally, add a test to the conftest script that is used to detect if the
platform driver 'remove' callback returns 'void'.
Bug 4749580
Change-Id: I53d25cc36cc3be97a6eeeb4ccbdf9b7dfda338a9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3176834
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The conftest test for detecting the number of arguments for the macro
of_property_for_each_u32() is not working as expected because the header
file for the function pr_info() is not included. Fix and simplify this
by removing pr_info() altogether.
Bug 4749580
Change-Id: I42eb91e1cb647b44f3e0c87f1c56fe5e29a56b34
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3186544
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The macro of_property_for_each_u32() was updated for Linux v6.11 to
remove two of the arguments that were only used internally in the macro
and do not need to be passed. Add a test to conftest to detect the
version of the of_property_for_each_u32() that is present in the kernel
and fix the f75308 driver accordingly.
Bug 4749580
Change-Id: If787a40d0af49989d93d9563dd6a84e906cb5209
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3184092
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Upstream commit cdd9a571b7d8 ("fs/proc: move page_mapcount() to
fs/proc/internal.h") made page_mapcount() an internal function for Linux
v6.11. This function is used by the NVMAP driver and so implement this
function in the NVMAP driver directly instead. Note that newer kernels
implement folio_entire_mapcount() for compound page counts where as
older kernels use compound_mapcount(). Use conftest to detect which of
these functions is present in the kernel.
Bug 4749580
Change-Id: I6504448727d6b3e9f2caa8581a66aad464ae2426
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3180097
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.11, the structure 'kernel_ethtool_ts_info' was added as a
copy of the existing 'ethtool_ts_info' for the kernel and the various
kernel functions were updated to use the new structure. This broke the
build for the nvethernet driver, so add a test to the conftest script to
detect the presence of this new strucutue and update the nvethernet
driver accordingly.
Bug 4749580
Change-Id: I2c5daa0132edee8c98eec3a66e19144484325ab0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3176868
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
In Linux v6.10, the 'core_init_notifier' flag has been removed and
dw_pcie_ep_init_notify() is now called by the designware endpoint driver
so it is not necessary to call from the EPF DMA test driver. Add a test
to the conftest script to detect the presence of the
'core_init_notifier' flag and update the EPF DMA test driver as
necessary.
Bug 4593750
Change-Id: I1c3862df2c673fcb2d7c19ebbf5e7d1cbdefea1f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3152309
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
The build of device tree is moved to new folder/repo and hence
it is not required to have build support file for device-tree.
Remove the unused file.
Bug 4654821
Change-Id: Id01d634d551d36bc9b36c8971b13ed27f7b6b6d6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3165347
The execution of conftest currently relies on the GNU toolchain located
in the P4ROOT path. However, since kleaf is a hermetic build, the P4ROOT
environment variable is cleaned up during the kleaf setup. To address
this, we create a symlink to connect the original P4ROOT path to the
kleaf build path.
Bug 4344670
Change-Id: I7877fd5d5543f73001dd1a017dfd0cc552802658
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3161994
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Add conftest to determine if the pci_epc_write_header() has the vfn
argument or not.
Commit 53fd3cbe5e9d791("PCI: endpoint: Add virtual function number
in pci_epc ops") added virtual function number as argument in the
APIs in Linux 5.14.
Jira HOSTX-5375
Change-Id: Ib0b1fbc2a33f9159f3497374d253e264a90f7b4d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166765
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Add conftest to determine if the MODULE_IMPORT_NS macro present.
This macro is added in commit 80140a81f7f833 ("module.h: simplify
MODULE_IMPORT_NS") in Linux 5.18.
Jira HOSTX-5375
Change-Id: Ie61dd169d21a0169c44060eb0e3f3fe4a9c149e8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166547
In Linux v6.10, commit b1ae92dcfa8e ("thermal: core: Make struct
thermal_zone_device definition internal") made the structure
'thermal_zone_device' internal and so the 'devdata' member is no longer
directly accessible. The function thermal_zone_device_priv() was added
in Linux v6.4 for retrieving the 'devdata' and so update the various
thermal drivers to use this function if present.
Bug 4593750
Change-Id: Ic53de9bbd5459c99a3ac26759aa8a966cd775fe5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3123221
(cherry picked from commit d95c0d0add)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3141886
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
The function blk_queue_max_hw_sectors() was removed in Linux v6.10 and
so add a test to conftest to see if this function is present or not to
allow the driver to build. The virtual-storage driver is currently
broken for Linux v5.19+ kernel due to other incompatibilities with these
newer kernels, but has been updated so that it still builds. Therefore,
allow the driver to build for Linux v6.10 while the driver is fixed
properly for these newer kernels.
Bug 4311184
Bug 4593750
Change-Id: Ic4054c87acdf3c77f03ff94fbdde513d84fe229b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142216
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.10, the v4l2-subdev callbacks 'g_dv_timings' and
's_dv_timings' were moved from the v4l2_subdev_video_ops structure to
the v4l2_subdev_pad_ops structure. Fix the build for Linux v6.10 by
using conftest to determine which structure is used for these callbacks.
Bug 4593750
Change-Id: Ic54e88da22ed7d1da9b6026a45b9c4307637c7b4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142215
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Some of the conftest tests are no longer working with the mainline
kernel and this is causing various build failures for drivers. Upstream
commit a3b00f10da80 ("objpool: enable inlining objpool_push() and
objpool_pop() operations") inlined some code that causes build error to
occur when the tests are built with 'Werror=address-of-packed-member'.
Upstream commit 6f303d60534c ("gcc-9: silence 'address-of-packed-member'
warning") disables the option 'address-of-packed-member' for the kernel
already and so fix these new build failures by disabling this option
for the conftest tests.
Bug 4593750
Change-Id: I37af97079bb7734fcd5bf10384b1afc071613594
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142214
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Few of the APIs from msi are deprecated in the
kernel 6.9. These APIs are:
platform_msi_domain_alloc_irqs
platform_msi_domain_free_irqs
The change is with commit commit 1a4671ff7a903e87 ("platform-msi: Remove
unused interfaces")
Add support to not use these APIs via conftest.
Bug 4471899
Change-Id: I3b07236eeb69900b06c4e17b7675f6419b8321e4
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3131464
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Building the PCI EPF DMA test driver for Linux v6.9 is failing because
the parameters for the pci_epf_alloc_space() function has been updated
to pass the alignment value via the 'pci_epc_features' structure instead
of passing the value directly.
Instead of hard-coding the endpoint alignment in the EPF DMA test driver
use the 'pcie_epc_get_features()' function to retrieve the endpoint
features structure which has the endpoint alignment.
By using the conftest script to detect the parameters for the
pci_epf_alloc_space() function, we can then pass the appropriate
arguments to the pci_epf_alloc_space() function.
Bug 4471899
Change-Id: Id80259a4c90d6f6ae2132cccbec1a96113d22be7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3116548
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
For Linux v6.9, the structure 'ethtool_eee' was replaced by
'ethtool_keee' and this new structure uses bitmaps for the structure
fields 'supported', 'advertised' and 'lp_advertised' as opposed to
'u32' types.
Add a test to conftest to detect the presence of the new 'ethtool_keee'
structure and update the nvethernet driver to use the various
linkmode_xxx helper functions for accessing the bitmap structure fields.
Bug 4471899
Change-Id: I275becfa665a36ed90e8bc227eaa4122825faa6a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3110494
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
The conftest test for detecting if the definition SLAB_MEM_SPREAD is
present is not working as expected because it is using the 'functions'
type which is intended for only checking if a function is present or
not. Fix this by correcting the type to 'types'.
Bug 4471899
Change-Id: Iba3c9fe70a97793576d9f188d50628acb55f44df
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3108683
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.9 the data argument of the function pointer passed to
gpio_device_find() was updated to be a const type. This breaks building
the CDI and ISC drivers for Linux v6.9. Update the test in conftest that
detects the presence of the gpio_device_find() function to perform a
second test to see if the argument for the function pointer is a const
type. Update the drivers that use the gpio_device_find() function
accordingly to fix the build.
Bug 4471899
Change-Id: I562451a401bcaebcf0acf9a7d563cb0ea1d87807
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3104559
Reviewed-by: svc-sw-mobile-l4t <svc-sw-mobile-l4t@nvidia.com>
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
When adding conftest tests for detecting if specific functions are
present, it is always better to check if the newly added function is
present versus the function that has been removed. The reason being that
is the newly added function is modified in the future then the conftest
tests can be extended to check for updates to the function.
Therefore, instead of checking if the function gpiochip_find() is
present, which was removed in Linux v6.7, check if the function
gpio_device_find() is present, which replaced gpiochip_find in Linux
v6.7.
Bug 4346767
Bug 4471899
Change-Id: I32bf1c3da32abbf3c8d3ef9ea350decf1564e0bc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3108643
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The definition SLAB_MEM_SPREAD was removed in Linux v6.9 and this breaks
the compilation of the Tegra Graphics Virtualization Comms driver. Add a
test to conftest to detect if SLAB_MEM_SPREAD is defined and update the
driver accordingly to fix the build.
Bug 4471899
Change-Id: Ibcac2dbc6538bcda92e818b333a9db6b8234f1d7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3104558
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.9-rc1, the typedef genpd_xlate_t was updated to make
'of_phandle_args' argument const. Add a test to the conftest script to
test if this argument is const and update the BPMP powergate driver
accordingly.
Bug 4471899
Change-Id: I85ddb3689ccf5dc769cd208575db69a2cf7b0a11
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3103819
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
In Linux v6.9-rc1, the function blk_mq_init_queue() was renamed
blk_mq_alloc_queue() and the arguments passed to the function were
updated. Add a test to conftest to detect if the function
blk_mq_alloc_queue() is present and update the virtual-storage driver
accordingly.
Bug 4471899
Change-Id: I7dc937eaad27445b1c140c57aafd36f4a4b769ba
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3095926
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
1. Add BUILD.bazel file.
2. Add build target of kernel module and required include folder
srctree.* in Makefile to fix the build issue
3. The tr (a build tool defined by kleaf in the sandbox) which
supported by toybox will cause the conversion of header files
to file_define to fail. Fixed it by separating with two tr
commands.
Bug 4344670
Change-Id: I56dcc148960f3b7703335943281589f42caa9af7
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066225
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The enum pci_epc_irq_type is dropped from Linux 6.8 with
commit 74955cb8ccc385 ("PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions")
Use alternative definition from mainline.
Bug 4448428
Change-Id: Ic248ee2522f171c311ac1086c2792bcf3ad6ed64
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3062520
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
In Linux v6.8, the 'g_frame_interval' function pointer was removed from
the 'v4l2_subdev_video_ops' structure and replaced by
'get_frame_interval' that was added to the 'v4l2_subdev_pad_ops'
structure. Add a test to conftest to detect if 'get_frame_interval' is
supported and update the camera CSI driver accordingly to populate the
appropriate function pointer.
Note that the new 'get_frame_interval' function pointer has an
additional 'state' argument but is otherwise the same as the previous
'g_frame_interval' function pointer.
Bug 4448428
Change-Id: Iff049c3bffda11c677ac879b2b91e10deb78060c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053901
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>