<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/misc/habanalabs/common/memory.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/memory.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/misc/habanalabs/common/memory.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: do MMU prefetch as deferred work</title>
<updated>2022-05-22T19:01:21Z</updated>
<author>
<name>Ohad Sharabi</name>
<email>osharabi@habana.ai</email>
</author>
<published>2022-04-11T06:31:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9e495e24003eec491141c80a9bd8fb4ea5edc171'/>
<id>urn:sha1:9e495e24003eec491141c80a9bd8fb4ea5edc171</id>
<content type='text'>
When user requests to prefetch the MMU translations, the driver will
not block the user until prefetch is done.
Instead, the prefetch work will be delegated to a WQ which will do it
in the background.
This way, the prefetch may progress without blocking the user at all.

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: 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: add prefetch flag to the MAP operation</title>
<updated>2022-05-22T19:01:18Z</updated>
<author>
<name>Ohad Sharabi</name>
<email>osharabi@habana.ai</email>
</author>
<published>2022-04-10T08:19:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5d1a0de2c778f369970dd50f6713e95068926a8b'/>
<id>urn:sha1:5d1a0de2c778f369970dd50f6713e95068926a8b</id>
<content type='text'>
This patch let the user decide whether the translations done in the
page tables will be fetched directly to the STLB right after the map.

We want to let the user control whether to perform prefetch upon map
operation.

To do so a memory flag was added, to be used in the MAP ioctl, called
HL_MEM_PREFETCH and if set- the mappings will be fetched directly to
the STLB after map operation.

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 for_each_sgtable_dma_sg for dma sgt</title>
<updated>2022-05-22T19:01:18Z</updated>
<author>
<name>Ohad Sharabi</name>
<email>osharabi@habana.ai</email>
</author>
<published>2022-03-24T14:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ab4ea5872842766b0155b2517db61a4ae99d98e0'/>
<id>urn:sha1:ab4ea5872842766b0155b2517db61a4ae99d98e0</id>
<content type='text'>
Instead of using for_each_sg when iterating sgt that contains dma
entries, use the more proper for_each_sgtable_dma_sg macro.

In addition, both Goya and Gaudi have the exact same implementation
of the asic function that encapsulate the usage of this macro, so
it is better to move that implementation to the common code.

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: hl_ts_behavior can be static</title>
<updated>2022-05-22T19:00:35Z</updated>
<author>
<name>kernel test robot</name>
<email>lkp@intel.com</email>
</author>
<published>2022-03-24T21:23:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=116a28ac1f0802dc306392746c3dde272ee55c47'/>
<id>urn:sha1:116a28ac1f0802dc306392746c3dde272ee55c47</id>
<content type='text'>
drivers/misc/habanalabs/common/memory.c:2137:28: warning: symbol 'hl_ts_behavior' was not declared. Should it be static?

Fixes: 4d530e7d121a ("habanalabs: convert ts to use unified memory manager")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: kernel test robot &lt;lkp@intel.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: rephrase device out-of-memory message</title>
<updated>2022-05-22T18:57:36Z</updated>
<author>
<name>Ohad Sharabi</name>
<email>osharabi@habana.ai</email>
</author>
<published>2022-03-22T07:21:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f5d85fe05a943920aed8e2911fe2a13f53b14bce'/>
<id>urn:sha1:f5d85fe05a943920aed8e2911fe2a13f53b14bce</id>
<content type='text'>
The out of memory message is rephrased to more subtle expression as out
of memory may be caused by the user in case of, for example, greedy
allocation.

In addition the user is also being notified by an error code.

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 MMU prefetch to ASIC-specific code</title>
<updated>2022-05-22T18:57:36Z</updated>
<author>
<name>Ohad Sharabi</name>
<email>osharabi@habana.ai</email>
</author>
<published>2022-03-21T12:39:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=acbabe63efa78012eb3702486e1cfe7b485f70a0'/>
<id>urn:sha1:acbabe63efa78012eb3702486e1cfe7b485f70a0</id>
<content type='text'>
This is necessary pre-requisite for future ASIC support, where MMU
TLB prefetch is supported.

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