Commit Graph

133 Commits

Author SHA1 Message Date
Jon Hunter
ef57537991 spi: Fix build for Linux v6.13
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>
2025-07-24 10:19:11 +00:00
Jon Hunter
a8777837dd drm/tegra: Fix aperture support for Linux v6.13
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>
2025-07-24 10:19:11 +00:00
Jon Hunter
ed9db43d54 drivers: gpu: Fix IOMMU support for Linux v6.13
In Linux v6.13, commit f6440fcc9c7b ("iommu: Remove
iommu_domain_alloc()") removed iommu_domain_alloc() and was replaced by
iommu_paging_domain_alloc(). Use conftest to detect if the function
iommu_paging_domain_alloc() is supported by the kernel and update the
Tegra DRM and Host1x drivers accordingly.

Bug 4991705

Change-Id: I86221d96232396fdb6bdccf40c412e029881c513
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261695
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
eb7a615b59 drm/tegra: Fix genpd support for Linux v6.13
In Linux v6.13, commit d6caca30a548 ("OPP: Drop redundant
*_opp_attach|detach_genpd()") removed devm_pm_opp_attach_genpd(). This
has been replaced by devm_pm_domain_attach_list(). Use conftest to
detect the presence of devm_pm_domain_attach_list() and update the Tegra
DRM driver accordingly.

Bug 4991705

Change-Id: I5a3bd258d3fce5b09fd4ba84adad166e4cf47cfb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261693
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
b34e2f9554 video: tegra: nvmap: Fix f_count for Linux v6.13
In Linux v6.13, 'f_count' has been replaced by 'f_ref' in the 'file'
structure. Use conftest to detect if 'f_ref' is present and update the
NVMAP driver accordingly.

Please note that in most cases we can simply use the 'file_count' macro
for getting the count and this has been supported since Linux v2.6.

Bug 4991705

Change-Id: I3ccaf88bd6c3dca5b364205cf03a577945f62092
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3260939
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: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
52a4903b87 ASoC: tegra: Fix build for Linux v6.13
In Linux v6.13, commit 1bd775da9ba9 ("ASoC: add symmetric_ prefix for
dai->rate/channels/sample_bits") added a 'symmetric_' prefix to some
member of the 'snd_soc_dai' structure. Use conftest to determine if
these structure members have the 'symmetric_' prefix and update the
Tegra Mixer Control driver accordingly.

Bug 4991705

Change-Id: I366595f31932caaa447033c0d0e3b1d2b8dba6e3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261697
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
c9d5d23a33 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>
2025-07-24 10:19:11 +00:00
Mikko Perttunen
adaf80c7df conftest: Add test for of_property_read_reg
Add test for of_property_read_reg function presence, used by
the host1x driver.

Change-Id: I2f735dece273cae6bc3c75f40704be6d08eb213d
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3253531
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
2025-07-24 10:19:10 +00:00
Laxman Dewangan
267eedc25d ufs: Add conftest to check UFSHCD_QUIRK_BROKEN_PWR_SEQUENCE
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>
2025-07-24 10:19:10 +00:00
Laxman Dewangan
055bd73cbb camera: Use conftest for finding tegra264_io_pad_power_* available
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>
2025-07-24 10:19:09 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
5a54d4161a drivers: Fix build for Linux v6.12
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>
2025-07-24 10:19:07 +00:00
Jon Hunter
7adb4caf5b misc: nvsciipc: Fix build for Linux v6.12
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>
2025-07-24 10:19:07 +00:00
Manish Bhardwaj
56127d0d9b nvidia-oot: add support to use upstream ivc driver
add conftest support to use upstream ivc driver
if tegra_ivc_empty API is exported by kernel.

Bug 4551265

Change-Id: I030bf0c4012aedf4ec623fba2b397869972061a1
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3214054
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:07 +00:00
Johnny Liu
727ee719a2 conftest: update tests for devfreq and thermal
Introduce the following three tests:
1. devfreq_dev_profile_has_is_cooling_device
2. devfreq_has_freq_table
3. thermal_zone_for_each_trip

Bug 4854967

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I5fe2f7102f667a31d61550487a153590584ed638
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3213844
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Johnny Liu
66e40e599c conftest: Check presence of get_trip_type
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>
2025-07-24 10:19:06 +00:00
Krishna Yarlagadda
2ca08ce7f4 conftest: update test for prod settings
Change prod settings test from header to apis. Check if legacy prod
settings defined. Remove references to new prod settings.

Bug 4765671

Change-Id: I77e55cf473f75216ded5d7eae3de2bd9a7ae91d4
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3186208
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-08-13 10:46:42 -07:00
Jon Hunter
b0ff4f1358 pci: endpoint: Update drivers for Linux v6.11
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>
2024-08-05 12:28:50 -07:00
Jon Hunter
24826db83f scripts: Add scripts for platform_driver remove
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>
2024-08-05 12:21:58 -07:00
Jon Hunter
da1b446b64 scripts: conftest: Fix of_property_for_each_u32 test
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>
2024-08-04 12:33:14 -07:00
Jon Hunter
fc171fe539 drivers: Fix bus->match for Linux v6.11
In Linux v6.11, the 'bus_type' structure match() callback was updated to
make its 'drv' argument constant. Add a conftest test to detect this and
update the relevant drivers according to fix building them for Linux
v6.11.

Bug 4749580

Change-Id: I895d97241a7357074bb34b8e7a5bdfa2e31d5ca5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3183068
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-31 08:06:48 -07:00
Jon Hunter
8f1e881a2f hwmon: f75308: Fix build for Linux v6.11
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>
2024-07-31 08:06:25 -07:00
Jon Hunter
6e9c85dd91 conftest: Fix PCI EPC has core_init_notifier
The conftest test for detecting if the structure 'pci_epc_features' has
the member 'core_init_notifier' is not working as expected because it is
a bit field in the structure. Re-work the conftest test to fix this.

Bug 4593750
Bug 4748899

Change-Id: Ib93e4ae869c6a28922c0feed28ce90912371ff66
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3181508
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-28 21:57:40 -07:00
Jon Hunter
f327656ea3 nvmap: Implement nvmap_page_mapcount()
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>
2024-07-28 21:44:06 -07:00
Jon Hunter
9d6283ca4f net: nvethernet: Fix build for Linux v6.11
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>
2024-07-19 03:13:55 -07:00
Jon Hunter
d449f6cfd6 PCI: EPF: dma-test: Fix build for Linux v6.10
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>
2024-07-13 02:47:36 -07:00
Jon Hunter
083d7038d1 trace: Fix build for Linux v6.10
In Linux v6.10, the __assign_str() macro was updated to remove the 2nd
argument. Add a test to the conftest script to detect this and update
the various trace header files as necessary.

Bug 4593750

Change-Id: I495e78658249baa84cca5b864f4e172c1f3f0838
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3152310
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-07 12:50:13 -07:00
Laxman Dewangan
edbb5317f8 nvidia-oot: Remove the builds of device tree from nvidia-oot
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
2024-07-04 05:10:03 -07:00
Jian-Min Liu
f308ec7c39 kleaf: Add p4root symlink into conftest group
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>
2024-07-03 13:58:26 -07:00
Laxman Dewangan
00a95facef pci: Add conftest to determine if msi_get_virq() present
The API msi_get_virq() get added by commit 98043704f375 ("genirq/msi:
Make msi_get_virq() device domain aware") in Linux v6.1. Use
conftest to determine if this API is available or not.

Jira HOSTX-5375

Change-Id: I5e4cef9622d852fc889d9652e6631a79f2d21f9b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166766
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-03 07:47:50 -07:00
Laxman Dewangan
b260a8f442 pci: Use conf test to determine API change of pci_epc_write_header()
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>
2024-07-03 07:47:40 -07:00
Laxman Dewangan
1707f60f8b conftest: Add macro to determine if MODULE_IMPORT_NS present
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
2024-07-03 07:47:30 -07:00
Jon Hunter
65900a51a9 media: virtual-i2c-mux: Fix build for Linux v6.10
In Linux v6.10, the 'class' argument was removed from the
i2c_mux_add_adapter() function. Add a test to conftest to detect the
correct number of arguments for i2c_mux_add_adapter() and update the
virtual-i2c-mux driver accordingly to fix the build for Linux v6.10.

Bug 4593750

Change-Id: I7333a511b487b7c2f2fa0ce7c34f2df5f061fbe4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142398
(cherry picked from commit 5e0562c90d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142376
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-06-29 12:18:28 -07:00
Jon Hunter
9b118c56c7 pwm: tachometer: Fix build for Linux v6.10
In Linux v6.10, a pointer to a dynamically allocated 'struct device'
was replaced with a statically allocated 'struct device' in the
'pwm_chip' structure. Update the Tegra PWM Tachometer driver accordingly
to fix the build for Linux v6.10.

Bug 4593750

Change-Id: I9d629746290282b5c1858f8308128d94ff155c49
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3123219
(cherry picked from commit 0104837e60)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3142227
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-06-29 12:18:13 -07:00
Jon Hunter
bcd5a6c812 thermal: Fix build for Linux v6.10
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>
2024-06-29 12:18:03 -07:00
Jon Hunter
00cdac08b6 conftest: Add test for PCI_IRQ_INTX
In Linux v6.8, the definition 'PCI_IRQ_LEGACY' was deprecated and
renamed as 'PCI_IRQ_INTX'. Add a test for conftest to detect if
'PCI_IRQ_INTX' is defined so that drivers can migrate to the new
definition.

Bug 4593750

Change-Id: If34c258cfabe407bd15dc7078f2599737368dc58
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3143016
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-05-22 23:33:27 -07:00
Jon Hunter
c73cf3c92a block: virtual-storage: Allow build for Linux v6.10
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>
2024-05-22 09:19:53 -07:00
Jon Hunter
6255ffef44 media: camera: Fix v4l2-subdev for Linux v6.10
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>
2024-05-22 09:19:43 -07:00
Jon Hunter
1a635bb0ea conftest: Fix tests for Linux v6.10
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>
2024-05-22 09:19:33 -07:00
Laxman Dewangan
a1d5f342d5 pcie: endpoint: Add support to build with k6.9
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>
2024-05-05 07:50:31 -07:00
Jon Hunter
2ff1c3c6c9 conftest: Add test for pci_epc_bar_desc
The pci_epc_features structure was updated in Linux v6.9 to move various
fields under a new pci_epc_bar_desc structure. Add a test to conftest to
determine if the new pci_epc_bar_desc structure is present.

Bug 4627271

Change-Id: I5c473cb5172ac10e6f36c165be5a03f1fb90ebeb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3129468
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2024-05-02 19:14:49 -07:00
Jon Hunter
971680aadb PCI: Fix endpoint DMA test for Linux v6.9
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>
2024-04-18 01:14:35 -07:00
Jon Hunter
72761b8276 net: nvethernet: Fix build for Linux v6.9
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>
2024-04-17 08:47:15 -07:00
Jon Hunter
9458d6b97f media: camera: Ensure gpio_device_get_chip is present
In Linux v6.7, both gpio_device_find() and gpio_device_get_chip() were
added. However, don't assume that if one is present then so is the other
and so add a test to check if gpio_device_get_chip() is also present.

Bug 4471899

Change-Id: I0c547a52b0f397aef43884ab76d815573e8ed3f8
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3112133
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-04-11 12:24:27 -07:00
Jon Hunter
b8b92d5d5f conftest: Fix test for SLAB_MEM_SPREAD
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>
2024-04-04 06:47:58 -07:00
Jon Hunter
037fa78728 media: camera: Fix build for Linux v6.9
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>
2024-04-04 06:47:48 -07:00
Jon Hunter
68e7840dd8 media: camera: Update conftest for gpio_device_find
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>
2024-04-04 06:47:43 -07:00
Jon Hunter
7acb255112 video: tegra: virt: Fix build for Linux v6.9
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>
2024-03-28 17:56:28 -07:00
Jon Hunter
9c180ac0c8 soc/tegra: bpmp: Fix build for Linux v6.9
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>
2024-03-27 07:08:44 -07:00
Jon Hunter
3b9f5783b2 block: virtual-storage: Fix build for Linux v6.9
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>
2024-03-27 07:08:40 -07:00