From patchwork Thu Jun 22 13:37:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 106215 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp123857qgd; Thu, 22 Jun 2017 06:38:21 -0700 (PDT) X-Received: by 10.99.113.65 with SMTP id b1mr2697784pgn.275.1498138701471; Thu, 22 Jun 2017 06:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498138701; cv=none; d=google.com; s=arc-20160816; b=Y7Gy45wzG/h4ljkxF9O0KWcwZtnTMv917jvbVXXdbQBxSCZELcAuLv+xC/VF6ljuv2 0LizAyi9pDzpQabaJ8dH3NbEiqxTHZ3CREtLKD9NrMOXG9G5DWI9ZoYUlH4m0S/h+JtD Yb++BHDknS193NSXjmvdm3SwA31n5m7y5lrHboIfx7g+izdfbsMCYiQi5BPz0yTjrMDi k4J97DsIJsvS07x7oVeCxyysJk5505Z0D7v9cSZ6qUVYGyENl8Wha0bFAVCWo1KdmHHY Wz/cqvxwmy+sQLUqUXpWKsic+mA5vr1t4KkiqT+xBZ0Ghlqkua/DZhNnC6MOZQXeuvPY rn+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=PbPmyjhJr7299xtQRFvB8DfEY/XV7BxUnve2Z3+PyHU=; b=DAHJbZPEk5SulOuHt3FjJi8+LTuhCYf1C/nsrvFtgmVIaV1S+eHxXAa3OWiy0hGzFm 4ol9ObnB6ZDsqhYGXvBzWwgmsQ7wgbyJwPvpouYZTSdEJCc7BvdU1HpKCUmHQzsTmLJj KJ4UVMH0yrP094mHMRfiiJXWl5bTK6pk0SQQbQMGW75dO5GpJertqoQ4URZS33MPlcJu WjWkNzixXRQhHEQ6H9mfsjp0rXTfBgrxCVPYt7iLngd0q6tKLezIWDkzNovJ49pwU7EK vPg/c3Jney2OcBphr9nbs9hbl+SYfu95wYhlA5O9mJwx9pR+YaNKIWWkNMpZmNqUAJU3 zisg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si1250314plk.467.2017.06.22.06.38.21; Thu, 22 Jun 2017 06:38:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753595AbdFVNiE (ORCPT + 25 others); Thu, 22 Jun 2017 09:38:04 -0400 Received: from foss.arm.com ([217.140.101.70]:38398 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbdFVNiC (ORCPT ); Thu, 22 Jun 2017 09:38:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 44521344; Thu, 22 Jun 2017 06:37:57 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 824BC3F3E1; Thu, 22 Jun 2017 06:37:55 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org Cc: Ofir Drang , Dan Carpenter Subject: [PATCH v2 7/7] staging: ccree: use signal safe completion wait Date: Thu, 22 Jun 2017 16:37:01 +0300 Message-Id: <1498138623-6126-8-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498138623-6126-1-git-send-email-gilad@benyossef.com> References: <1498138623-6126-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We were waiting for a completion notification of HW DMA operation using an interruptible wait which can result in data corruption if a signal interrupted us while DMA was not yet completed. Fix this by moving to uninterrupted wait. Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver"). Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_request_mgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.1.4 diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c index cffc8de..87f5ab6 100644 --- a/drivers/staging/ccree/ssi_request_mgr.c +++ b/drivers/staging/ccree/ssi_request_mgr.c @@ -382,7 +382,8 @@ int send_request( /* Wait upon sequence completion. * Return "0" -Operation done successfully. */ - return wait_for_completion_interruptible(&ssi_req->seq_compl); + wait_for_completion(&ssi_req->seq_compl); + return 0; } else { /* Operation still in process */ return -EINPROGRESS;