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)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 1 Mar 2019 13:20:38 +0000 (05:20 -0800)
commit145ed9bde2c43b40d788db312a46913bff67b5e5
tree958b8482b5e0d8997f9b02a4472d7e80afa67402
parent62c8d75a1c9c8506e1adadd5f8135f286db538f5
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