diff options
author | Mohammed Nayeem Ur Rahman <mohara@codeaurora.org> | 2019-09-23 19:35:19 +0530 |
---|---|---|
committer | Shreyas Narayan <shrena@codeaurora.org> | 2019-09-27 16:10:13 +0530 |
commit | 80162f9bef1d93c1359c2f05c510c9ddc9be0575 (patch) | |
tree | bd29f29e5c7f1fea3479faed1c426815e1eab7cb | |
parent | 2eb8efc23b0a48210101f227121599e02eabf9b2 (diff) |
adsprpc: Modify Remote scalars call backward compatibleLA.UM.8.6.2.r1-04500-89xx.0
Add proper remote scalar calls to get TZ security key, which compatible
with all dsp process groups TZ secure channel call.
Change-Id: I0519577e5d7d5a8ecfce5ee1ca1a886d6ade4cc5
Acked-by: Tadakamalla Krishnaiah <ktadakam@qti.qualcomm.com>
Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
Signed-off-by: Shreyas Narayan <shrena@codeaurora.org>
-rw-r--r-- | drivers/char/adsprpc.c | 12 | ||||
-rw-r--r-- | drivers/char/adsprpc_shared.h | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index f62d96dcf636..df3469a267f0 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -2481,8 +2481,20 @@ static int fastrpc_munmap_on_dsp_rh(struct fastrpc_file *fl, uint64_t phys, VERIFY(err, 0 == (err = fastrpc_internal_invoke(fl, FASTRPC_MODE_PARALLEL, 1, &ioctl))); + if (err == AEE_EUNSUPPORTED) { + remote_arg_t ra[1]; + + pr_warn("ADSPRPC:Failed to get security key with updated remote call, falling back to older method"); + ra[0].buf.pv = (void *)&routargs; + ra[0].buf.len = sizeof(routargs); + ioctl.inv.sc = REMOTE_SCALARS_MAKE(7, 0, 1); + ioctl.inv.pra = ra; + VERIFY(err, 0 == (err = fastrpc_internal_invoke(fl, + FASTRPC_MODE_PARALLEL, 1, &ioctl))); + } if (err) goto bail; + desc.args[0] = TZ_PIL_AUTH_QDSP6_PROC; desc.args[1] = phys; desc.args[2] = size; diff --git a/drivers/char/adsprpc_shared.h b/drivers/char/adsprpc_shared.h index 9c171abfd2d3..24fad7664204 100644 --- a/drivers/char/adsprpc_shared.h +++ b/drivers/char/adsprpc_shared.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -125,6 +125,9 @@ do {\ } while (0) #endif +/* Fall back to older APIS in case API is not supported */ +#define AEE_EUNSUPPORTED 20 + #define remote_arg64_t union remote_arg64 struct remote_buf64 { |