<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/misc/habanalabs/common/command_buffer.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_buffer.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/misc/habanalabs/common/command_buffer.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: 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: add topic to memory manager buffer</title>
<updated>2022-05-22T19:01:20Z</updated>
<author>
<name>Yuri Nudelman</name>
<email>ynudelman@habana.ai</email>
</author>
<published>2022-05-02T10:41:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f2daa2d97ec16766bc36fc2b6218d0acb47885ed'/>
<id>urn:sha1:f2daa2d97ec16766bc36fc2b6218d0acb47885ed</id>
<content type='text'>
Currently, buffers from multiple flows pass through the same infra.
This way, in logs, we are unable to distinguish between buffers that
came from separate flows.
To address this problem, add a "topic" to buffer behavior
descriptor - a string identifier that will be used to identify in logs
the flow this buffer relates to.

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: 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: unified memory manager new code 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:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=dc653c36c98e559575644aaa7c5989301d98f7ed'/>
<id>urn:sha1:dc653c36c98e559575644aaa7c5989301d98f7ed</id>
<content type='text'>
This commit adds the new code needed for command buffer flow using the
new unified memory manager, without changing the actual functionality.

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: avoid using an uninitialized variable</title>
<updated>2022-02-28T12:22:05Z</updated>
<author>
<name>Tomer Tayar</name>
<email>ttayar@habana.ai</email>
</author>
<published>2022-02-10T08:56:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=59456f4c2250e1fb15b1a82bfe2ef1aaf217fa1b'/>
<id>urn:sha1:59456f4c2250e1fb15b1a82bfe2ef1aaf217fa1b</id>
<content type='text'>
Fix the following compilation warning in
hl_cb_ioctl() @ command_buffer.c:
warning: ‘device_va’ may be used uninitialized in this function

Signed-off-by: Tomer Tayar &lt;ttayar@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: silence an uninitialized variable warning</title>
<updated>2022-02-28T12:22:04Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-01-11T07:16:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a8076c47f6f78e5709d3a6b89c146c2706637f02'/>
<id>urn:sha1:a8076c47f6f78e5709d3a6b89c146c2706637f02</id>
<content type='text'>
Smatch warns that:

    drivers/misc/habanalabs/common/command_buffer.c:471 hl_cb_ioctl()
    error: uninitialized symbol 'device_va'.

Which is true, but harmless.  Anyway, it's easy to silence this by
adding a error check.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&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: add a lock to protect multiple reset variables</title>
<updated>2021-12-26T12:42:11Z</updated>
<author>
<name>Ofir Bitton</name>
<email>obitton@habana.ai</email>
</author>
<published>2021-11-23T13:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=42eb2872e0867679c996bb19ee9063e6141fa974'/>
<id>urn:sha1:42eb2872e0867679c996bb19ee9063e6141fa974</id>
<content type='text'>
Atomic operations during reset are replaced by a spinlock in order
to have the ability to protect more than a single variable.

Signed-off-by: Ofir Bitton &lt;obitton@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: refactor reset information variables</title>
<updated>2021-12-26T12:41:28Z</updated>
<author>
<name>Ofir Bitton</name>
<email>obitton@habana.ai</email>
</author>
<published>2021-11-23T13:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=eb135291912f7554e2a2472befc44818098baa8d'/>
<id>urn:sha1:eb135291912f7554e2a2472befc44818098baa8d</id>
<content type='text'>
Unify variables related to device reset, which will help us to
add some new reset functionality in future patches.

Signed-off-by: Ofir Bitton &lt;obitton@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: replace some -ENOTTY with -EINVAL</title>
<updated>2021-12-26T06:59:10Z</updated>
<author>
<name>Oded Gabbay</name>
<email>ogabbay@kernel.org</email>
</author>
<published>2021-12-19T14:06:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=519f4ed0a09cdf3834c5cbde1416acd9a979a709'/>
<id>urn:sha1:519f4ed0a09cdf3834c5cbde1416acd9a979a709</id>
<content type='text'>
-ENOTTY is returned in case of error in the ioctl arguments themselves,
such as function that doesn't exists.

In all other cases, where the error is in the arguments of the custom
data structures that we define that are passed in the various ioctls,
we need to return -EINVAL.

Signed-off-by: Oded Gabbay &lt;ogabbay@kernel.org&gt;
</content>
</entry>
<entry>
<title>habanalabs: change wait_for_interrupt implementation</title>
<updated>2021-12-26T06:59:09Z</updated>
<author>
<name>farah kassabri</name>
<email>fkassabri@habana.ai</email>
</author>
<published>2021-11-02T09:34:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b9d31cada7d9f137028c11534fff77fec8511690'/>
<id>urn:sha1:b9d31cada7d9f137028c11534fff77fec8511690</id>
<content type='text'>
Currently the cq counters are allocated in userspace memory,
and mapped by the driver to the device address space.

A new requirement that is part of new future API related to this one,
requires that cq counters will be allocated in kernel memory.

We leverage the existing cb_create API with KERNEL_MAPPED flag set to
allocate this memory.

That way we gain two things:
1. The memory cannot be freed while in use since it's protected
by refcount in driver.

2. No need to wake up the user thread upon each interrupt from CQ,
because the kernel has direct access to the counter. Therefore,
it can make comparison with the target value in the interrupt
handler and wake up the user thread only if the counter reaches the
target value. This is instead of waking the thread up to copy counter
value from user then go sleep again if target value wasn't reached.

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>
</feed>
