In Linux v6,15, a 'speed' argument was added to the phy_loopback()
function. Add a conftest test to detect this change and update the
nvethernet driver accordingly. Note that if 'speed' is set to 0 when
calling phy_loopback(), then phy_loopback() behaves the same way as it
did before this argument was added. So by default set speed to 0 for the
nvethernet driver.
JIRA LINQPJ14-47
Change-Id: I55f775e672bfa1a00c9ccbd825c82be1868b0b52
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330685
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
The Tegra264 PCIe drivers don't build for kernels that don't have:
1. The structure mrq_pcie_request_req defined
2. The function pci_epc_deinit_notify() present
This is currently being handling by building a dummy driver for kernels
that don't have these. To simplify this, use conftest to detect if the
above are present and modify the Tegra264 PCIe driver accordingly if
they are not present. By using conftest we can remove the Makefile
variable 'NV_OOT_PCIE_T264_SOC_SKIP_BUILD' and ccflag
'DNV_CONFIG_PCIE_TEGRA_DMA_DISABLE'.
Finally, the PCIe drivers are always built as modules so simplify the
Makefile and remove the usage of 'CONFIG_TEGRA_OOT_MODULE'.
Bug 4911768
Change-Id: Id282497b8607a732b5e6c90e1e7c1436589a0b5f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3245592
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Previous code was using the struct request.completion_data
to pass the struct ioctl_request to the processing thread.
This member variable is removed from kernel v6.5.
Change contains:
[1] Moving this variable from struct request to struct struct vblk_dev.
[2] Copyright Banner is updated
This makes the passing of the struct ioctl_request independent of
linux kernel transition
Bug 4311184
Change-Id: I3dd2c4ee9861516db770adcba345362395bf3fa3
Signed-off-by: gokull <gokull@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3314801
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Method to configure the struct queue_limits has changed
from kernel v6.11.
The following API's are removed from v6.11
[1] blk_queue_max_secure_erase_sectors
[2] blk_queue_max_discard_sectors
[3] blk_queue_write_cache
[4] blk_queue_logical_block_size
[5] blk_queue_physical_block_size
[6] blk_queue_max_hw_sectors
[7] The semantics of the flag QUEUE_FLAG_NONROT
is set as default value for queues, so this flag
is removed in v6.11.
[8] The flag BLK_MQ_F_SHOULD_MERGE is not valid in
v6.14
The above API's are replaced by direct
assignment to the queue_limits and use the new API
queue_limits_set. This API takes the incoming
values, validates, populates the other members
of the struct accordingly and assigns the
provided queue_limits to the corresponding queue.
The change contains:
[1] Addition of new approach that is compatible
with v6.11
[2] Addition of a macro (NV_BLOCK_USE_QUEUE_LIMITS_SET)
for backward compatibility
[3] This is a special case where both the variable
and the function needs to be present for the macro to be
enabled. The changes were made accordingly.
[4] The flag BLK_MQ_F_SHOULD_MERGE is protected by
macro
Bug 4311184
Signed-off-by: gokull <gokull@nvidia.com>
Change-Id: Ida2c12de0977f6405e7cc7dec946cf0f64413c97
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3303900
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
In Linux v6.13, the quirk definition 'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS'
was removed and replaced with a function pointer than can be used to set
the DMA mask as needed for a given device. Update the Tegra UFS driver
to fix support for Linux v6.13. Note that prior to Linux v6.13, the flag
'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS' would set the DMA mask to 32-bits
and so this change is equivalent to the configuration of prior kernels.
Bug 4991705
Change-Id: I859331e9eea918d2438d68b871642fee5e4148e0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283447
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
In Linux v6.8, the 'g_frame_interval' and 's_frame_interval' function
pointers were removed from the 'v4l2_subdev_video_ops' structure and
replaced by 'get_frame_interval' and 'set_frame_interval' that were
added to the 'v4l2_subdev_pad_ops' structure.
This change was previously fixed for the Tegra CSI driver by adding the
necessary conftest changes. A new update to the Tegra Cam V4L2 causes
the build to fail for Linux v6.8+ kernels because of the same issue. Fix
up the Tegra Cam V4L2 driver in the same way as the Tegra CSI driver,
but update the name of the conftest test to indicate that this is
applicable for both the 'get_frame_interval' and 'set_frame_interval'
function pointers.
Bug 4448428
Bug 4807063
Change-Id: Ica47f3aaece0bf81e2adc3c431056ea51b64a893
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3231775
(cherry picked from commit 91416b264c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246399
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
In Linux v6.12, commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
fop_flags") moves the setting of the FMODE_UNSIGNED_OFFSET into the
various drivers and renames this flag. This change is causing various
tests to fail because opening the DRM device is failing.
Use the presence of the new FOP_UNSIGNED_OFFSET flag in the kernel to
determine if we need to set this flag in the Tegra DRM driver.
Bug 4876974
Change-Id: Ie72a9340187b1c206f0cda6d7e3dab44d603a41c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3269063
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
The following upstream commits have been back-ported to the out-of-tree
Tegra DRM driver to align with upstream to help pull in the latest
updates from upstream.
Changes from Linux v6.2:
7ad4384d53c6 drm/tegra: Add missing clk_disable_unprepare() in
tegra_dc_probe()
Changes from Linux v6.3:
3fb1f62f80a1 drm/fb-helper: Remove drm_fb_helper_unprepare() from
drm_fb_helper_fini()
Changes from Linux v6.4:
71ec16f45ef8 drm/tegra: Implement fbdev emulation as in-kernel client
25dda38e0b07 drm/tegra: Initialize fbdev DRM client
1ac45068af9d drm/tegra: Hide fbdev support behind config option
08263e91f260 drm/tegra: Removed fb from struct tegra_fbdev
434434608a91 drm/tegra: Remove struct tegra_fbdev
dc06f4a495df drm/tegra: Include <linux/i2c.h>
f68b63ebc433 drm/tegra: Include <linux/of.h>
437405403ab4 drm/tegra: rgb: Make tegra_dc_rgb_remove() return void
The changes have been back-ported to ensure that they build for all
kernel versions supported and utilise conftest as necessary to handle
kernel differences.
Bug 4876974
Change-Id: I6c8403325a7b4874f3ad1c6a0b1f662c1494c397
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3267798
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
In Linux v6.13, commit 94a20fb9af16 ("sysfs: treewide: constify
attribute callback of bin_attribute::mmap()") changed the type of the
'struct bin_attribute' argument of the bin_attribute:mmap function
pointer to const. Use conftest to detect if this argument is const or
not in the kernel the driver is being compiled against to fix the build.
Bug 4991705
Change-Id: I791d6c9dde50f1444d0339ebd8a18434045f9026
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261699
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Commit 0809a9ccac4a ("spi: remove {devm_}spi_alloc_master/slave()")
removed devm_spi_alloc_master() and this breaks building the Tegra124
and Tegra210 SPI drivers for Linux v6.13. Commit b8d3b056a78d ("spi:
introduce new helpers with using modern naming") previously added new
helpers in Linux v6.2 which should be instead. Add a test for conftest
to detect if the kernel supports the function devm_spi_alloc_host()
and if so use this function.
Bug 4991705
Change-Id: I1d639297ef7adfdcde50927360607639b45a4a60
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261698
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
In Linux v6.13, commit 689274a56c0c ("drm: Remove DRM aperture helpers")
removed the DRM aperture helper functions and drivers should simply use
the existing video helpers. Update the Tegra DRM driver to use
aperture_remove_all_conflicting_devices() if available to align with
upstream.
Bug 4991705
Change-Id: Ie4b78a4ea519ffcaaf972417ec2cbe7c436eb808
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261694
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
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>
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>