Skip to content

zocl: fix ert_polling not working with fpga_accelerator DT node (#10134) - #10138

Merged
chvamshi-xilinx merged 1 commit into
Xilinx:2026.2from
ManojTakasi:dm_ip
Oct 24, 2026
Merged

chvamshi-xilinx merged 1 commit into
Xilinx:2026.2from
ManojTakasi:dm_ip

Conversation

@ManojTakasi

Copy link
Copy Markdown
Collaborator

Problem solved by the commit

When the fpga_accelerator device-tree node with interrupts-extended is present, ert_polling mode was broken due to two issues:

  1. zocl_edge_xclbin.c: zocl_cu_intc_refresh() was called before zocl_kds_update(), so force_polling was not set when the INTC decision was made. Additionally, zocl_create_cu() ran before refresh, causing CUs to register with the old INTC that was subsequently torn down, leaving the new INTC with no CU handlers.

    Fix: set force_polling from kds_cfg.polling before calling zocl_cu_intc_refresh(), and move zocl_create_cu() after the refresh so CUs register with the correct (new or absent) INTC.

  2. zocl_drv.c: zocl_cu_intc_refresh() always recreated the CU INTC regardless of polling mode, causing an IRQ handler to be registered even when ert_polling was enabled.

    Fix: when force_polling is set, tear down any existing INTC and return without recreating it.

  3. zocl_kds.c: force_polling in kds_sched was never set by the edge path, so kds_core could not honour the polling request.

    Fix: set/clear force_polling alongside cu_intr in zocl_kds_update().

  4. zocl_ctrl_ert.c: zert_cmd_cfg_end() unconditionally set cu_intr=1, overriding the polling flag set earlier by zocl_kds_update().

    Fix: guard cu_intr=1 with !force_polling.

Tested on VCK190 with the fpga_accelerator DT overlay applied:

  • Without xrt.ini: interrupt mode works, IRQ 47 appears in /proc/interrupts during kernel execution.
  • With ert_polling=1 in /etc/xrt.ini: polling mode works, no zocl_irq_intc entry in /proc/interrupts at any point.

(cherry picked from commit 4f80103)

…nx#10134)

When the fpga_accelerator device-tree node with interrupts-extended is
present, ert_polling mode was broken due to two issues:

1. zocl_edge_xclbin.c: zocl_cu_intc_refresh() was called before
   zocl_kds_update(), so force_polling was not set when the INTC
   decision was made. Additionally, zocl_create_cu() ran before
   refresh, causing CUs to register with the old INTC that was
   subsequently torn down, leaving the new INTC with no CU handlers.

   Fix: set force_polling from kds_cfg.polling before calling
   zocl_cu_intc_refresh(), and move zocl_create_cu() after the
   refresh so CUs register with the correct (new or absent) INTC.

2. zocl_drv.c: zocl_cu_intc_refresh() always recreated the CU INTC
   regardless of polling mode, causing an IRQ handler to be registered
   even when ert_polling was enabled.

   Fix: when force_polling is set, tear down any existing INTC and
   return without recreating it.

3. zocl_kds.c: force_polling in kds_sched was never set by the edge
   path, so kds_core could not honour the polling request.

   Fix: set/clear force_polling alongside cu_intr in zocl_kds_update().

4. zocl_ctrl_ert.c: zert_cmd_cfg_end() unconditionally set cu_intr=1,
   overriding the polling flag set earlier by zocl_kds_update().

   Fix: guard cu_intr=1 with !force_polling.

Tested on VCK190 with the fpga_accelerator DT overlay applied:
- Without xrt.ini: interrupt mode works, IRQ 47 appears in
  /proc/interrupts during kernel execution.
- With ert_polling=1 in /etc/xrt.ini: polling mode works, no
  zocl_irq_intc entry in /proc/interrupts at any point.

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 4f80103)
@chvamshi-xilinx
chvamshi-xilinx merged commit 587f550 into Xilinx:2026.2 Oct 24, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants