Commit Graph

1598 Commits

Author SHA1 Message Date
Mohan Kumar
e2e48eebb6 ASoC: tegra: Migrate to upstream ICC
Migrate the ahub bandwidth management driver to align with upstream
ICC apis.

Bug 3997304

Change-Id: Ifaf25030b8cc4f467cdc737e034e0215413acf38
Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2873866
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-05 05:59:25 -07:00
Laxman Dewangan
7f8cad749d gpu: nvgpu: Remove dummy Makefile of nvgpu
nvgpu is getting build from kernel/nvgpu and it is
not required to copy in nvidia-oot.

Remove the dummy makefile which was added as placeholder
for the nvgpu makefile.

Bug 4038415

Change-Id: I3fa6945a94c0f2233b55ec19d21ec4a92f715fde
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2882139
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-04 21:58:16 -07:00
Revanth Kumar Uppala
80336d6c96 nvethernet: Fix compilation warnings
1.There is a switch-case where one case is falling to the
next case. This is creating the compilation warning.
Make this fall through as intentional by adding
compiler attribute as "fallthrough".

2.Remove redefinition of macro MII_ADDR_C45

Bug 4055275

Change-Id: I99193b225e97c414588bb306cb48e472ae079f9f
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2882027
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 21:57:46 -07:00
Gerrit Code Review
e257be9884 Merge "tegra_gr_comm: Integrate drivers from kernel/nvidia" into dev-main 2023-04-04 21:57:24 -07:00
Mobile Promotions
f32cb60c46 Merge branch 'promotion_rebase' into promotion_build 2023-04-04 21:57:04 -07:00
Gerrit Code Review
197d2ed9eb Merge "host1x-nvhost: Integrate host1x-nvhost drivers from kernel/nvidia" into dev-main 2023-04-04 21:56:39 -07:00
Gerrit Code Review
730764c558 Merge "host1x: Integrate host1x drivers from kernel/nvidia to kernel/nvidia-oot" into dev-main 2023-04-04 21:56:33 -07:00
Laxman Dewangan
cf15a1f3df i2c: buses: nvvrs11: Copy driver from kernel/nvidia
Make the copy of drivers of i2c/busses/i2c-nvvrs11
from kernel/nvidia to kernel/nvidia-oot.
This will remove the dependency of the OOT drivers
with kernel/nvidia-oot repo.

Bug 4038415

Change-Id: I3353f2744915763c3e5f14164746fc540cd585dc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2881573
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 21:56:16 -07:00
Nagarjuna Kristam
0221df9441 PCI: edma: Fix Coverity Issues
Perform ULL typecast during total size calculation for numerics.

Bug 3956683

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: Id9671dc37ff8747a6390063cc92a038e355990cc
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2881281
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-04 21:54:45 -07:00
Mohan Thadikamalla
01d8319aae nvethernet: Add Linux safety support
Issue:
Observed compilation issues
on the nvethernet driver
for DRIVE Linux safety builds.

Fix:
Add OSI_STRIPPED_LIB support
on nvethernet driver.

Bug 3939603

Change-Id: Id4213c1cf33dc0e925df3e627072b727ae44fa71
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2842470
(cherry picked from commit ece0eb57a89396ea8bdc412beeaa7dfabbda49b1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2879701
Tested-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-04 21:49:37 -07:00
Akhilesh Reddy Khumbum
a2163680aa nvidia-oot: Add aon kmd module
- This patch includes AON-KMD module as part of OOT kernel.

Bug 3583580

Change-Id: I531731136189d76ebb4d3f2880e8f46913f390f4
Signed-off-by: Akhilesh Khumbum <akhumbum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2870990
Reviewed-by: Robert Collins <rcollins@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-04 21:43:50 -07:00
Manikanta Maddireddy
6afc085f93 PCI: Create a empty Makefile as a placeholder
Create a empty Makefile as a placeholder to copy priviate SoC PCIe driver.

Bug 4000789

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Change-Id: I38a900eacb8ada86b387e01bb4bfe7f40d08043b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2870780
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-04 21:43:45 -07:00
Laxman Dewangan
ad0c268451 tegra_gr_comm: Integrate drivers from kernel/nvidia
Create merge commit for drivers/video/tegra/virt
from kernel/nvidia to merge it to kernel/nvidia-oot

Merge remote-tracking branch
	'origin/dev/ldewangan/nvidia-tegra_gr_comm-dev-main'
   into
	nvidia-oot-tegra_gr_comm-dev-main

Change list:
f8a5eb357c video: tegra: virt: enable gr_comm for oot kernel
7c245300c1 kernel: nvidia: fix cert warnings
f0bd1b5b0d tegra: virt: fix sparse warnings in nvidia repo
f4be536103 virt: tegra_gr_comm: increase waittime to 40 secs
e681a55efe virt: tegra_gr_comm: increase waittime to 20 seconds
050dcfa2c2 tegra_gr_comm: retry if tegra_gr_comm_send timeout
c4f43e14fb virt: tegra_gr_comm: fix pointer type
a44c4d2b8b video: tegra: virt: remove virt_ctx from tegra_gr_comm
fac488e527 video: tegra: virt: add virt include file
ace7e8a747 virt: tegra_hv: remove parameter dn from tegra_hv_mempool_reserve()
2f962f6533 video: tegra: virt: remove virt_ctx from tegra_gr_comm
8577e84a36 video: tegra: increase wait_event_timout to 500ms
8a943374ec video: tegra: virt: Export functions used by nvgpu
e3c0ac7d5f video: tegra: virt: fix hung task warnings
e6a6b67af9 video: tegra: virt: fix typo
1311bd0746 video: tegra: virt: update comm framework
9c1e83f7b7 host1x virtualization: basic support
c06710a457 video: tegra: virt: support IVC reset protocol
e60a0ee388 video: tegra: virt: switch to IVC IRQ
daf7757c56 video: tegra: virt: fix crash in tegra_gr_comm_init
c8bd4b08b7 video: tegra: virt: add virtualization interfaces

Bug 4038415

Change-Id: I5277939d68094812ddc214c824f7da2fbf6158f8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-04-04 00:41:39 +00:00
Laxman Dewangan
7e72b625c0 nvidia-oot: remove nvgpu from building along with nvidia-oot modules
The nvgpu is lying in separate repository and it is required
to build directly from that repository instead of copying source
to nvidia-oot tree and then build.

Remove the list of files/directories to copy to nvdia-oot source
path.

Bug 4038415

Change-Id: I236440d0e94335bb642b415ca8ef275acff69067
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2880467
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 13:48:08 -07:00
Richard Zhao
7a0ea85184 video: tegra: virt: enable gr_comm for oot kernel
- enable config for oot
- add GPL license
- include different tegra hv header for oot

Jira GVSCI-16046

Change-Id: I8358b15cec33fbd5fd98265adc9152d8e335511d
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2866154
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Aparna Das <aparnad@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 17:41:13 +00:00
Manish Bhardwaj
4636d2781e kernel: nvidia: fix cert warnings
Using this patch we are fixing below cert warnings :-
1. cert_err33_c_violation: The error status of function
   call snprintf(name, 20UL, "ivc-queue%d", i) is not checked.
2. cert_err33_c_violation: The error status of function call
   snprintf(name, 30UL, "gr-virt-comm-%d", i) is not checked.
3. cert_err33_c_violation: The error status of function call
   snprintf(name, 20UL, "mempool%d", i) is not checked.

Below changes has been done to fix above cert warnings:-
1. check the return value to snprintf function and handle
   return error gracefully.

Bug 3512545

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: Ia41ab89e3759387b36489dca5f57652f7389f328
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2676650
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 17:41:13 +00:00
Manish Bhardwaj
15ef43911c tegra: virt: fix sparse warnings in nvidia repo
1. kernel/nvidia/drivers/video/tegra/virt/tegra_gr_comm.c:604:14:
   warning: incorrect type in assignment (different address spaces)
2. kernel/nvidia/drivers/virt/tegra/hvc_sysfs.c:154:17:
   warning: cast removes address space '__iomem' of expression
3. kernel/nvidia/drivers/virt/tegra/hvc_sysfs.c:189:17:
   warning: incorrect type in argument 1 (different address spaces)
4. kernel/nvidia/drivers/virt/tegra/ivc-cdev.c:330:27:
   warning: incorrect type in initializer (different base types)
5. kernel/nvidia/drivers/virt/tegra/tegra_hv.c:378:42:
    warning: incorrect type in argument 1 (different address spaces)
6. kernel/nvidia/drivers/virt/tegra/tegra_hv.c:386:26:
    warning: incorrect type in argument 1 (different address spaces)
7. kernel/nvidia/drivers/virt/tegra/tegra_hv.c:444:22:
    warning: cast removes address space '__iomem' of expression
8. kernel/nvidia/drivers/virt/tegra/tegra_hv.c:543:58:
    warning: incorrect type in assignment (different base types)
9. kernel/nvidia/drivers/virt/tegra/tegra_hv.c:544:62:
    warning: incorrect type in assignment (different base types)
10. kernel/nvidia/drivers/virt/tegra/tegra_hv.c:547:62:
    warning: incorrect type in assignment (different base types)
11. kernel/nvidia/drivers/virt/tegra/tegra_hv.c:823:10:
    warning: symbol 'tegra_hv_ivc_tx_frames_available' was not declared. Should it be static?
12. kernel/nvidia/drivers/virt/tegra/tegra_hv_pm_ctl.c:330:57:
    warning: incorrect type in initializer (different base types)
13. kernel/nvidia/drivers/virt/tegra/tegra_hv_pm_ctl.c:389:27:
    warning: incorrect type in initializer (different base types)

To fix above sparse warnings we are making below changes :-
1. use the __poll_t data type when we are using polling framework.
2. pass __iomem type pointer to io framework.

Bug 3528414
Jira ESLC-6572

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I371e0bdc435d60623bc1405a9383bf45b6274f90
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2673587
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 17:41:13 +00:00
Antony Clince Alex
d9d3a5e42c virt: tegra_gr_comm: increase waittime to 40 secs
At present, the timeouts are not handled gracefully and it results
in system crash, therefore increase the timetout to 40 as a WAR.

Bug 200775880

Change-Id: I6ea999d0ae59df5f2c995dd0669149e598bb6e9d
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2604011
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Haley Teng <hteng@nvidia.com>
Reviewed-by: Aparna Das <aparnad@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 17:41:13 +00:00
kdendukuri
33c3cfdf1f virt: tegra_gr_comm: increase waittime to 20 seconds
as we are receiving "tegra_gr_comm_recv: timeout for response!",
increase the waittime to 20 ticks as a WAR.

Bug 2983318

Change-Id: If4e26027e6aba737f6dc3f063eb699b2620f4e62
Signed-off-by: kdendukuri <kdendukuri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2346682
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-by: Haley Teng <hteng@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 17:41:13 +00:00
Haley Teng
85c3986920 tegra_gr_comm: retry if tegra_gr_comm_send timeout
Bug 2779333

Change-Id: I337ed034258d298f1c46673be6c2ca4006967e6b
Signed-off-by: Haley Teng <hteng@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2268246
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 17:41:13 +00:00
Ketan Patil
7fa087bc72 virt: tegra_gr_comm: fix pointer type
Change the type of ptr to void __iomem * from void *
as ioremap_cache expects the return type to be __iomem *
This fixes the following sparse warning:

tegra_gr_comm.c:243:34:
warning: incorrect type in assignment (different address spaces)

Bug 200434802

Change-Id: I296cc8048da649e84961239cb37bcd99ffe153a7
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1848879
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 17:41:13 +00:00
Richard Zhao
5fb49dd72a video: tegra: virt: remove virt_ctx from tegra_gr_comm
queue index can already index the queues. It also help make the api more
common.

Jira EVLR-2364

Change-Id: I5ba8f03bf8ae9cc8d1a51a6d5c48eef969276ed0
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646195
Reviewed-by: Damian Halas <dhalas@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 17:41:13 +00:00
Shridhar Rasal
e651d2e8dd video: tegra: virt: add virt include file
This copies virtualization interface include file in kernel-next

[b99549f] <Aingara Paramakuru> video: tegra: virt: update comm framework
[e0c27a2] <Aingara Paramakuru> video: tegra: virt: add virtualization interfaces

Change-Id: Ie51931ff2fd5c80d430591bba057d123d10c8b7b
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/1127824
(cherry picked from commit 39df7d7844fba18e69a317628235570d9b8ed4a5)
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1314848
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2023-04-03 17:41:13 +00:00
Richard Zhao
bc2c2bcde6 virt: tegra_hv: remove parameter dn from tegra_hv_mempool_reserve()
Device tree node was not used by the function, so remove it to make the
function more common.

Jira EVLR-2364

Change-Id: I0888773fa584eac2c2133c73d9385b700899fdf7
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1647029
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Dennis Kou <dkou@nvidia.com>
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 17:41:13 +00:00
Richard Zhao
94f2fb429f video: tegra: virt: remove virt_ctx from tegra_gr_comm
queue index can already index the queues. It also help make the api more
common.

Jira EVLR-2364

Change-Id: I5ba8f03bf8ae9cc8d1a51a6d5c48eef969276ed0
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646195
Reviewed-by: Damian Halas <dhalas@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 17:41:13 +00:00
Aniruddha Banerjee
98755f63ca video: tegra: increase wait_event_timout to 500ms
This patch increases the timeout for the wait_event from 250ms to 500ms.

Bug 1653184
Bug 1653182

Change-Id: I339f9d2eef20dcec8cd0a240900ab8af5c710c59
Signed-off-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-on: http://git-master/r/1462093
Reviewed-by: Nitin Sehgal <nsehgal@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Terje Bergstrom
a9442ce5b8 video: tegra: virt: Export functions used by nvgpu
Export functions used by nvgpu so that nvgpu could be built as a
module.

Change-Id: I7cf9162a17c3aaf736d20af8eb0ce623d168ff1d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1028350
Reviewed-on: http://git-master/r/1198258
Reviewed-on: http://git-master/r/1314837
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Richard Zhao
97c0fccbcc video: tegra: virt: fix hung task warnings
add timeout for tegra_gr_comm_recv and fix warnings:

INFO: task gk20a:1085 blocked for more than 120 seconds.
      Tainted: G        W      3.18.21-tegra #9
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
gk20a           D ffffffc000085df8     0  1085      2 0x00000000
Call trace:
[<ffffffc000085df8>] __switch_to+0x94/0xa8
[<ffffffc000a91994>] __schedule+0x2ac/0x7d0
[<ffffffc000a91edc>] schedule+0x24/0x74
[<ffffffc000a94940>] schedule_timeout+0x15c/0x258
[<ffffffc000a93ab0>] __down+0x60/0xa4
[<ffffffc0000e3ff0>] down+0x44/0x60
[<ffffffc0004073a4>] tegra_gr_comm_recv+0x5c/0x100
[<ffffffc0004c0d4c>] vgpu_intr_thread+0x5c/0x10c
[<ffffffc0000bf5fc>] kthread+0xf8/0x110

Bug 1728199

(cherry-picked from commit b9af225268aa6ee42d2bf41df8f6b63f55ddffd2)
Change-Id: Ia07f16a50b226824625131d03e8d677382215315
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1198256
Reviewed-on: http://git-master/r/1314836
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Bharat Nihalani
27d4ef0964 video: tegra: virt: fix typo
replace ioremap_cached to ioremap_cache. This should fix the build
break seen due to this symbol.

Change-Id: I574b568493f278aef2afb9c0704ae55b8c60affd
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/1198249
Reviewed-on: http://git-master/r/1314834
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Aingara Paramakuru
e33f9d13f4 video: tegra: virt: update comm framework
The following changes have been made:
- remove support for multiple IVC contexts per queue
- add support for mempools (OOB data support)

JIRA VFND-689

Change-Id: I3a1b8b3d204b579b3a5604858e62283df65b4cb3
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/1198248
Reviewed-on: http://git-master/r/1314833
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Peter Daifuku
413331cd4c host1x virtualization: basic support
- Adds a new host1x pushbuffer queue
- Includes support for virtualized VIC

Bug 1509609

(cherry-picked from commit 5589b0ffdaa4b31e7900d23e5d82d8430c710039)
Change-Id: Ie9b604dc8d8e43166dedb13953c4edac813da18b
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1198218
Reviewed-on: http://git-master/r/1314832
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Aingara Paramakuru
90d91c9462 video: tegra: virt: support IVC reset protocol
As part of the IVC reset protocol, IVC channels need
to be invalidated during init and the interrupt
handler should always handle IVC state changes first.

Bug 1597830

Change-Id: I58807f03c393c7ff0c1140e9180854e2c64c7e24
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/671866
Reviewed-on: http://git-master/r/1198217
Reviewed-on: http://git-master/r/1314831
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Aingara Paramakuru
983d45ff71 video: tegra: virt: switch to IVC IRQ
Handling IVC notifications using the callback method is
problematic when trying to handle the IVC reset protocol.
The comm framework now handles IVC IRQs locally.

Bug 1566409

Change-Id: I969500dd5599efb15a49ee44a79a7872ecc48e58
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/671865
Reviewed-on: http://git-master/r/1198216
Reviewed-on: http://git-master/r/1314830
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Aingara Paramakuru
0181342c83 video: tegra: virt: fix crash in tegra_gr_comm_init
The clean-up code did not iterate over the correct queue
elements, resulting in a kernel crash.

Change-Id: I48b3d901ad2cddca77a259c628aced65aa262069
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/592208
Reviewed-on: http://git-master/r/1198194
Reviewed-on: http://git-master/r/1314829
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Aingara Paramakuru
7328f57280 video: tegra: virt: add virtualization interfaces
Tegra graphics virtualization (host1x syncpoint and gpu) is now
exposed to client drivers (nvhost and nvgpu). These interfaces
rely on a communication framework to communicate with the server
driver that actually implements the back-end routines.

Bug 1509608

Change-Id: I5277f4b024953772a2215d33afa178162f5f9232
Reviewed-on: http://git-master/r/440120
Reviewed-on: http://git-master/r/1198193
Signed-off-by: Aniruddha Banerjee <aniruddhab@nvidia.com>
Reviewed-on: http://git-master/r/1314828
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
2023-04-03 17:41:13 +00:00
Laxman Dewangan
e50403cefe misc: mods: Integrate mods drivers from kernel/nvidia
Create merge commit for drivers/misc/mods
from kernel/nvidia to merge it to kernel/nvidia-oot

Merge remote-tracking branch 'origin/dev/ldewangan/nvidia-mods-dev-main' into nvidia-oot-mods-dev-main

Bug 4038415

Change-Id: I5fd8da6cd996b0fc2199aab17e9fecd200411e8b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-04-03 07:12:52 -07:00
Laxman Dewangan
631a3bcda2 host1x-nvhost: Integrate host1x-nvhost drivers from kernel/nvidia
Create merge commit for drivers/gpu/host1x-nvhost
from kernel/nvidia to merge it to kernel/nvidia-oot

Merge remote-tracking branch
  'origin/dev/ldewangan/nvidia-host1x-nvhost-dev-main'
  into nvidia-oot-host1x-nvhost-dev-main

Bug 4038415

Change-Id: If4433f8710cb112c3372abd2ebad45ea88a02b3e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-04-03 14:08:19 +00:00
Mikko Perttunen
10c73be4bf gpu: host1x-nvhost: Fix invalid NULL check
NULL check in is_valid_pt_ext was negated, making this function
useless. Fix the check.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I8764bcfceb457bf26ef79ebffdf17526d4174849
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2861958
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Arvind M
8942623b15 gpu: host1x-nvhost: avoid setting flcn irq at boot
[1] The DLA firmware configures the DEST and MASK registers during
    the initialization.
[2] In OOT, the DLA KMD is accidentally setting the interrupts. This
    will result in enabling additional interrupts that the firmware
    does not handle (like NVDLA_GENERIC_INTR_FAULT_CRITICAL).
[3] This commit fixes the issue by avoiding the interrupt settings
    at the DLA KMD.

Bug 3960841

Change-Id: Ied77ac7564ae3b3202b9cceaf08ad3c7da9f947c
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2861253
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Arvind M
bc86b17fa2 host1x: kmd: enable irq on poweron
[1] Since the irq is not enabled during the power-on, the firmware
    is not communicable state upon module reset.
[2] This commit fixes the issue by enabling irq on power-on.

Bug 3979666
Bug 3975703

Change-Id: I746a9236b390ab2d429df1f4a3f6243745147b65
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2858111
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Ayush Kumar <ayushk@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
2023-04-03 14:06:51 +00:00
Sanif Veeras
b394e81a9e video:tegra:host: add gpu specific syncpt pool
- Support allocation from the GPU specific syncpoint pool
  after reading from the Device Tree
- Expose an interface for the NvGPU driver to allocate
  the syncpoint from the GPU pool

Jira HOSTX-4515

Change-Id: Ie5cc9ec22c039b958b0c0a1750f959ebbf6c6bee
Signed-off-by: Sanif Veeras <sveeras@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2820453
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Mahesh Kumar
88028eda4b gpu: host1x-nvhost: Align syncpt interface APIs
The syncpt interface APIs in the host1x-nvhost driver slightly differ
from those in the legacy nvhost driver because instead of passing the
platform device structure for the host1x device, the platform device
structure for the host1x client device is passed.

By aligning the APIs so that we pass the platform device structure for
the host1x in all implementations, we can simplify the PVA driver and
directly use the APIs in the NVIDIA display driver.

The NVIDIA display driver requires some additional syncpt interface APIs
and so implement these as well.

Bug 3713048

Change-Id: I507e6fd066e6e22c0c47c20ba0dd3be5fa033c59
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2813827
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Jon Hunter
7d40c3953e gpu: host1x-nvhost: Fix mapping of syncpt shim
With Linux v6.1, if CONFIG_PCI_P2PDMA is enabled, then mapping the
syncpt shim causes a kernel paging request fault. The fault occurs when
dma_map_sg_attrs() is called in by nvhost_syncpt_unit_interface_init(),
which is attempting to map the syncpt shim MMIO space.

The function dma_map_sg_attrs() calls iomm_dma_map_sg() and since
upstream Linux commit 30280eee2db1 ("iommu/dma: support PCI P2PDMA pages
in dma-iommu map_sg") was added this now calls is_pci_p2pdma_page(). The
function is_pci_p2pdma_page() requires that there is a 'struct page'
associated with the sg, but this is not the case and so deferencing the
'struct page' pointer returned by sg_page() results in a paging fault.

Using dma_map_sg_attrs() to map MMIO that is not associated with valid
page structures is not guaranteed to work. Therefore, fix this by using
dma_map_resource() to map the syncpt shim instead.

Bug 3871422

Change-Id: I2b08a3b78be0850bff44e62bfc93c8d095eb82a2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2818417
(cherry picked from commit 97f1282f2959c208effebf93cc5061d6e7fa6c55)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2819086
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Jon Hunter
6cd2f00c46 nvhost: Add clean up function for syncpt interface
Drivers, such as the PVA and DLA driver, that call
nvhost_syncpt_unit_interface_init() during probe are missing a call to
clean-up the DMA mappings this function may create if the driver probe
fails or if the driver is removed. The function
nvhost_syncpt_unit_interface_init() may make a call to
dma_map_sg_attrs() and we need to ensure that dma_unmap_sg_attrs() is
called if the probe of the driver fails or if the driver is unloaded.
Add a new function, nvhost_syncpt_unit_interface_deinit(), that calls
dma_unmap_sg_attrs() if needed for drivers to call.

Bug 3800349

Change-Id: I62a4e19cd42878dac54fa623509440596ffdf17f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2801280
(cherry picked from commit cee12fb989186611aa9deb5ada45831ab5f783aa)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2801934
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Mikko Perttunen
968b6f758f gpu: host1x-nvhost: Adapt for change in host1x_fence_create
Add 'true' parameter to enable internal timeout since there is no
external cancellation mechanism.

Also change kfree to kfree_rcu to ensure workqueue is not freed
during callback.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: Ib0ef9a211bafbdd911dc90175a18680880e3e2f8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2786638
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Jon Hunter
9d0dda14ae gpu: host1x-nvhost: Update include path
When building the host1x-nvhost driver as an external module, the driver
source is now copied into a common location with all the other external
modules. Therefore, we can now use the 'srctree.nvidia' path for finding
the necessary header files for Host1x. Update the include search paths
to use 'srctree.nvidia' when building the driver.

Bug 3817518

Change-Id: I443dd4cb6d01c4e9be8f3c02550b1050d0bcfd28
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2785956
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Jon Hunter
2e94a90e1d gpu: host1x-nvhost: Update syncpt helper functions
- add get aperture API
- add get syncpt offset api

Bug 3768126

Change-Id: I95ae6a149e8a362317f4f1c89e7a1eac3c596fe4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2782259
Tested-by: Omar Nemri <onemri@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Jon Hunter
b5c5a485da gpu: host1x-nvhost: Add support for Tegra234
Add support for Tegra234 in the host1x-nvhost driver.

Bug 3724727

Change-Id: I3e42d066ce22a461d71f26c120f08aed96f30430
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759200
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2023-04-03 14:06:51 +00:00
Nan Wang
96d0bbd387 pva: support both upstream and downstream kernel
1. Replace nvhost print functions with PVA driver's private
implementation with similar functionalities.

2. Change syncpoint from host managed to client managed so that
syncpoint max value is tracked inside PVA driver. This change is needed
because upstream host1x driver doesn't allow decrement of max value.

3. Various minor changes for adapting to upstream kernel APIs.

Bug 3662478

Change-Id: I16eff6c06c51afe0f274598e1273404924d18684
Signed-off-by: Nan Wang <nanwa@nvidia.com>
Signed-off-by: Abhinaya Agrawal <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2710684
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 14:06:51 +00:00
Abhinaya Agrawal
c87eb8b8d9 drivers: Fix host1x and nvhost debugfs cleanup
Both host1x and nvhost expose APIs that deinitialize the debugfs
and remove debugfs files/directories that were created. At present,
debugfs_remove() is inovked to do this. However,
debugfs_remove_recursive() should instead be used to ensure that
all files within a debugfs are recursively removed before the
directory is removed.

Bug 3662478

Change-Id: Idb7d1458c02f57f6d656a7bfe1df3adf5e0497aa
Signed-off-by: Abhinaya Agrawal <abhinayaa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2714042
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 14:06:51 +00:00