<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/misc/habanalabs/common/command_submission.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/misc/habanalabs/common/command_submission.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/misc/habanalabs/common/command_submission.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-05-22T19:01:21Z</updated>
<entry>
<title>habanalabs: use separate structure info for each error collect data</title>
<updated>2022-05-22T19:01:21Z</updated>
<author>
<name>Tal Cohen</name>
<email>talcohen@habana.ai</email>
</author>
<published>2022-05-11T13:50:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=90de6805267f8c79cd2b1a36805071e257c39b5c'/>
<id>urn:sha1:90de6805267f8c79cd2b1a36805071e257c39b5c</id>
<content type='text'>
Create separate info structure for each error type.
The structures shall be used inside the large structure that contains
the last session error.
This is more scalable for adding more errors in the future.

Signed-off-by: Tal Cohen &lt;talcohen@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: remove hdev from hl_ctx_get args</title>
<updated>2022-05-22T19:01:21Z</updated>
<author>
<name>Ohad Sharabi</name>
<email>osharabi@habana.ai</email>
</author>
<published>2022-05-11T10:28:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e31dd9362f01682192d80221cc4339e4f7140f30'/>
<id>urn:sha1:e31dd9362f01682192d80221cc4339e4f7140f30</id>
<content type='text'>
This argument is unused by the function.

Signed-off-by: Ohad Sharabi &lt;osharabi@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: use unified memory manager for CB flow</title>
<updated>2022-05-22T19:01:19Z</updated>
<author>
<name>Yuri Nudelman</name>
<email>ynudelman@habana.ai</email>
</author>
<published>2022-03-29T11:16:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=829ec038c967d04032d6922b34abff0713660638'/>
<id>urn:sha1:829ec038c967d04032d6922b34abff0713660638</id>
<content type='text'>
With the new code required for the flow added, we can now switch
to using the new memory manager infrastructure, removing the old code.

Signed-off-by: Yuri Nudelman &lt;ynudelman@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: hide memory manager page shift</title>
<updated>2022-05-22T19:01:19Z</updated>
<author>
<name>Yuri Nudelman</name>
<email>ynudelman@habana.ai</email>
</author>
<published>2022-03-23T13:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4e63ce6af63f3db7f922e3c564f23ac606218a3d'/>
<id>urn:sha1:4e63ce6af63f3db7f922e3c564f23ac606218a3d</id>
<content type='text'>
The new unified memory manager uses page offset to pass buffer handle
during the mmap operation. One problem with this approach is that it
requires the handle to always be divisible by the page size, else, the
user would not be able to pass it correctly as an argument to the mmap
system call.

Previously, this was achieved by shifting the handle left after alloc
operation, and shifting it right before get operation. This was done in
the user code. This creates code duplication, and, what's worse,
requires some knowledge from the user regarding the handle internal
structure, hurting the encapsulation.

This patch encloses all the page shifts inside memory manager functions.
This way, the user can take the handle as a black box, and simply use
it, without any concert about how it actually works.

Signed-off-by: Yuri Nudelman &lt;ynudelman@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: fix comments according to kernel-doc</title>
<updated>2022-05-22T19:01:17Z</updated>
<author>
<name>Rajaravi Krishna Katta</name>
<email>rkatta@habana.ai</email>
</author>
<published>2022-04-01T11:06:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b31848430f49d070c2dd07fbcd719930c35fe1ec'/>
<id>urn:sha1:b31848430f49d070c2dd07fbcd719930c35fe1ec</id>
<content type='text'>
Incorrect/Missing doxygen tag

Signed-off-by: Rajaravi Krishna Katta &lt;rkatta@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: convert ts to use unified memory manager</title>
<updated>2022-05-22T18:57:36Z</updated>
<author>
<name>Yuri Nudelman</name>
<email>ynudelman@habana.ai</email>
</author>
<published>2022-03-20T14:15:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4d530e7d121a2b4fc703c4c2145ae761140bc18f'/>
<id>urn:sha1:4d530e7d121a2b4fc703c4c2145ae761140bc18f</id>
<content type='text'>
With the introduction of the unified memory manager infrastructure, the
timestamp buffers can be converted to use it.

Signed-off-by: Yuri Nudelman &lt;ynudelman@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: replace usage of found with dedicated list iterator variable</title>
<updated>2022-05-22T18:57:35Z</updated>
<author>
<name>Jakob Koschel</name>
<email>jakobkoschel@gmail.com</email>
</author>
<published>2022-03-24T07:10:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9138c24244a71bf90cd36123247b768e83433347'/>
<id>urn:sha1:9138c24244a71bf90cd36123247b768e83433347</id>
<content type='text'>
To move the list iterator variable into the list_for_each_entry_*()
macro in the future it should be avoided to use the list iterator
variable after the loop body.

To *never* use the list iterator variable after the loop it was
concluded to use a separate iterator variable instead of a
found boolean [1].

This removes the need to use a found variable and simply checking if
the variable was set, can determine if the break/goto was hit.

Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/
Signed-off-by: Jakob Koschel &lt;jakobkoschel@gmail.com&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: Fix reset upon device release bug</title>
<updated>2022-02-28T12:22:06Z</updated>
<author>
<name>farah kassabri</name>
<email>fkassabri@habana.ai</email>
</author>
<published>2022-02-17T14:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a78b07dcae2f9d6fafadb05540d8152f575d7e59'/>
<id>urn:sha1:a78b07dcae2f9d6fafadb05540d8152f575d7e59</id>
<content type='text'>
In case user application was interrupted while some cs still in-flight
or in the middle of completion handling in driver, the
last refcount of the kernel private data for the user process
will not be put in the fd close flow, but in the cs completion
workqueue context.

This means that the device reset-upon-device-release will be called
from that context. During the reset flow, the driver flushes all the cs
workqueue to ensure that any scheduled work has run to completion,
and since we are running from the completion context we will
have deadlock.

Therefore, we need to skip flushing the workqueue in those cases.
It is safe to do it because the user won't be able to release the device
unless the workqueues are already empty.

Signed-off-by: farah kassabri &lt;fkassabri@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: Timestamps buffers registration</title>
<updated>2022-02-28T12:22:04Z</updated>
<author>
<name>farah kassabri</name>
<email>fkassabri@habana.ai</email>
</author>
<published>2021-12-23T11:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9158bf69e74f98fea6847cca93bbf33a589bebcd'/>
<id>urn:sha1:9158bf69e74f98fea6847cca93bbf33a589bebcd</id>
<content type='text'>
Timestamp registration API allows the user to register
a timestamp record event which will make the driver set
timestamp when CQ counter reaches the target value
and write it to a specific location specified
by the user.
This is a non blocking API, unlike the wait_for_interrupt
which is a blocking one.

Signed-off-by: farah kassabri &lt;fkassabri@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: fix race when waiting on encaps signal</title>
<updated>2022-02-28T12:22:04Z</updated>
<author>
<name>Dani Liberman</name>
<email>dliberman@habana.ai</email>
</author>
<published>2021-12-27T19:18:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b32cd10480ebcfd66c3f7ae9fece951e5b5b35ae'/>
<id>urn:sha1:b32cd10480ebcfd66c3f7ae9fece951e5b5b35ae</id>
<content type='text'>
Scenario:
1. CS which is part of encaps signal has been completed and now
executing kref_put to its encaps signal handle. The refcount of the
handle decremented to 0, and called the encaps signal handle
release function - hl_encaps_handle_do_release.

2. At this point the user starts waiting on the signal, and finds the
encaps signal handle in the handlers list and increment the habdle
refcount to 1.

3. Immediately after, hl_encaps_handle_do_release removed the handle
from the list and free its memory.

4. Wait function using the handle although it has been freed.

This scenario caused the slab area which was previously allocated
for the handle to be poison overwritten which triggered kernel bug
the next time the OS needed to allocate this slab.

Fixed by getting the refcount of the handle only in case it is not
zero.

Signed-off-by: Dani Liberman &lt;dliberman@habana.ai&gt;
Reviewed-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
</content>
</entry>
</feed>
