codec_mm: Fix cma clear and rebuild map for codec_mm. [1/1]
authorKai Song <kai.song@amlogic.com>
Wed, 13 Feb 2019 02:12:39 +0000 (10:12 +0800)
committerLuan Yuan <luan.yuan@amlogic.com>
Thu, 14 Mar 2019 11:40:49 +0000 (19:40 +0800)
commit92417948deb3b877a4be3a5404a22cf5f40e23df
tree1f625f65a9e284007f30bca45436da50605e369b
parent687f715cd19efd8ac9657779cdeb578d2351d1b0
codec_mm: Fix cma clear and rebuild map for codec_mm. [1/1]

PD#172483

Problem:
To avoid A73 core speculative data loading from protected
memory, which triggers SError fault, the mapping of the
protected region should be cleared. In codec_mm driver, the
page structure pointer used to clear the mapping is wrong.
Although the memory is allocated from CMA, because we are
using CMA_res mode the address from CMA_res_pool is actually
a physical address, similar as reserved memory case. As a
result, the mapping to protected address is not cleared.

Solution:
1.Add "mem->from_flags ==
  AMPORTS_MEM_FLAGS_FROM_GET_FROM_CMA_RES" case processing.

Verify:
Run YTTV and there is no SError crash after the fix.

Change-Id: Ia912337c1d7d5a55800fc55ad1d61016f9710f4d
Signed-off-by: Kai Song <kai.song@amlogic.com>
drivers/amlogic/media/common/codec_mm/codec_mm.c