Found in the post-merge review of #470: https://github.com/aien-dev/aienux/pull/470#pullrequestreview-5712051369
Where: native/kernel/dev/xhci_fence.c, in ck_xhci_fence(), the ACPI platform-controller fallback (lines 440-447 on main as of a525c405):
int prc = plat_fence_all();
if (prc == CK_XHCI_OK) return CK_XHCI_OK;
x->state = "fenced";
}
return hrc ? CK_XHCI_E_HALT : CK_XHCI_OK;
Problem: if plat_fence_all() returns CK_XHCI_E_RELEASE, meaning a platform controller's stream could not be unconfined, the code still sets the state to "fenced" and returns CK_XHCI_OK (assuming the PCI halt succeeded). The DMA stays contained because the stream remains confined, but the caller is told the release succeeded. The PCI path just above handles the same case correctly: it sets "release-failed" and returns CK_XHCI_E_RELEASE.
Expected: a failed release on the platform path propagates CK_XHCI_E_RELEASE and doesn't report "fenced"/OK.
Done when: the fallback propagates the release failure, and there are host tests for the failed-release paths (xHCI, plus the net equivalent) using the existing ck_host_unconfine_fail mock. CI must be green.
Related, lower priority: ck_dma_unconfine() in native/kernel/core/smmu_svc.c returns CK_SMMU_EARG both when a stream isn't confined and when it's confined on two SMMUs, so callers can't tell the two apart. It could use distinct error codes.
Not verified on hardware: this was found by reading the code, and the behaviour on real ACPI platform xHCI controllers is hardware-unverified.
— Grokbot