summaryrefslogtreecommitdiff
path: root/security/tf_driver/tf_comm.c
diff options
context:
space:
mode:
authorRahul Prabhakar <rahulp@nvidia.com>2011-09-13 15:40:45 -0700
committerFrank Bourgeois <fbourgeois@nvidia.com>2011-09-21 18:03:43 -0700
commit7742e7756c0637ae5378e394ca03978826e31a78 (patch)
tree8cc31ae92f8e004adfb290ba035b4887bed088c9 /security/tf_driver/tf_comm.c
parent47a4ffb6af7aec974ecb463ba7eb068422b3c3d4 (diff)
ARM: tegra: TrustedLogic drop 32055tegra-12r9-android-3.2
The WARs checked into 12r7: disable LP0/LP1 and slave LP2, and force maxcpus to 1 aren't needed when used with the newer tf_include.h from this TL drop. bug 868906 bug 870224 bug 877339 Change-Id: Ic3002b1d5fa09e8171c0d43bf6978ae96e51daf8 Reviewed-on: http://git-master/r/53324 Reviewed-by: Rahul Prabhakar <rahulp@nvidia.com> Tested-by: Rahul Prabhakar <rahulp@nvidia.com> Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Reviewed-by: Jonathan White <jwhite@nvidia.com>
Diffstat (limited to 'security/tf_driver/tf_comm.c')
-rw-r--r--security/tf_driver/tf_comm.c70
1 files changed, 9 insertions, 61 deletions
diff --git a/security/tf_driver/tf_comm.c b/security/tf_driver/tf_comm.c
index 49608fa988b9..1ead98a0160f 100644
--- a/security/tf_driver/tf_comm.c
+++ b/security/tf_driver/tf_comm.c
@@ -1211,11 +1211,7 @@ static int tf_send_recv(struct tf_comm *comm,
union tf_command *command,
struct tf_answer_struct *answerStruct,
struct tf_connection *connection,
- int bKillable
- #ifdef CONFIG_TF_ZEBRA
- , bool *secure_is_idle
- #endif
- )
+ int bKillable)
{
int result;
u64 timeout;
@@ -1229,6 +1225,10 @@ static int tf_send_recv(struct tf_comm *comm,
dprintk(KERN_INFO "[pid=%d] tf_send_recv(%p)\n",
current->pid, command);
+#ifdef CONFIG_TF_ZEBRA
+ tf_clock_timer_start();
+#endif
+
#ifdef CONFIG_FREEZER
saved_flags = current->flags;
current->flags |= PF_FREEZER_NOSIG;
@@ -1250,17 +1250,6 @@ copy_answers:
#ifdef CONFIG_FREEZER
if (unlikely(freezing(current))) {
-#ifdef CONFIG_TF_ZEBRA
- if (!(*secure_is_idle)) {
- if (tf_schedule_secure_world(comm, true) ==
- STATUS_PENDING)
- goto copy_answers;
-
- tf_l4sec_clkdm_allow_idle(true);
- *secure_is_idle = true;
- }
-#endif
-
dprintk(KERN_INFO
"Entering refrigerator.\n");
refrigerator();
@@ -1366,13 +1355,9 @@ copy_answers:
*/
#ifdef CONFIG_TF_ZEBRA
schedule_secure_world:
- if (*secure_is_idle) {
- tf_l4sec_clkdm_wakeup(true, false);
- *secure_is_idle = false;
- }
#endif
- result = tf_schedule_secure_world(comm, false);
+ result = tf_schedule_secure_world(comm);
if (result < 0)
goto exit;
goto copy_answers;
@@ -1399,18 +1384,6 @@ wait:
"prepare to sleep 0x%lx jiffies\n",
nRelativeTimeoutJiffies);
-#ifdef CONFIG_TF_ZEBRA
- if (!(*secure_is_idle)) {
- if (tf_schedule_secure_world(comm, true) == STATUS_PENDING) {
- finish_wait(&comm->wait_queue, &wait);
- wait_prepared = false;
- goto copy_answers;
- }
- tf_l4sec_clkdm_allow_idle(true);
- *secure_is_idle = true;
- }
-#endif
-
/* go to sleep */
if (schedule_timeout(nRelativeTimeoutJiffies) == 0)
dprintk(KERN_INFO
@@ -1429,16 +1402,6 @@ exit:
wait_prepared = false;
}
-#ifdef CONFIG_TF_ZEBRA
- if ((!(*secure_is_idle)) && (result != -EIO)) {
- if (tf_schedule_secure_world(comm, true) == STATUS_PENDING)
- goto copy_answers;
-
- tf_l4sec_clkdm_allow_idle(true);
- *secure_is_idle = true;
- }
-#endif
-
#ifdef CONFIG_FREEZER
current->flags &= ~(PF_FREEZER_NOSIG);
current->flags |= (saved_flags & PF_FREEZER_NOSIG);
@@ -1469,9 +1432,6 @@ int tf_send_receive(struct tf_comm *comm,
cpumask_t saved_cpu_mask;
cpumask_t local_cpu_mask = CPU_MASK_NONE;
#endif
-#ifdef CONFIG_TF_ZEBRA
- bool secure_is_idle = true;
-#endif
answerStructure.answer = answer;
answerStructure.answer_copied = false;
@@ -1509,11 +1469,7 @@ int tf_send_receive(struct tf_comm *comm,
* Send the command
*/
error = tf_send_recv(comm,
- command, &answerStructure, connection, bKillable
- #ifdef CONFIG_TF_ZEBRA
- , &secure_is_idle
- #endif
- );
+ command, &answerStructure, connection, bKillable);
if (!bKillable && sigkill_pending()) {
if ((command->header.message_type ==
@@ -1594,11 +1550,7 @@ int tf_send_receive(struct tf_comm *comm,
connection->device_context;
error = tf_send_recv(comm,
- command, &answerStructure, connection, false
- #ifdef CONFIG_TF_ZEBRA
- , &secure_is_idle
- #endif
- );
+ command, &answerStructure, connection, false);
if (error == -EINTR) {
/*
* Another thread already sent
@@ -1640,11 +1592,7 @@ int tf_send_receive(struct tf_comm *comm,
destroy_context:
error = tf_send_recv(comm,
- command, &answerStructure, connection, false
- #ifdef CONFIG_TF_ZEBRA
- , &secure_is_idle
- #endif
- );
+ command, &answerStructure, connection, false);
/*
* tf_send_recv cannot return an error because