<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nvidia-tegra-modules.git, branch rtss22-ae</title>
<subtitle>NVIDIA's kernel modules to support tegra chips (used in Jetson boards)</subtitle>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/'/>
<entry>
<title>gpu-paging: Functions to support initial working version</title>
<updated>2022-05-25T01:16:30+00:00</updated>
<author>
<name>Joshua Bakita</name>
<email>jbakita@cs.unc.edu</email>
</author>
<published>2022-05-25T01:16:30+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=2c076a01e5bd0949032ef81cd0e2d37bdecafba5'/>
<id>2c076a01e5bd0949032ef81cd0e2d37bdecafba5</id>
<content type='text'>
- Buffer deallocation (+IOCTL)
- Buffer reallocation
- Private dmabuf user list and accessor
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Buffer deallocation (+IOCTL)
- Buffer reallocation
- Private dmabuf user list and accessor
</pre>
</div>
</content>
</entry>
<entry>
<title>platform: tegra: mc: add option to disable L3 alloc hint from mss nvlink</title>
<updated>2022-02-02T20:10:57+00:00</updated>
<author>
<name>Brad Griffis</name>
<email>bgriffis@nvidia.com</email>
</author>
<published>2022-02-01T00:29:03+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=70c252977fc080c829b195fece6f46f73586f1e4'/>
<id>70c252977fc080c829b195fece6f46f73586f1e4</id>
<content type='text'>
Accessing memory beyond 64GB boundary from GPU on Xavier needs L3 cache
alloc hint disabled at mss nvlink.

Bug 3486025

Change-Id: Iac3a8932a6877b371df15d3e0d8dc9ebe1e48bdd
Signed-off-by: Brad Griffis &lt;bgriffis@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2662169
Reviewed-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Accessing memory beyond 64GB boundary from GPU on Xavier needs L3 cache
alloc hint disabled at mss nvlink.

Bug 3486025

Change-Id: Iac3a8932a6877b371df15d3e0d8dc9ebe1e48bdd
Signed-off-by: Brad Griffis &lt;bgriffis@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2662169
Reviewed-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>tegra: cache: fix dcache flush retry</title>
<updated>2022-02-02T14:24:20+00:00</updated>
<author>
<name>ADIGUPTA</name>
<email>adigupta@nvidia.com</email>
</author>
<published>2021-10-25T09:37:23+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=61b6f004d9893c90a4d61fe35878948844cfe9e3'/>
<id>61b6f004d9893c90a4d61fe35878948844cfe9e3</id>
<content type='text'>
Presently we have number of retries as 10 to flush cache,
each flush operation takes around 95-100 us

Increased number of retries to 20, and
enabled debug version of flush code which
profiles latency, executing the flush instruction.

Bug 200782744

Change-Id: Ie32c17bacdb9d091e9e21a8384727a6479d83b47
Signed-off-by: Aditya Gupta &lt;adigupta@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2648815
Reviewed-by: svcacv &lt;svcacv@nvidia.com&gt;
Reviewed-by: Rohit Upadhyay &lt;rupadhyay@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Presently we have number of retries as 10 to flush cache,
each flush operation takes around 95-100 us

Increased number of retries to 20, and
enabled debug version of flush code which
profiles latency, executing the flush instruction.

Bug 200782744

Change-Id: Ie32c17bacdb9d091e9e21a8384727a6479d83b47
Signed-off-by: Aditya Gupta &lt;adigupta@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2648815
Reviewed-by: svcacv &lt;svcacv@nvidia.com&gt;
Reviewed-by: Rohit Upadhyay &lt;rupadhyay@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>nvadsp: Add more error logs and fix crash</title>
<updated>2022-01-24T16:40:08+00:00</updated>
<author>
<name>Uday Gupta</name>
<email>udayg@nvidia.com</email>
</author>
<published>2021-09-12T11:15:19+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=0b4dd54af468cc6a74f042c6ea93a2f4c9864a4e'/>
<id>0b4dd54af468cc6a74f042c6ea93a2f4c9864a4e</id>
<content type='text'>
- Change adds more error logs in case of APP init failure.
- Also potentially fixes the crash issue

Bug 3374437
Bug 3498407

Change-Id: If6baf6e2e11250815cff4a6b8a2abe553e893e34
Signed-off-by: Uday Gupta &lt;udayg@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2593021
(cherry picked from commit b051fae2faffafbffed99b94914bbd9bc370240f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2658565
Reviewed-by: Dipesh Gandhi &lt;dipeshg@nvidia.com&gt;
Reviewed-by: Phoenix Jung &lt;pjung@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Change adds more error logs in case of APP init failure.
- Also potentially fixes the crash issue

Bug 3374437
Bug 3498407

Change-Id: If6baf6e2e11250815cff4a6b8a2abe553e893e34
Signed-off-by: Uday Gupta &lt;udayg@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2593021
(cherry picked from commit b051fae2faffafbffed99b94914bbd9bc370240f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2658565
Reviewed-by: Dipesh Gandhi &lt;dipeshg@nvidia.com&gt;
Reviewed-by: Phoenix Jung &lt;pjung@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>ufs: Changes to support provision for UFS3.1 and UFS2.1</title>
<updated>2022-01-18T13:55:46+00:00</updated>
<author>
<name>Mallikarjun Kasoju</name>
<email>mkasoju@nvidia.com</email>
</author>
<published>2021-08-20T11:25:46+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=9ef60619cfb8d195715b798ac112cdd3d108da38'/>
<id>9ef60619cfb8d195715b798ac112cdd3d108da38</id>
<content type='text'>
Get the device UFS spec and populate the descriptor offsets as per
the respective specs.

Bug 200765373

Change-Id: Id9a0d90d1aaf465cc6e581f7155b98cc5bcf0182
Signed-off-by: Mallikarjun Kasoju &lt;mkasoju@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2645541
Tested-by: Prakhar Gupta &lt;prakharg@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: Vikram Kanigiri &lt;vkanigiri@nvidia.com&gt;
Reviewed-by: Rohit Upadhyay &lt;rupadhyay@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Get the device UFS spec and populate the descriptor offsets as per
the respective specs.

Bug 200765373

Change-Id: Id9a0d90d1aaf465cc6e581f7155b98cc5bcf0182
Signed-off-by: Mallikarjun Kasoju &lt;mkasoju@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2645541
Tested-by: Prakhar Gupta &lt;prakharg@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: Vikram Kanigiri &lt;vkanigiri@nvidia.com&gt;
Reviewed-by: Rohit Upadhyay &lt;rupadhyay@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>driver:imx185:Add info message for expected i2c error.</title>
<updated>2022-01-18T08:24:34+00:00</updated>
<author>
<name>Praveen AC</name>
<email>pac@nvidia.com</email>
</author>
<published>2022-01-13T07:05:48+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=e76829b9c05e2dd0708d4074eeb9276b9f632ba2'/>
<id>e76829b9c05e2dd0708d4074eeb9276b9f632ba2</id>
<content type='text'>
Sensor not return ACK when SW_RESET is transferred.

bug 200741759

Change-Id: I77639f84bcda653ba2d3adfd68727725a0c00e1f
Signed-off-by: Praveen AC &lt;pac@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653996
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: Anubhav Rai &lt;arai@nvidia.com&gt;
Reviewed-by: Shubham Chandra &lt;shubhamc@nvidia.com&gt;
Reviewed-by: Ajith Kumar &lt;ajithk@nvidia.com&gt;
Reviewed-by: Sudhir Vyas &lt;svyas@nvidia.com&gt;
Reviewed-by: Frank Chen &lt;frankc@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sensor not return ACK when SW_RESET is transferred.

bug 200741759

Change-Id: I77639f84bcda653ba2d3adfd68727725a0c00e1f
Signed-off-by: Praveen AC &lt;pac@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653996
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: Anubhav Rai &lt;arai@nvidia.com&gt;
Reviewed-by: Shubham Chandra &lt;shubhamc@nvidia.com&gt;
Reviewed-by: Ajith Kumar &lt;ajithk@nvidia.com&gt;
Reviewed-by: Sudhir Vyas &lt;svyas@nvidia.com&gt;
Reviewed-by: Frank Chen &lt;frankc@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: Fix race between write and free</title>
<updated>2022-01-11T11:39:22+00:00</updated>
<author>
<name>Ashish Mhetre</name>
<email>amhetre@nvidia.com</email>
</author>
<published>2022-01-10T11:31:01+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=06d8f135d0ec9d291ffb8a3049308a853edb4000'/>
<id>06d8f135d0ec9d291ffb8a3049308a853edb4000</id>
<content type='text'>
When NvRmMemWrite() and NvRmMemFree() are called simultaneously on same
handle then it could lead to race where dmabuf freed from NvRmMemFree()
call could get used by nvmap_get_cachebility() and cause kernel crash.
When dmabuf is freed, its exported functions such as get_drvdata() won't
be valid anymore and will give error value or NULL.
Fix this by checking if get_drvdata() returns error value or NULL and act
accordingly.

Bug 3457360

Change-Id: Ibcd238bfde8775347a9f8c6266ed3ab3825d945d
Signed-off-by: Ashish Mhetre &lt;amhetre@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2651952
Reviewed-by: Ketan Patil &lt;ketanp@nvidia.com&gt;
Reviewed-by: Puneet Saxena &lt;puneets@nvidia.com&gt;
Reviewed-by: Sachin Nikam &lt;snikam@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When NvRmMemWrite() and NvRmMemFree() are called simultaneously on same
handle then it could lead to race where dmabuf freed from NvRmMemFree()
call could get used by nvmap_get_cachebility() and cause kernel crash.
When dmabuf is freed, its exported functions such as get_drvdata() won't
be valid anymore and will give error value or NULL.
Fix this by checking if get_drvdata() returns error value or NULL and act
accordingly.

Bug 3457360

Change-Id: Ibcd238bfde8775347a9f8c6266ed3ab3825d945d
Signed-off-by: Ashish Mhetre &lt;amhetre@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2651952
Reviewed-by: Ketan Patil &lt;ketanp@nvidia.com&gt;
Reviewed-by: Puneet Saxena &lt;puneets@nvidia.com&gt;
Reviewed-by: Sachin Nikam &lt;snikam@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>driver: imx219: Fix for i2c error write mode</title>
<updated>2022-01-10T21:10:00+00:00</updated>
<author>
<name>Praveen AC</name>
<email>pac@nvidia.com</email>
</author>
<published>2022-01-04T22:56:24+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=565de56422d5dee321d1ad81ac053f9991654653'/>
<id>565de56422d5dee321d1ad81ac053f9991654653</id>
<content type='text'>
Add enough time delay after sensor soft reset
to avoid i2c error write mode.

bug 200768012

Change-Id: Iacabee71957168f4eec15da45194d52bd1464fbf
Signed-off-by: Praveen AC &lt;pac@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2649706
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: svcacv &lt;svcacv@nvidia.com&gt;
Reviewed-by: Nithin Varghese &lt;nvarghese@nvidia.com&gt;
Reviewed-by: Anubhav Rai &lt;arai@nvidia.com&gt;
Reviewed-by: Shubham Chandra &lt;shubhamc@nvidia.com&gt;
Reviewed-by: Sudhir Vyas &lt;svyas@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add enough time delay after sensor soft reset
to avoid i2c error write mode.

bug 200768012

Change-Id: Iacabee71957168f4eec15da45194d52bd1464fbf
Signed-off-by: Praveen AC &lt;pac@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2649706
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: svcacv &lt;svcacv@nvidia.com&gt;
Reviewed-by: Nithin Varghese &lt;nvarghese@nvidia.com&gt;
Reviewed-by: Anubhav Rai &lt;arai@nvidia.com&gt;
Reviewed-by: Shubham Chandra &lt;shubhamc@nvidia.com&gt;
Reviewed-by: Sudhir Vyas &lt;svyas@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>media: tegra: camera: vi2: refactor low-latency mode code</title>
<updated>2022-01-07T14:10:42+00:00</updated>
<author>
<name>Ken Chang</name>
<email>kenc@nvidia.com</email>
</author>
<published>2021-12-13T05:04:12+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=643a51e0eb2b3eb2c3cecc6777e20ff040e2483b'/>
<id>643a51e0eb2b3eb2c3cecc6777e20ff040e2483b</id>
<content type='text'>
A frame capture may fail somewhere between the frame start and the frame
end,e.g., the below error prints:

2021-11-04T10:11:31.561+00:00 kernel: [  794.777229] tc358840 1-001f: event: resolution change (EQ_BYPS=1): 3840x2160p29.94 (4400x2250)
2021-11-04T10:11:32.167+00:00 kernel: [  795.379917] video4linux video0: TEGRA_VI_CSI_ERROR_STATUS 0x00000000
2021-11-04T10:11:32.167+00:00 kernel: [  795.386292] video4linux video0: TEGRA_VI_CSI_ERROR_STATUS 0x00000000
2021-11-04T10:11:32.191+00:00 kernel: [  795.404274] vi 54080000.vi: tegra_channel_error_status:error 20022 frame 0

This means checking SOF in the capture thread doesn't help avoid a failure
in the release thread. Hence we can simplify the capture thread to program only
the capture released settings, skip the checking of SOF and leave the checking
of vi/csi status and the recovery process to be done in the release thread.

Also simplify vi2_channel_stop_streaming() to not invoke tegra_channel_capture_done()
as the buffers shall be well handled in tegra_channel_queued_buf_done() with
VB2_BUF_STATE_ERROR state.

In the original implementation, chan-&gt;syncpt[index][] will be re-allocated for
every single stop_streaming()/start_streaming() pair, so the syncpt IDs may
change. This is causing the problem: the syncpt IDs armed for the previous
failing capture are still queued in the FIFO and will be used for the next
successfull frame capture, however new syncpt IDs are allocated for the new
coming frames, e.g, the below error prints:

2021-11-23T08:12:59.038+00:00 kernel: [  590.029312] tegra_channel_capture_frame_multi_thread[570]: rv 4, cv 3, stm Y
2021-11-23T08:12:59.038+00:00 kernel: [  590.036865] tegra_channel_enable_stream[212] -- begin
2021-11-23T08:12:59.044+00:00 kernel: [  590.042437] tegra_channel_enable_stream[221] -- end
2021-11-23T08:12:59.263+00:00 kernel: [  590.251676] video4linux video0: frame start syncpt timeout!0
2021-11-23T08:12:59.263+00:00 kernel: [  590.257419] tegra_channel_ec_recover[337] -- begin

2021-12-03T11:14:36.763+00:00 kernel: [ 1049.109289] vi2_channel_start_streaming[912] -- begin
2021-12-03T11:14:36.763+00:00 kernel: [ 1049.115121] vi2_channel_start_streaming[949]: syncpt id 24, max 5064, min 5064
2021-12-03T11:14:36.771+00:00 kernel: [ 1049.123116] vi2_channel_start_streaming[949]: syncpt id 28, max 1614, min 1614
--&gt; the syncpt id being used for this streaming are 24/28, these two syncpts are used since the first streaming
...
2021-12-03T11:14:39.244+00:00 kernel: [ 1051.597885] tegra_channel_capture_frame_multi_thread[624] -- end: release_thresh 5101
2021-12-03T11:14:39.303+00:00 kernel: [ 1051.663550] tegra_channel_release_frame[701] -- end: buf-&gt;thresh 5101
2021-12-03T11:14:39.350+00:00 kernel: [ 1051.703617] vi2_channel_stop_streaming[1065] -- end
--&gt; no problem observed, and capture cancelled due to stop_streaming
...
2021-12-03T11:15:09.524+00:00 kernel: [ 1081.871259] vi2_channel_start_streaming[912] -- begin
2021-12-03T11:15:09.524+00:00 kernel: [ 1081.876860] vi2_channel_start_streaming[949]: syncpt id 36, max 0, min 0
2021-12-03T11:15:09.524+00:00 kernel: [ 1081.884187] vi2_channel_start_streaming[949]: syncpt id 38, max 0, min 0
--&gt; the syncpt id being used now are changed to 36/38
...
2021-12-03T11:15:09.534+00:00 kernel: [ 1081.891728] tegra_channel_capture_frame_multi_thread[514] -- begin
2021-12-03T11:15:09.534+00:00 kernel: [ 1081.891771] vi2_channel_start_streaming[992] -- end
2021-12-03T11:15:09.552+00:00 kernel: [ 1081.904384] tegra_channel_capture_frame_multi_thread[569]: rv 119, cv 119, stm N
2021-12-03T11:15:09.606+00:00 kernel: [ 1081.958030] tegra_channel_capture_frame_multi_thread[624] -- end: release_thresh 1
2021-12-03T11:15:09.606+00:00 kernel: [ 1081.958086] tegra_channel_release_frame[669] -- begin
2021-12-03T11:15:09.817+00:00 kernel: [ 1082.162133] video4linux video0: tegra_channel_release_frame: MW_ACK_DONE syncpoint time out!0
2021-12-03T11:15:09.817+00:00 kernel: [ 1082.170683] tegra_channel_release_frame[680]: buf-&gt;thresh[0] 1
2021-12-03T11:15:09.817+00:00 kernel: [ 1082.176972] tegra_channel_release_frame[683]: syncpt 36, hw val 0
2021-12-03T11:15:09.829+00:00 kernel: [ 1082.183715] tegra_channel_ec_recover[337] -- begin

Given Hw doesn't support SYNCPT FIFO reset per stream, reuse the same syncpt IDs
until the channel is powered off.

Also skip invoking tegra_channel_capture_done() from vi2_channel_stop_streaming()
and tegra_channel_release_frame() from tegra_channel_stop_kthreads() as streaming
shall be stoped immediately and the queued buffers shall be well handled in
tegra_channel_queued_buf_done() with the VB2_BUF_STATE_ERROR state.

Bug 3423623

Change-Id: I53280bc9b1b3c33054d766aa920eb082b3311d92
Signed-off-by: Ken Chang &lt;kenc@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2645502
Reviewed-by: Frank Chen &lt;frankc@nvidia.com&gt;
Reviewed-by: Jerry Chang &lt;jerchang@nvidia.com&gt;
Reviewed-by: Anubhav Rai &lt;arai@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A frame capture may fail somewhere between the frame start and the frame
end,e.g., the below error prints:

2021-11-04T10:11:31.561+00:00 kernel: [  794.777229] tc358840 1-001f: event: resolution change (EQ_BYPS=1): 3840x2160p29.94 (4400x2250)
2021-11-04T10:11:32.167+00:00 kernel: [  795.379917] video4linux video0: TEGRA_VI_CSI_ERROR_STATUS 0x00000000
2021-11-04T10:11:32.167+00:00 kernel: [  795.386292] video4linux video0: TEGRA_VI_CSI_ERROR_STATUS 0x00000000
2021-11-04T10:11:32.191+00:00 kernel: [  795.404274] vi 54080000.vi: tegra_channel_error_status:error 20022 frame 0

This means checking SOF in the capture thread doesn't help avoid a failure
in the release thread. Hence we can simplify the capture thread to program only
the capture released settings, skip the checking of SOF and leave the checking
of vi/csi status and the recovery process to be done in the release thread.

Also simplify vi2_channel_stop_streaming() to not invoke tegra_channel_capture_done()
as the buffers shall be well handled in tegra_channel_queued_buf_done() with
VB2_BUF_STATE_ERROR state.

In the original implementation, chan-&gt;syncpt[index][] will be re-allocated for
every single stop_streaming()/start_streaming() pair, so the syncpt IDs may
change. This is causing the problem: the syncpt IDs armed for the previous
failing capture are still queued in the FIFO and will be used for the next
successfull frame capture, however new syncpt IDs are allocated for the new
coming frames, e.g, the below error prints:

2021-11-23T08:12:59.038+00:00 kernel: [  590.029312] tegra_channel_capture_frame_multi_thread[570]: rv 4, cv 3, stm Y
2021-11-23T08:12:59.038+00:00 kernel: [  590.036865] tegra_channel_enable_stream[212] -- begin
2021-11-23T08:12:59.044+00:00 kernel: [  590.042437] tegra_channel_enable_stream[221] -- end
2021-11-23T08:12:59.263+00:00 kernel: [  590.251676] video4linux video0: frame start syncpt timeout!0
2021-11-23T08:12:59.263+00:00 kernel: [  590.257419] tegra_channel_ec_recover[337] -- begin

2021-12-03T11:14:36.763+00:00 kernel: [ 1049.109289] vi2_channel_start_streaming[912] -- begin
2021-12-03T11:14:36.763+00:00 kernel: [ 1049.115121] vi2_channel_start_streaming[949]: syncpt id 24, max 5064, min 5064
2021-12-03T11:14:36.771+00:00 kernel: [ 1049.123116] vi2_channel_start_streaming[949]: syncpt id 28, max 1614, min 1614
--&gt; the syncpt id being used for this streaming are 24/28, these two syncpts are used since the first streaming
...
2021-12-03T11:14:39.244+00:00 kernel: [ 1051.597885] tegra_channel_capture_frame_multi_thread[624] -- end: release_thresh 5101
2021-12-03T11:14:39.303+00:00 kernel: [ 1051.663550] tegra_channel_release_frame[701] -- end: buf-&gt;thresh 5101
2021-12-03T11:14:39.350+00:00 kernel: [ 1051.703617] vi2_channel_stop_streaming[1065] -- end
--&gt; no problem observed, and capture cancelled due to stop_streaming
...
2021-12-03T11:15:09.524+00:00 kernel: [ 1081.871259] vi2_channel_start_streaming[912] -- begin
2021-12-03T11:15:09.524+00:00 kernel: [ 1081.876860] vi2_channel_start_streaming[949]: syncpt id 36, max 0, min 0
2021-12-03T11:15:09.524+00:00 kernel: [ 1081.884187] vi2_channel_start_streaming[949]: syncpt id 38, max 0, min 0
--&gt; the syncpt id being used now are changed to 36/38
...
2021-12-03T11:15:09.534+00:00 kernel: [ 1081.891728] tegra_channel_capture_frame_multi_thread[514] -- begin
2021-12-03T11:15:09.534+00:00 kernel: [ 1081.891771] vi2_channel_start_streaming[992] -- end
2021-12-03T11:15:09.552+00:00 kernel: [ 1081.904384] tegra_channel_capture_frame_multi_thread[569]: rv 119, cv 119, stm N
2021-12-03T11:15:09.606+00:00 kernel: [ 1081.958030] tegra_channel_capture_frame_multi_thread[624] -- end: release_thresh 1
2021-12-03T11:15:09.606+00:00 kernel: [ 1081.958086] tegra_channel_release_frame[669] -- begin
2021-12-03T11:15:09.817+00:00 kernel: [ 1082.162133] video4linux video0: tegra_channel_release_frame: MW_ACK_DONE syncpoint time out!0
2021-12-03T11:15:09.817+00:00 kernel: [ 1082.170683] tegra_channel_release_frame[680]: buf-&gt;thresh[0] 1
2021-12-03T11:15:09.817+00:00 kernel: [ 1082.176972] tegra_channel_release_frame[683]: syncpt 36, hw val 0
2021-12-03T11:15:09.829+00:00 kernel: [ 1082.183715] tegra_channel_ec_recover[337] -- begin

Given Hw doesn't support SYNCPT FIFO reset per stream, reuse the same syncpt IDs
until the channel is powered off.

Also skip invoking tegra_channel_capture_done() from vi2_channel_stop_streaming()
and tegra_channel_release_frame() from tegra_channel_stop_kthreads() as streaming
shall be stoped immediately and the queued buffers shall be well handled in
tegra_channel_queued_buf_done() with the VB2_BUF_STATE_ERROR state.

Bug 3423623

Change-Id: I53280bc9b1b3c33054d766aa920eb082b3311d92
Signed-off-by: Ken Chang &lt;kenc@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2645502
Reviewed-by: Frank Chen &lt;frankc@nvidia.com&gt;
Reviewed-by: Jerry Chang &lt;jerchang@nvidia.com&gt;
Reviewed-by: Anubhav Rai &lt;arai@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>tegra: hdcp: update policy init value</title>
<updated>2022-01-07T14:10:37+00:00</updated>
<author>
<name>Ahung Cheng</name>
<email>ahcheng@nvidia.com</email>
</author>
<published>2021-11-26T11:17:13+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=aead036da110062df01a7a4f92592e95f3970a18'/>
<id>aead036da110062df01a7a4f92592e95f3970a18</id>
<content type='text'>
Update hdcp policy init value based on availability of HDCP TA for L4T

Bug 3167119

Change-Id: I81e4f02b20214fb23c94756804448fa0ae80246b
Signed-off-by: Ahung Cheng &lt;ahcheng@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2632879
Reviewed-by: Ilhan Gurel &lt;igurel@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update hdcp policy init value based on availability of HDCP TA for L4T

Bug 3167119

Change-Id: I81e4f02b20214fb23c94756804448fa0ae80246b
Signed-off-by: Ahung Cheng &lt;ahcheng@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2632879
Reviewed-by: Ilhan Gurel &lt;igurel@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
</feed>
