From 9166a75f2c0eb4dbebbac01b73c1afd4bca325c7 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 18 May 2021 11:54:22 +0200 Subject: [PATCH] foc: map uncached normal memory bufferable Mapping normal memory bufferable restores support for unaligned reads on DMA memory and prevents the following errors on imx6q_sabrelite. KERNEL0: alignment error at 18003061 (PC: 0102e3f8, SP: 401ffb18, FSR: 90000001, PSR: 20000110) Issue #4094 Issue #4157 --- repos/base-foc/src/core/ipc_pager.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/repos/base-foc/src/core/ipc_pager.cc b/repos/base-foc/src/core/ipc_pager.cc index f786e1c788..98c3b08839 100644 --- a/repos/base-foc/src/core/ipc_pager.cc +++ b/repos/base-foc/src/core/ipc_pager.cc @@ -103,12 +103,12 @@ void Ipc_pager::reply_and_wait_for_fault() l4_utcb_mr()->mr[0] = _reply_mapping.dst_addr | L4_ITEM_MAP; - l4_fpage_cacheability_opt_t - cacheability = _reply_mapping.cached ? L4_FPAGE_CACHEABLE - : L4_FPAGE_UNCACHEABLE; + bool const bufferable = !_reply_mapping.io_mem || _reply_mapping.write_combined; - if (_reply_mapping.write_combined) - cacheability= L4_FPAGE_BUFFERABLE; + l4_fpage_cacheability_opt_t const + cacheability = _reply_mapping.cached ? L4_FPAGE_CACHEABLE + : bufferable ? L4_FPAGE_BUFFERABLE + : L4_FPAGE_UNCACHEABLE; l4_utcb_mr()->mr[0] |= cacheability << 4;