Repository navigation
zocl: fix ert_polling not working with fpga_accelerator DT node - #10134
Merged
chvamshi-xilinx merged 1 commit intoOct 24, 2026
Merged
Conversation
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>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
ManojTakasi
pushed a commit
to ManojTakasi/XRT
that referenced
this pull request
Oct 24, 2026
…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
added a commit
that referenced
this pull request
Oct 24, 2026
…) (#10138) 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) Co-authored-by: Ch Vamshi Krishna <40261882+chvamshi-xilinx@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
Found it in one of IVT
How problem was solved, alternative solutions (if any) and why they were rejected
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.
when force_polling is set, tear down any existing INTC and return without recreating it.
set/clear force_polling alongside cu_intr in zocl_kds_update().
guard cu_intr=1 with !force_polling.
Risks (if any) associated the changes in the commit
None
What has been tested and how, request additional testing if necessary
Tested on VCK190 with the fpga_accelerator DT overlay applied:
Documentation impact (if any)
None