From ae19265e71df6e7aacd157b7d012c8833ee7e060 Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Wed, 9 Apr 2014 11:04:10 +0530 Subject: security: tlk: enable logging only if secure firmware supports it We send an SMC to the secure firmware to see if it supports logging. If it returns failure, then we disable it from the kernel too. Change-Id: Icc59fc221f6f59d1806815333f3e71a35a45ea90 Signed-off-by: Varun Wadekar Reviewed-on: http://git-master/r/393217 GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- security/tlk_driver/ote_log.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'security') diff --git a/security/tlk_driver/ote_log.c b/security/tlk_driver/ote_log.c index 9a70077dbe7b..0e8f6b290f30 100644 --- a/security/tlk_driver/ote_log.c +++ b/security/tlk_driver/ote_log.c @@ -186,9 +186,11 @@ static int __init ote_logger_init(void) smc_args[0] = TE_SMC_INIT_LOGGER; smc_args[1] = (uintptr_t)cb; - tlk_generic_smc(smc_args[0], smc_args[1], 0); - ote_logging_enabled = 1; + /* enable logging only if secure firmware supports it */ + if (!tlk_generic_smc(smc_args[0], smc_args[1], 0)) + ote_logging_enabled = 1; + ote_print_logs(); #else smc_args[0] = TE_SMC_INIT_LOGGER; -- cgit v1.2.3