mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
Merge commit '40fac1a66ccf61bdf3afb70c18a5db7791410b22'
* commit '40fac1a66ccf61bdf3afb70c18a5db7791410b22': Revert "tee: optee: interrupt an RPC when supplicant has been killed" Revert "tee: optee: interrupt an RPC depend on shutdown flag" Change-Id: I1f5669dda8bc1d48ff601b47014ade3476ebaa08
This commit is contained in:
@@ -92,7 +92,6 @@ struct optee_supp {
|
||||
struct list_head reqs;
|
||||
struct idr idr;
|
||||
struct completion reqs_c;
|
||||
bool shutdown;
|
||||
};
|
||||
|
||||
struct optee_smc {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <linux/arm-smccc.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
@@ -1353,11 +1352,6 @@ static void optee_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct optee *optee = platform_get_drvdata(pdev);
|
||||
|
||||
/* Tell requesting thread to interrupt an RPC */
|
||||
smp_store_mb(optee->supp.shutdown, true);
|
||||
/* Wait requesting thread to release resources */
|
||||
mdelay(200);
|
||||
|
||||
if (!optee->rpc_param_count)
|
||||
optee_disable_shm_cache(optee);
|
||||
}
|
||||
|
||||
@@ -82,8 +82,6 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params,
|
||||
struct optee_supp_req *req;
|
||||
bool interruptable;
|
||||
u32 ret;
|
||||
int id;
|
||||
struct optee_supp_req *get_req;
|
||||
|
||||
/*
|
||||
* Return in case there is no supplicant available and
|
||||
@@ -116,15 +114,8 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params,
|
||||
* exclusive access again.
|
||||
*/
|
||||
while (wait_for_completion_interruptible(&req->c)) {
|
||||
if (supp->shutdown) {
|
||||
/* Reboot happen, tee-supplicant is dead, interrupt an RPC */
|
||||
interruptable = true;
|
||||
} else {
|
||||
/* Deep sleep, tee-supplicant is freeze, wait tee-supplicant */
|
||||
continue;
|
||||
}
|
||||
|
||||
mutex_lock(&supp->mutex);
|
||||
interruptable = !supp->ctx;
|
||||
if (interruptable) {
|
||||
/*
|
||||
* There's no supplicant available and since the
|
||||
@@ -143,14 +134,6 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params,
|
||||
list_del(&req->link);
|
||||
req->in_queue = false;
|
||||
}
|
||||
|
||||
idr_for_each_entry(&supp->idr, get_req, id) {
|
||||
if (get_req == req) {
|
||||
idr_remove(&supp->idr, id);
|
||||
supp->req_id = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
mutex_unlock(&supp->mutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user