From patchwork Mon Jul 17 10:10:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 9844425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C7F06037F for ; Mon, 17 Jul 2017 10:11:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DDF427DCD for ; Mon, 17 Jul 2017 10:11:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7245D27F89; Mon, 17 Jul 2017 10:11:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7DC027DCD for ; Mon, 17 Jul 2017 10:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=hmli2CxoCiJk8Y3JN8n+pK7qEcnFlEme++JCZ6FF8II=; b=GkN i8eZn6cbLe6X532gmqOOz6ySTWNGN9sjK69CdhxafGiD0AUbgRIpzOC2nvJZauusflVFA9G45fkbz gcC0tFQ0cDGEyBzpxJfjnHGEIfHbztO+HZbDx9gD5m7Y5CnHylh9hhcj89IEP+95VUu4gOd8ngLNN TsSzZ7EggBciFbb390U4krYcM8c5ion4OiTz0GV7pNa+SvVQEqILgaSh4AOcaC6sfnvQ1O7PXCGox U0ZkXS+ZK3ZJdO8faheh4hiQg09zbBPdzTzG9C2H6kKUQsIQu0qq6NVHbPUpgol+dWzupTWRc6GjF 5iyz5TNq3ybyaa/Nsb7Zjl0dKiX0Gdw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dX2zR-0001qT-TV; Mon, 17 Jul 2017 10:10:57 +0000 Received: from mail-lf0-x235.google.com ([2a00:1450:4010:c07::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dX2zN-0001jM-A6 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jul 2017 10:10:55 +0000 Received: by mail-lf0-x235.google.com with SMTP id t72so82679617lff.1 for ; Mon, 17 Jul 2017 03:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0LSmn2rIi6Y0gwUY31Mg4oG7MvxtItj19DVU2CQLsyQ=; b=FFGMVfI29bLbGJ9+0xlUOBJOQoQ4Wlt1/9UmyX65hEXyRX2qRalydbULYQGocUl8/q tTczl1P8YjCGC0zUc2hrC1bvt+YuHFSa0gTe+yrNm/1Z+/rJP8msftmMRflIfwiV5mFI VwgggtOhXyUYlJG7g1nLsIimyKs7ffFYaOV8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0LSmn2rIi6Y0gwUY31Mg4oG7MvxtItj19DVU2CQLsyQ=; b=rnx78wW8hZt5pxFP4kL47bx9ApF5PFtuOLjAGSRJWJlXxvgP6LdeFLriCG3GhE/3Av A69volRyZiXhloGBKx59pyPkDw3M+Swx1Pw4NAzv7L6f6CJehAounyjZ/UIWBpj9yfFj pH11EZduArvbfwqcsDg2JT64ddY2egfQIEnsyW7KcAoaXMpF/sEgEPK3jvYzAnoBibON wg9ODq+3cnViN7vDi6Xf0FDNFVlUvmekXAbNvRIp3/qvgrtLp5sAitOIKbVlAIfjZrmB 4uBAE9vvaXxt4UJpeSr1u5IAcaP/ErVQ4NqBo5rIBZfWiTu7YJnV1+GR/IGZOvujLGrd ViYw== X-Gm-Message-State: AIVw113IdRzwGi4JJm1A8YbM/I38eZ+9RDhSzhRzuBDbUp6lxtR17RLc S4HaggzhhRnXpGY+ X-Received: by 10.25.16.232 with SMTP id 101mr460558lfq.36.1500286229776; Mon, 17 Jul 2017 03:10:29 -0700 (PDT) Received: from jax.urgonet (h-84-45.A175.priv.bahnhof.se. [79.136.84.45]) by smtp.gmail.com with ESMTPSA id a78sm3780744ljb.66.2017.07.17.03.10.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 03:10:28 -0700 (PDT) From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org Subject: [PATCH] tee: optee: interruptible RPC sleep Date: Mon, 17 Jul 2017 12:10:13 +0200 Message-Id: <1500286213-29560-1-git-send-email-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170717_031053_538544_F4CBC213 X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tiger-yu99 , Jens Wiklander , Jerome Forissier MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: tiger-yu99 Prior to this patch RPC sleep was uninterruptible since msleep() is uninterruptible. Change to use msleep_interruptible() instead. Signed-off-by: Tiger Yu Reviewed-by: Joakim Bech Signed-off-by: Jerome Forissier Signed-off-by: Jens Wiklander --- drivers/tee/optee/rpc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c index 8814eca06021..9488ed1541bc 100644 --- a/drivers/tee/optee/rpc.c +++ b/drivers/tee/optee/rpc.c @@ -140,11 +140,8 @@ static void handle_rpc_func_cmd_wait(struct optee_msg_arg *arg) msec_to_wait = arg->params[0].u.value.a; - /* set task's state to interruptible sleep */ - set_current_state(TASK_INTERRUPTIBLE); - - /* take a nap */ - msleep(msec_to_wait); + /* Go to interruptible sleep */ + msleep_interruptible(msec_to_wait); arg->ret = TEEC_SUCCESS; return;