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 '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 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>
Add runtime auto suspend support and provide
a dt option to set this delay for each bus.
Perf drop is seen due to clock switching during
write operation. QSPI flash device write page size
is 256 KB so clock switching was being done for every
256KB due to pm_runtime_put(&pdev->dev) call.
pm_runtime_put() function is called, the Linux kernel
will begin to power down the device. This may involve
disabling clocks, powering down voltage regulators, and
releasing other resources etc.
pm_runtime_set_autosuspend_delay function sets the
autosuspend delay for a device. The autosuspend delay
is the amount of time that the device will remain active
after it has been idle before it is automatically suspended.
The pm_runtime_set_autosuspend_delay() function can be used to
reduce power consumption by automatically suspending devices
when they are not in use.
Bug 4229700
Change-Id: Ib49b02c78ad25957c80d22f5cc316afa55aa24dd
Signed-off-by: Vishwaroop A <va@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985140
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
BMI088 driver was failing to build for Kernel version
> 6.2 and the following error is seen:
drivers/bmi088/bmi088_core.c:1043:42: error: 'struct iio_dev'
has no member named 'mlock'
mutex_lock(&st->snsrs[hw].bmi_iio->mlock);
mlock field is moved from indio_dev to iio_dev_opaque
structure from v6.2 onwards. Instead of using kernel
version, use conftest.sh script which checks for the
'mlock' field in iio_dev_opaque structure or not.
Bug 4190630
Change-Id: Icc540edd916718d30460b314600c20e70144b1d6
Signed-off-by: Gautham Srinivasan <gauthams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983266
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Below changes are made to support future
extensibility for new chips:
- Chip data field 'adsp_prid' is added to specify DSP ID
- Chip data field 'adsp_elf' is added to specify ELF file name
- DT property "nvidia,cluster_mem" is added to specify cluster
internal memories; ELF segments will be loaded into these
using intermediate shadow buffers so that unaligned access
is avoided
- "nvidia,adsp_mem" entries are made optional (0x0 in the size
field will indicate bypass)
- Chip extension functions 'set_boot_vec' and 'set_boot_freqs'
are added to support chip specific settings
Bug 4164138
Bug 3682950
Change-Id: I538ae0df57fa199a6eef75441167a9a5ba6924e8
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2894321
(cherry picked from commit fa7fc9d08af5fab9d0b2c5eb1b9b9a78446ade0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971980
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The max77851 driver is failing to build for Linux kernels v5.16 to v6.0
and the following error is seen ...
drivers/thermal/max77851_thermal.c:173:30: error: implicit declaration
of function 'devm_thermal_of_zone_register'; did you mean
'devm_thermal_zone_of_sensor_register'?
[-Werror=implicit-function-declaration]
thermal->tz_device = devm_thermal_of_zone_register(&pdev->dev, 0,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The function devm_thermal_of_zone_register() was introduced in Linux
kernel v6.1 and not v5.16.
Instead of relying on kernel version to determine if this function is
present using the conftest.sh script which checks the kernel that is
being compiled to see if this function is present or not. This is also
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 either.
Bug 200749982
Change-Id: I8d5e70d2d39497d7f513c82cd3a45312b2bc016a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980925