- Adds syncpt emulator wrapper class for axi-nvdla.ko module
- Fixes minor bugs
- The behavior of SHIM write differs between the nvhost
syncpoint and nvhost-emu. The DLA KMD accommodates the
same.
- For the simulator, there is no proper management for loading
and unloading the firmware. This will lead to a undefined
behavior. This commit fixes the issue through use of refcnt.
- The RISCV will be in halted state and will continue from where
it left off. Due to a security configuration, the DLA cannot
reload the firmware again and again after booting the system.
As a WAR, the simulator avoids reloading the IMEM and DMEM.
Raised a Bug 4960393 to provide a proper fix and work around
is protected using macro BUG_4960393=1
- The FPGA is always considered on. Raised a Bug 4972382 to
enable power management and work around to skip the power
operation through macro BUG_4972382=1
Bug 4942853
Change-Id: I0bf0262d6fde3b3da47f040c493d915ae6a1f98a
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3248734
Reviewed-by: Vishal Thoke <vthoke@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
- Revamp the core logic to use the portability layer.
- Introduce ping debugfs node.
Bug:
- Update the abort retry logic for -EAGAIN error code. In
the absence of this logic, the queue becomes unavailable
due to race between the reset and the flush command.
Jira DLA-7294
Jira DLA-7310
Change-Id: I9f54f14334736189a00d2236f374188c2bac6155
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3196673
Reviewed-by: Akshata Bhat <akshatab@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
[1] In the event of busy CPU, the delayed interrupt or the
delayed callback from nvhost will result in the submission
failure.
[2] This commit fixes the issue by performing mandatory and controlled
cleanups.
- Atmost 2 slots are cleaned up prior to the submission.
- Complete queue cleanup during the suspend preparation.
- Complete queue cleanup after successful abort operation.
[3] Additionally, the commit fixes some potential leaks in the error
path.
Bug 4503438
Bug 4414867
Change-Id: Ic40f0c4b1f3c653d5d5e613adab01d3cbc3b9722
Signed-off-by: Arvind M <am@nvidia.com>
Signed-off-by: Akshata Bhat <akshatab@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3105861
(cherry picked from commit 438e8f8e96483971798e2d9014ed4a999143d082)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3120798
(cherry picked from commit 5668f6439643d44b3384bcd750a645d8db6ee0c9)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3196672
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Upstream commit 690da22dbfa8 ("asm-generic/io.h: kill vmalloc.h
dependency") removed the vmalloc.h header file from io.h and this breaks
building various drivers with the latest -next kernels. Fix this
by ensuring vmalloc.h is included and in most cases slab is not actually
needed and so remove this where possible. Note that it is fine to make
this change for all current supported kernels.
Bug 4593750
Change-Id: I003d1302bda226d356467e6ede99949b2716940a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3141984
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
The Linux v5.10 kernel defines a 'spec_bar()' macro to inhibit
speculation for ARM64 and so if we use this macro, then we can
remove the downstream speculation_barrier(). Please note that
it is important to remove such downstream macros because these
prevent us getting the various NVIDIA kernel drivers from
working with upstream Linux kernels.
Bug 3409896
Bug 3477445
Change-Id: Ie8d44f219d2dded2fc7bd36f24980b91c92395d9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2643778
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Update the DLA driver to add support for the upstream host1x driver.
The driver is built for upstream kernels only when the configuration
option CONFIG_TEGRA_HOST1X_NEXT is defined.
For the supporting the upstream host1x driver, the DLA driver is
registered with the upstream host1x driver by calling
host1x_driver_register().
Please note that for upstream Linux, the firmware naming conventions
used for upstream are preferred. So that although the same firmware
is used with both upstream and downstream, it is simply the filename
that is changed.
The 'spec_bar()' macro was removed from Linux v5.13 because there were
no upstream users. Include the downstream header arm64-barrier.h that
adds the spec_bar() from upstream so that we can build NVDLA for Linux
v5.13+ kernels.
Finally, add the necessary stub functions to the nvhost.h header file
to allow the driver to build. Please note that these functions are
not used and so stub functions are sufficient.
Bug 3409896
JIRA LS-410
Change-Id: Ifb8f269b260056da0fba6e5e2f88aa813178bff3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653103
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
[1] SC7 power state switches off all modules except for RAM and
AON regions.
[2] DLA suspend operation is responsible for the following.
- Readiness: Checks if there are no outstanding tasks in queues.
- Suspend: Initiates power-off sequence.
[3] DLA resume operation is responsible for the following.
- Resume: Initiates power-on sequence.
[4] In addition, each module maintains is_suspended flag to
communicate the state of suspension.
Jira DLA-5365
Change-Id: I594a1a2731a4f28f552e4be06338fca2fa4e7ca1
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2659248
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The NVDLA driver uses the nvhost_err() and nvhost_dbg_fn() macros which
simply call dev_err() and dev_info(), respectively. When compiling the
NVDLA driver against an upstream Linux kernel, nvhost_err() and
nvhost_dbg_fn() are not found and compilation fails. Fix this by
replacing nvhost_err() with either dev_err() or pr_err() and replace
nvhost_dbg_fn() with nvdla_dbg_fn().
JIRA LS-410
Change-Id: Ib89a187f330a4a80bd0b0329171a02f6336565ff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2643161
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
[1] In the absence of synchronization to access task pool, submission may
happen at faster rate than cleanups. This shall lead to frequent
out-of-memory error.
[2] This commit fixes the issues through retries before throwing OOM.
a. Sets up a communication between cleanup & submit.
b. Retries for allocating task memory
- Retry period: 1 ms
- Total timeout: 10 ms
Bug 200680501
Change-Id: Iea25fbe6e7891938f6318285d4824bc1c54ddb05
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2518193
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This issue mostly seen in T210 when resource policy for modules are set to
RESOURCE_PER_DEVICE and test with kernel_submit regression, Then it generally
leads to a crash in second or forthcoming iteration of kernel_submit.
Observation:
After completion of channel's job, module gets suspended without freeing the
channel, And when module resume, it's start submiting job on the channel's
syncpoint which is already freed by others.
This scenario occurs in two cases with VIC module,
1 A user application(Ex: nvgpu) freed the syncpoint and VIC module is
in suspend, Now when module will resume it will expect same syncpt
active and belongs to it.
2 In between of 1st possibility If other module(Ex: nvenc) gets the
syncpoint from free list when the first module(VIC) is suspended,
Now when first module(VIC) resume and start submiting job on the same
syncpoint which is already acquired by other module.
Changes made :
o Now, Channel will be freed on channel dma completion
o Channel will be re-acquire on every submit
o Syncpoint will not be freed when channel gets free.
o Syncpoint will be acquire once by user space and will be
freed when use space release the device
o Now, Syncpoints gets mark used and unused using chid
o Set resource policy to RESOURCE_PER_DEVICE for msenc, nvdec,
nvjpg and vic
Bug 200582662
Change-Id: Ief7658974cbd958f883e7b83add5902f766826df
Signed-off-by: Ankit Patel <anpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2352726
(cherry picked from commit 745c3c8d46c23353a81e5e6035af3ed3848b02eb)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2366098
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>