Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.
This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.
Bug 4221847
Change-Id: I159cd7d5feca050c8a8014d9c2a3b43e8974fdfd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993807
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v5.17, the GENHD_FL_EXT_DEVT and GENHD_FL_NO_PART_SCAN were
removed and in Linux v5.19, the flags QUEUE_FLAG_SECERASE and
QUEUE_FLAG_DISCARD were removed. Rather than using kernel version
checks, simply check if the flag is defined. This is beneficial for
working with 3rd party Linux kernels that may have backported changes
from upstream.
Although the Tegra virtual-storage can be compiled for v5.19 kernels, it
still needs to be fixed properly for v5.19 kernels. Add some dev_WARN
prints to warn if these flags are not supported so that it will be clear
that this is not expected to work.
Bug 4119327
Bug 4311184
Change-Id: I7f7585b238ad45b26fb1d0df42b338c904ce87e7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2992552
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
remove dependency on 0xFF flag in block height field as
a performance optimization.
fold processing of descriptors into channel processing loop
in order to be able to traverse the descriptor list.
second call to nvpva_task_dma_desc_mapping is to process
descriptors not attached to any channels.
Bug 4185299
Change-Id: Ic5d3c60bca7de13698b83365fe3b0cedbe42c60b
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979303
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vivek Bangera <vbangera@nvidia.com>
The test to see if the function __alloc_disk_node() has the 'lkclass'
argument is not working as expected and so builds for Linux v5.18 and
Linux v5.19 are failing. The problem is that the type 'NULL' is not
defined and so the test always fails. Fix this by using the
'lock_class_key' type and including the appropriate headers.
Bug 4221847
Change-Id: I6b3d6987d0d3250f00c27c586d6a971a3dceac59
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994321
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.
This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.
Bug 4221847
Change-Id: Iec2c793ce408dab1cf7e5118c019dfe656dfa87c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2992630
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Since Linux v6.3, legacy GPIO support has been dropped from the Linux
kernel and the gpiod_xxx functions have been supported for a long time
going back to Linux v3.x kernels. Therefore, drop support for the legacy
GPIO functions.
This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.
Bug 4119327
Change-Id: Ib84e70b27645032108b2c25ce5d4ea3977f6cae1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993098
Reviewed-by: Vishwaroop A <va@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
In Linux v6.5, commit 62aeaeaa1b26 ("drm/aperture: Remove primary
argument") removed the 'primary' argument from the function
drm_aperture_remove_framebuffers(). Update the test in conftest script
for drm_aperture_remove_framebuffers() to test for this and use the
generated definition accordlingly in the Tegra DRM driver to fix the
build for Linux v6.5.
Bug 4221847
Change-Id: I7a7bb3a029b236e0ce42c1a404085757d95374d1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990528
In Linux v6.5, the arguments to the function snd_soc_of_get_dai_name()
were updated and this is causing the Tegra ASoC machine driver build to
fail. Add a new test to the conftest script to check the arguments for
snd_soc_of_get_dai_name() and use the definition generated by the
conftest script accordingly.
Bug 4221847
Change-Id: I32772da12ab59eb09e2f9d8bc66471d859201f8e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990531
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.5, the 'vmas' parameter is removed from get_user_pages() by
commit 54d020692b34 ("mm/gup: remove unused vmas parameter from
get_user_pages()"). Update the conftest script test for
'get_user_pages' to test for this and use the generated definition in
the NVMAP driver accordingly.
Bug 4221847
Change-Id: I3b2b2b9937bba86a8924cf5852fe62d57cd5d3b6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990512
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.4, the 'params' member of the snd_soc_dai_link was replaced
with the 'c2c_params' member. Add a new test to the conftest script that
checks if the 'c2c_params' structure member is present and use the
definition created by conftest to select which structure member is used.
Bug 4221847
Change-Id: I7ebb4187fd1cd70097bf65409bda3b2a6830a303
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989731
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.4, the various drm_scdc_get/set functions were updated to
take an argument of type 'struct drm_connector'. Add a new test to the
conftest script that checks if this argument is used and use the
definition created by conftest to select which version of the function
is used.
Bug 4221847
Change-Id: Id6b6396bbe875a0268f8fe2f68ae08f78a32c954
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989035
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The function blk_mq_alloc_request() has been exported in the Linux
kernel since v3.16 and the function blk_mq_free_request() has been
exported in the Linux kernel since v3.19. The function
Since Linux v5.0, blk_get_request() has always called
blk_mq_alloc_request() and blk_put_request() has always called
blk_mq_free_request(). Given that kernels newer than v5.0 are now
supported drop the version check around blk_mq_alloc_request() and
blk_mq_free_request() and always use these functions.
Bug 4119327
Change-Id: I018687b340acaa9617c81551efb436a0439b14f1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2991457
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.4, the module pointer argument is removed from the
class_create() function. Add a test to the conftest script that checks
if this argument for the class_create() function has been removed and
use the definition created by conftest to select which version of the
function is used.
Bug 4183168
Bug 4221847
Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.4, the macro DEFINE_SEMAPHORE was updated and this breaks
the build for the ch384 serial driver. Add a new test to the conftest
script that checks if the macro DEFINE_SEMAPHORE takes a number argument
and use the definition created by conftest to select which version of
the macro is used.
Bug 4183168
Bug 4221847
Change-Id: Ie1bcb95b07e792c70fa52e22465bdf565dc456af
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989732
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
In Linux v6.4, commit
3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAGS")
added a kernel config option for MAX_SKB_FRAGS and change the type of
the definition to integer. This causes the nvethernet driver build to
fail and the following errors are seen ...
drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:5949:33: error:
format ‘%ld’ expects argument of type ‘long int’, but argument 4
has type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
"invalid tx-frames, must be inrange %d to %ld",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/nvidia/nvethernet/ethtool.c:950:28: error: format
‘%ld’ expects argument of type ‘long int’, but argument 4 has
type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
"invalid tx-frames, must be in the range of"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix this by changing the type in the respective prints to integer. Note
that his is also to make this change for kernel prior to Linux v6.4.
Bug 4183168
Bug 4221847
Change-Id: Ibd9160ad08e65e0b85cae1cf4903075c31a1cd77
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989002
Reviewed-by: Shanker Donthineni <sdonthineni@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The r8168 driver fails to build with Linux v6.5 because the
skb_gso_segment() is not found ...
drivers/net/ethernet/realtek/r8168_n.c:29231:24: error: implicit
declaration of function ‘skb_gso_segment’; did you mean
‘skb_gso_reset’? [-Werror=implicit-function-declaration]
segs = skb_gso_segment(skb, features);
^~~~~~~~~~~~~~~
Commit d457a0e329b0 ("net: move gso declarations and functions to their
own files") moved the definition to a new file 'net/gso.h'. Fix this by
updating the conftest Makefile to check for the presence of this header
file and use the definition generated by conftest accordingly in the
r8168 driver.
Bug 4221847
Change-Id: I6ad83a06602ef0679a76ff1a6e5ddabbcb1bfe00
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990521
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Add the updated Tegra SE driver with the below improvements.
- Remove dependency with nvhost apis and use upstream Host1x APIs.
- Implement software fallbacks for keys/plaintexts unsupported by
hardware.
- Support only T234 and later. Prior chips will use tegra-se-nvhost
driver.
Bug 4221414
Bug 3579794
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: I398a5b7cc3f752b44d01d6d1c81f813f862e4cd9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977810
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Instead of relying on kernel version to determine if functions or
specific versions of functions are present in the kernel, add compile
time tests to the conftest.sh script to determine this at compile time
for the kernel being used. This is beneficial for working with 3rd party
Linux kernels that may have back-ported upstream changes into their
kernel and so the kernel version checks do not work.
Bug 4119327
Change-Id: I79e701940ca70ca4d66500c75b5992f9d92b54b0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985744
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Instead of relying on kernel version to determine if the 'tegra_ivc'
structure has a member that is of type 'struct iosys_map', add a compile
time test to the conftest.sh script to determine this at compile time
for the kernel being used. This is beneficial for working with 3rd party
Linux kernels that may have back-ported upstream changes into their
kernel and so the kernel version checks do not work.
Bug 4119327
Change-Id: Ia993ca9df7694347252a795c7dee1e95f2f9fa2f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985743
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Instead of relying on kernel version to determine if the 'remove'
callback for the 'bus_type' structure return an integer or void, add a
compile time test to the conftest.sh script to determine this at compile
time for the kernel being used. This is beneficial for working with 3rd
party Linux kernels that may have back-ported upstream changes into
their kernel and so the kernel version checks do not work.
Bug 4119327
Change-Id: I5457300619f5fb3b6afe61742bc6fce4cbefcd5d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985719
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
If the bmi088 is built against a kernel that does not have CONFIG_IIO
enabled, then the build fails because the following symbols are not
found ...
ERROR: modpost: "iio_read_const_attr" [drivers/bmi088/bmi088.ko]
undefined!
ERROR: modpost: "iio_kfifo_allocate" [drivers/bmi088/bmi088.ko]
undefined!
ERROR: modpost: "devm_iio_device_alloc" [drivers/bmi088/bmi088.ko]
undefined!
ERROR: modpost: "__devm_iio_device_register" [drivers/bmi088/bmi088.ko]
undefined!
ERROR: modpost: "iio_device_attach_buffer" [drivers/bmi088/bmi088.ko]
undefined!
ERROR: modpost: "iio_push_to_buffers" [drivers/bmi088/bmi088.ko]
undefined!
Fix this by only building the bmi088 driver is CONFIG_IIO is enabled.
Bug 4190630
Change-Id: I9ca80d9a638d33d8996d5197b6f44f1d7382a9d2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2986513
Reviewed-by: Gautham Srinivasan <gauthams@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
If probing of the VIC engine fails then the following crash is observed
...
tegra-vic 15340000.vic: devfreq_add_device: Unable to find governor for
the device
tegra-vic 15340000.vic: failed to init devfreq: -22
tegra-vic: probe of 15340000.vic failed with error -22
tegra-nvdec 15480000.nvdec: Adding to iommu group 45
list_add corruption. prev->next should be next
(ffff000094505f80), but was 0000000000000000. (prev=ffff000095245cf0).
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:26!
Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
...
pc : __list_add_valid+0x80/0x84
lr : __list_add_valid+0x80/0x84
...
Call trace:
__list_add_valid+0x80/0x84
host1x_subdev_register+0x80/0x170 [host1x_next]
__host1x_client_register+0xac/0x160 [host1x_next]
nvdec_probe+0x1c8/0x58c [tegra_drm_next]
platform_probe+0x6c/0xe0
really_probe+0xc4/0x3dc
__driver_probe_device+0x114/0x190
driver_probe_device+0x44/0x114
__driver_attach+0xcc/0x1f0
bus_for_each_dev+0x78/0xd0
driver_attach+0x28/0x30
bus_add_driver+0xbc/0x220
driver_register+0x70/0x120
__platform_register_drivers+0x70/0x140
host1x_drm_init+0x58/0x1000 [tegra_drm_next]
do_one_initcall+0x48/0x2d0
do_init_module+0x5c/0x270
load_module+0xb08/0xc70
__do_sys_init_module+0x1dc/0x214
__arm64_sys_init_module+0x20/0x2c
invoke_syscall.constprop.0+0x7c/0xd0
el0_svc_common.constprop.0+0x140/0x150
do_el0_svc+0x38/0xa0
el0_svc+0x38/0x18c
el0t_64_sync_handler+0xb4/0x130
el0t_64_sync+0x17c/0x180
Code: aa0103e2 910fa000 aa0403e1 941b9509 (d4210000)
---[ end trace f8f20f933fe03c7e ]---
The problem is that some of the engines are not cleaning up correctly on
probe failure and so fix this by adding the necessary calls clean up if
probe fails.
Bug 4303860
Change-Id: Ife1e0ce7429458d187422162a298cc140f0e3bc4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2986790
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Instead of relying on kernel version to determine if the
register_shrinker() function has the 'fmt' argument, use the conftest.sh
script to test if this argument is present at compile time. This is
beneficial for working with 3rd party Linux kernels that may have
back-ported upstream changes into their kernel and so the kernel version
checks do not work.
Bug 4119327
Change-Id: I0cbde2dfc2affc41e93eee1f3a195dbc0f8f5667
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984429
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. This
is beneficial for working with 3rd party Linux kernels that may have
back-ported upstream changes into their kernel and so the kernel version
checks do not work.
Bug 4119327
Change-Id: I56281fa5d95862338bd8a43d6e22225c27590462
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984422
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. This
is beneficial for working with 3rd party Linux kernels that may have
back-ported upstream changes into their kernel and so the kernel version
checks do not work.
Bug 4119327
Change-Id: If315b18af74c830e9ba3993208de3a3326c4187d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984415
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The nv-p2p driver does not compile against pre-v5.15 kernels and the
following error is seen ...
drivers/nv-p2p/nvidia-p2p.c:153:24: error: passing argument 1 of
'mmap_read_lock' from incompatible pointer type
[-Werror=incompatible-pointer-types]
153 | mmap_read_lock(¤t->mm);
| ^~~~~~~~~~~~
| |
| struct mm_struct **
The version of the function get_user_pages_unlocked() used in the nv-p2p
driver has been support since v4.6 and so drop usage of
get_user_pages_locked() completely.
Bug 4142533
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I957197825ddee6b705626b345aaff4647de08533
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983961
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>