Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5019082pxj; Wed, 26 May 2021 00:23:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5QvrY4lyvUD4wzPXEum/S4jSU00YkhKpiZvoSnUURLhWkfZBqnTh99s7sUtbwgK0aTccD X-Received: by 2002:a05:6402:1207:: with SMTP id c7mr36263666edw.387.1622013820240; Wed, 26 May 2021 00:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622013820; cv=none; d=google.com; s=arc-20160816; b=AcTro+pVH9BzXlhRZnqOnhxwdJsepK16GC7xgfdNacUqPC1jw4CPSWyAndcrXyuYsF FPMDwua99DbubcmWmFCmO4xc9Vglio1kV4VFS+QiOvhp2r8JZObvfTIXEkBU7ExpmZIq aUkpPoOQCPpOFw/VfUQYr16o+6ty9QIN188RnGxC4Rot5nIBiPFat0OJiaU7LNlbkXIv 6myEp3DCvbckmEkgJsIPt5eXH7AijLvs3ObgfyvLzYJxueYwBbRKzApfBahHYPcrwacS VrPLDv5Lht5RDLfl5rWnkQq+fXR/6ot8DKto69XqdDF+4asP4dpTbWM5PbKP/rdoStsx ijBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KwHge//kTz/5ebCywN3rN3xM9sunivEY/mt7ofdAkP4=; b=MsvwSraC6m3fWIUCUEfbod3dHRjagE0u8DdKKNmrnYo2u5vtaV4NzrBvlZQ1zv4t1V eOxAiIZrTc3xt5GHE3SawWf+plRjwN6yhESLCf7N7GuqozesXFds1FLy3pKT89Yw4/Kh sV3HOGWFOiQkjKJABtWw2kNDEPDl9Er7v5+++A6pw7/jwwp86OoTW/WKSENF4yJ4sZsx IYH9mRZ/i3kY6PFwL+4vB3ybUIkopTalZrABKROOvVeBMJl934OiASaE30n6VaE+8vDX 6T8UitTwtYbX53iC6LTWLKlDM8f/r/QQcUuCyL+D6C5YMpJieLCazZXZ9/0BaXoJh4M1 /6qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id au10si17642813ejc.163.2021.05.26.00.23.15; Wed, 26 May 2021 00:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233004AbhEZHTm (ORCPT + 99 others); Wed, 26 May 2021 03:19:42 -0400 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:39655 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232971AbhEZHTX (ORCPT ); Wed, 26 May 2021 03:19:23 -0400 Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id 275433C04C1; Wed, 26 May 2021 09:11:01 +0200 (CEST) Received: from lxhi-059.adit-jv.com (10.72.93.144) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 26 May 2021 09:11:00 +0200 From: Christoph Gellner To: , CC: , Christoph Gellner Subject: [RFC PATCH 1/3] tee: optee: Allow to freeze the task waiting for tee-supplicant Date: Wed, 26 May 2021 09:09:09 +0200 Message-ID: <20210526070911.31681-2-cgellner@de.adit-jv.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210526070911.31681-1-cgellner@de.adit-jv.com> References: <20210526070911.31681-1-cgellner@de.adit-jv.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.72.93.144] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the system is going to hibernate or suspend it might happen that the tee-supplicant task is frozen first. wait_for_completion_interruptible might get stuck in this case. Add try_to_freeze to allow the waiting task to be frozen while waiting for the response of tee-supplicant. Signed-off-by: Christoph Gellner --- drivers/tee/optee/supp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tee/optee/supp.c b/drivers/tee/optee/supp.c index 322a543b8c27..03c37bae6ac4 100644 --- a/drivers/tee/optee/supp.c +++ b/drivers/tee/optee/supp.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "optee_private.h" struct optee_supp_req { @@ -141,6 +142,8 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params, req->ret = TEEC_ERROR_COMMUNICATION; break; } + + try_to_freeze(); } ret = req->ret; -- 2.32.0.rc0