<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/accel, branch v6.18-rc6</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>accel/qaic: Synchronize access to DBC request queue head &amp; tail pointer</title>
<updated>2025-10-14T14:56:31+00:00</updated>
<author>
<name>Pranjal Ramajor Asha Kanojiya</name>
<email>quic_pkanojiy@quicinc.com</email>
</author>
<published>2025-10-07T06:18:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=52e59f7740ba23bbb664914967df9a00208ca10c'/>
<id>52e59f7740ba23bbb664914967df9a00208ca10c</id>
<content type='text'>
Two threads of the same process can potential read and write parallelly to
head and tail pointers of the same DBC request queue. This could lead to a
race condition and corrupt the DBC request queue.

Fixes: ff13be830333 ("accel/qaic: Add datapath")
Signed-off-by: Pranjal Ramajor Asha Kanojiya &lt;quic_pkanojiy@quicinc.com&gt;
Signed-off-by: Youssef Samir &lt;youssef.abdulrahman@oss.qualcomm.com&gt;
Reviewed-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Reviewed-by: Carl Vanderlip &lt;carl.vanderlip@oss.qualcomm.com&gt;
[jhugo: Add fixes tag]
Signed-off-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20251007061837.206132-1-youssef.abdulrahman@oss.qualcomm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two threads of the same process can potential read and write parallelly to
head and tail pointers of the same DBC request queue. This could lead to a
race condition and corrupt the DBC request queue.

Fixes: ff13be830333 ("accel/qaic: Add datapath")
Signed-off-by: Pranjal Ramajor Asha Kanojiya &lt;quic_pkanojiy@quicinc.com&gt;
Signed-off-by: Youssef Samir &lt;youssef.abdulrahman@oss.qualcomm.com&gt;
Reviewed-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Reviewed-by: Carl Vanderlip &lt;carl.vanderlip@oss.qualcomm.com&gt;
[jhugo: Add fixes tag]
Signed-off-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20251007061837.206132-1-youssef.abdulrahman@oss.qualcomm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/qaic: Treat remaining == 0 as error in find_and_map_user_pages()</title>
<updated>2025-10-14T14:44:40+00:00</updated>
<author>
<name>Youssef Samir</name>
<email>quic_yabdulra@quicinc.com</email>
</author>
<published>2025-10-07T12:23:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=11f08c30a3e4157305ba692f1d44cca5fc9a8fca'/>
<id>11f08c30a3e4157305ba692f1d44cca5fc9a8fca</id>
<content type='text'>
Currently, if find_and_map_user_pages() takes a DMA xfer request from the
user with a length field set to 0, or in a rare case, the host receives
QAIC_TRANS_DMA_XFER_CONT from the device where resources-&gt;xferred_dma_size
is equal to the requested transaction size, the function will return 0
before allocating an sgt or setting the fields of the dma_xfer struct.
In that case, encode_addr_size_pairs() will try to access the sgt which
will lead to a general protection fault.

Return an EINVAL in case the user provides a zero-sized ALP, or the device
requests continuation after all of the bytes have been transferred.

Fixes: 96d3c1cadedb ("accel/qaic: Clean up integer overflow checking in map_user_pages()")
Signed-off-by: Youssef Samir &lt;quic_yabdulra@quicinc.com&gt;
Signed-off-by: Youssef Samir &lt;youssef.abdulrahman@oss.qualcomm.com&gt;
Reviewed-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Reviewed-by: Carl Vanderlip &lt;carl.vanderlip@oss.qualcomm.com&gt;
Signed-off-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20251007122320.339654-1-youssef.abdulrahman@oss.qualcomm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, if find_and_map_user_pages() takes a DMA xfer request from the
user with a length field set to 0, or in a rare case, the host receives
QAIC_TRANS_DMA_XFER_CONT from the device where resources-&gt;xferred_dma_size
is equal to the requested transaction size, the function will return 0
before allocating an sgt or setting the fields of the dma_xfer struct.
In that case, encode_addr_size_pairs() will try to access the sgt which
will lead to a general protection fault.

Return an EINVAL in case the user provides a zero-sized ALP, or the device
requests continuation after all of the bytes have been transferred.

Fixes: 96d3c1cadedb ("accel/qaic: Clean up integer overflow checking in map_user_pages()")
Signed-off-by: Youssef Samir &lt;quic_yabdulra@quicinc.com&gt;
Signed-off-by: Youssef Samir &lt;youssef.abdulrahman@oss.qualcomm.com&gt;
Reviewed-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Reviewed-by: Carl Vanderlip &lt;carl.vanderlip@oss.qualcomm.com&gt;
Signed-off-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20251007122320.339654-1-youssef.abdulrahman@oss.qualcomm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/qaic: Fix bootlog initialization ordering</title>
<updated>2025-10-14T14:30:39+00:00</updated>
<author>
<name>Jeffrey Hugo</name>
<email>quic_jhugo@quicinc.com</email>
</author>
<published>2025-10-07T11:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fd6e385528d8f85993b7bfc6430576136bb14c65'/>
<id>fd6e385528d8f85993b7bfc6430576136bb14c65</id>
<content type='text'>
As soon as we queue MHI buffers to receive the bootlog from the device,
we could be receiving data. Therefore all the resources needed to
process that data need to be setup prior to queuing the buffers.

We currently initialize some of the resources after queuing the buffers
which creates a race between the probe() and any data that comes back
from the device. If the uninitialized resources are accessed, we could
see page faults.

Fix the init ordering to close the race.

Fixes: 5f8df5c6def6 ("accel/qaic: Add bootlog debugfs")
Signed-off-by: Jeffrey Hugo &lt;quic_jhugo@quicinc.com&gt;
Signed-off-by: Youssef Samir &lt;youssef.abdulrahman@oss.qualcomm.com&gt;
Reviewed-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Reviewed-by: Carl Vanderlip &lt;carl.vanderlip@oss.qualcomm.com&gt;
Signed-off-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20251007115750.332169-1-youssef.abdulrahman@oss.qualcomm.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As soon as we queue MHI buffers to receive the bootlog from the device,
we could be receiving data. Therefore all the resources needed to
process that data need to be setup prior to queuing the buffers.

We currently initialize some of the resources after queuing the buffers
which creates a race between the probe() and any data that comes back
from the device. If the uninitialized resources are accessed, we could
see page faults.

Fix the init ordering to close the race.

Fixes: 5f8df5c6def6 ("accel/qaic: Add bootlog debugfs")
Signed-off-by: Jeffrey Hugo &lt;quic_jhugo@quicinc.com&gt;
Signed-off-by: Youssef Samir &lt;youssef.abdulrahman@oss.qualcomm.com&gt;
Reviewed-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Reviewed-by: Carl Vanderlip &lt;carl.vanderlip@oss.qualcomm.com&gt;
Signed-off-by: Jeff Hugo &lt;jeff.hugo@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20251007115750.332169-1-youssef.abdulrahman@oss.qualcomm.com
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/habanalabs: add Infineon version check</title>
<updated>2025-09-25T06:14:45+00:00</updated>
<author>
<name>Pavan S</name>
<email>pavan.sreenivas@intel.com</email>
</author>
<published>2024-10-02T07:46:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ca282c3e635cd98cc5a9bb24606b41379e1fd8e'/>
<id>6ca282c3e635cd98cc5a9bb24606b41379e1fd8e</id>
<content type='text'>
On HL338 ASICs, the Infineon first‑stage firmware is not present and
the reported version is 0. In this case printing a version number is
misleading, as it suggests valid firmware when it does not exist.

Fix this by printing the first‑stage Infineon firmware version only
if the reported value is non‑zero. This avoids confusing or incorrect
log messages on devices where the first stage is not applicable.

Signed-off-by: Pavan S &lt;pavan.sreenivas@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On HL338 ASICs, the Infineon first‑stage firmware is not present and
the reported version is 0. In this case printing a version number is
misleading, as it suggests valid firmware when it does not exist.

Fix this by printing the first‑stage Infineon firmware version only
if the reported value is non‑zero. This avoids confusing or incorrect
log messages on devices where the first stage is not applicable.

Signed-off-by: Pavan S &lt;pavan.sreenivas@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/habanalabs/gaudi2: read preboot status after recovering from dirty state</title>
<updated>2025-09-25T06:09:32+00:00</updated>
<author>
<name>Konstantin Sinyuk</name>
<email>konstantin.sinyuk@intel.com</email>
</author>
<published>2024-10-01T12:52:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a0d866bab184161ba155b352650083bf6695e50e'/>
<id>a0d866bab184161ba155b352650083bf6695e50e</id>
<content type='text'>
Dirty state can occur when the host VM undergoes a reset while the
device does not. In such a case, the driver must reset the device before
it can be used again. As part of this reset, the device capabilities
are zeroed. Therefore, the driver must read the Preboot status again to
learn the Preboot state, capabilities, and security configuration.

Signed-off-by: Konstantin Sinyuk &lt;konstantin.sinyuk@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dirty state can occur when the host VM undergoes a reset while the
device does not. In such a case, the driver must reset the device before
it can be used again. As part of this reset, the device capabilities
are zeroed. Therefore, the driver must read the Preboot status again to
learn the Preboot state, capabilities, and security configuration.

Signed-off-by: Konstantin Sinyuk &lt;konstantin.sinyuk@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/habanalabs: add HL_GET_P_STATE passthrough type</title>
<updated>2025-09-25T06:09:31+00:00</updated>
<author>
<name>Ariel Aviad</name>
<email>ariel.aviad@intel.com</email>
</author>
<published>2024-09-24T08:02:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=65a3f5bc331ca7384900641b46cadff63805c10e'/>
<id>65a3f5bc331ca7384900641b46cadff63805c10e</id>
<content type='text'>
Add a new passthrough type HL_GET_P_STATE to the cpucp generic ioctl
to allow userspace to read the device performance state via firmware.

Signed-off-by: Ariel Aviad &lt;ariel.aviad@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new passthrough type HL_GET_P_STATE to the cpucp generic ioctl
to allow userspace to read the device performance state via firmware.

Signed-off-by: Ariel Aviad &lt;ariel.aviad@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/habanalabs: add debugfs interface for HLDIO testing</title>
<updated>2025-09-25T06:09:31+00:00</updated>
<author>
<name>Konstantin Sinyuk</name>
<email>konstantin.sinyuk@intel.com</email>
</author>
<published>2024-09-16T12:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=eeb38d0e91860fb47bc42a2cc44ffd80989a04fc'/>
<id>eeb38d0e91860fb47bc42a2cc44ffd80989a04fc</id>
<content type='text'>
Add debugfs files for NVMe Direct I/O (HLDIO) functionality.
This interface allows userspace access to direct SSD ↔ device transfers
through debugfs nodes.

Four debugfs files are created under /sys/kernel/debug/habanalabs/hlN/:

  - dio_ssd2hl : trigger SSD-to-device transfers
  - dio_hl2ssd : trigger device-to-SSD transfers
    (placeholder, not yet implemented)
  - dio_stats  : show transfer statistics
  - dio_reset  : reset statistics counters

Usage examples:

  # Perform SSD → device transfer
  echo "fd=3 va=0x10000 off=0 len=4096" &gt; \
    /sys/kernel/debug/habanalabs/hl0/dio_ssd2hl

  # View statistics
  cat /sys/kernel/debug/habanalabs/hl0/dio_stats

  # Reset counters
  echo 1 &gt; /sys/kernel/debug/habanalabs/hl0/dio_reset

This interface provides access to HLDIO functionality for validation
and diagnostics.

Signed-off-by: Konstantin Sinyuk &lt;konstantin.sinyuk@intel.com&gt;
Reviewed-by: Farah Kassabri &lt;farah.kassabri@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add debugfs files for NVMe Direct I/O (HLDIO) functionality.
This interface allows userspace access to direct SSD ↔ device transfers
through debugfs nodes.

Four debugfs files are created under /sys/kernel/debug/habanalabs/hlN/:

  - dio_ssd2hl : trigger SSD-to-device transfers
  - dio_hl2ssd : trigger device-to-SSD transfers
    (placeholder, not yet implemented)
  - dio_stats  : show transfer statistics
  - dio_reset  : reset statistics counters

Usage examples:

  # Perform SSD → device transfer
  echo "fd=3 va=0x10000 off=0 len=4096" &gt; \
    /sys/kernel/debug/habanalabs/hl0/dio_ssd2hl

  # View statistics
  cat /sys/kernel/debug/habanalabs/hl0/dio_stats

  # Reset counters
  echo 1 &gt; /sys/kernel/debug/habanalabs/hl0/dio_reset

This interface provides access to HLDIO functionality for validation
and diagnostics.

Signed-off-by: Konstantin Sinyuk &lt;konstantin.sinyuk@intel.com&gt;
Reviewed-by: Farah Kassabri &lt;farah.kassabri@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/habanalabs: add NVMe Direct I/O (HLDIO) infrastructure</title>
<updated>2025-09-25T06:09:30+00:00</updated>
<author>
<name>Konstantin Sinyuk</name>
<email>konstantin.sinyuk@intel.com</email>
</author>
<published>2024-09-09T15:21:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8cbacc9a2703c661c5e15bfbaeb1d4dcb58eb621'/>
<id>8cbacc9a2703c661c5e15bfbaeb1d4dcb58eb621</id>
<content type='text'>
Introduce NVMe Direct I/O (HLDIO) infrastructure to support
peer‑to‑peer DMA in the habanalabs driver. This adds internal helpers
and data structures to enable direct transfers between NVMe storage
and device memory.

The feature is built only when CONFIG_HL_HLDIO is enabled. A debugfs
interface is also provided for functional validation.

Signed-off-by: Konstantin Sinyuk &lt;konstantin.sinyuk@intel.com&gt;
Reviewed-by: Farah Kassabri &lt;farah.kassabri@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce NVMe Direct I/O (HLDIO) infrastructure to support
peer‑to‑peer DMA in the habanalabs driver. This adds internal helpers
and data structures to enable direct transfers between NVMe storage
and device memory.

The feature is built only when CONFIG_HL_HLDIO is enabled. A debugfs
interface is also provided for functional validation.

Signed-off-by: Konstantin Sinyuk &lt;konstantin.sinyuk@intel.com&gt;
Reviewed-by: Farah Kassabri &lt;farah.kassabri@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/habanalabs: support mapping cb with vmalloc-backed coherent memory</title>
<updated>2025-09-25T06:09:30+00:00</updated>
<author>
<name>Moti Haimovski</name>
<email>moti.haimovski@intel.com</email>
</author>
<published>2024-09-08T12:01:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=513024d5a0e34fd34247043f1876b6138ca52847'/>
<id>513024d5a0e34fd34247043f1876b6138ca52847</id>
<content type='text'>
When IOMMU is enabled, dma_alloc_coherent() with GFP_USER may return
addresses from the vmalloc range. If such an address is mapped without
VM_MIXEDMAP, vm_insert_page() will trigger a BUG_ON due to the
VM_PFNMAP restriction.

Fix this by checking for vmalloc addresses and setting VM_MIXEDMAP
in the VMA before mapping. This ensures safe mapping and avoids kernel
crashes. The memory is still driver-allocated and cannot be accessed
directly by userspace.

Signed-off-by: Moti Haimovski  &lt;moti.haimovski@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When IOMMU is enabled, dma_alloc_coherent() with GFP_USER may return
addresses from the vmalloc range. If such an address is mapped without
VM_MIXEDMAP, vm_insert_page() will trigger a BUG_ON due to the
VM_PFNMAP restriction.

Fix this by checking for vmalloc addresses and setting VM_MIXEDMAP
in the VMA before mapping. This ensures safe mapping and avoids kernel
crashes. The memory is still driver-allocated and cannot be accessed
directly by userspace.

Signed-off-by: Moti Haimovski  &lt;moti.haimovski@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>accel/habanalabs: remove old interface variation of 'access_ok()'</title>
<updated>2025-09-25T06:09:29+00:00</updated>
<author>
<name>Ilia Levi</name>
<email>ilia.levi@intel.com</email>
</author>
<published>2024-08-19T09:13:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0668db41b5d8a834a04be3b281fa9452dcf3dc18'/>
<id>0668db41b5d8a834a04be3b281fa9452dcf3dc18</id>
<content type='text'>
The access_ok() API no longer requires the VERIFY_WRITE argument,
and the use of the old interface with VERIFY_WRITE is deprecated.

Clean up the habanalabs memory manager to use the modern access_ok()
interface consistently. This removes old #ifdef guards and aligns the
driver with current upstream kernel APIs.

Signed-off-by: Ilia Levi &lt;ilia.levi@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The access_ok() API no longer requires the VERIFY_WRITE argument,
and the use of the old interface with VERIFY_WRITE is deprecated.

Clean up the habanalabs memory manager to use the modern access_ok()
interface consistently. This removes old #ifdef guards and aligns the
driver with current upstream kernel APIs.

Signed-off-by: Ilia Levi &lt;ilia.levi@intel.com&gt;
Reviewed-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
Signed-off-by: Koby Elbaz &lt;koby.elbaz@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
