From patchwork Sun Jun 25 07:47:24 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: 106297 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp944822qgd; Sun, 25 Jun 2017 00:48:14 -0700 (PDT) X-Received: by 10.98.60.157 with SMTP id b29mr4882553pfk.170.1498376894333; Sun, 25 Jun 2017 00:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498376894; cv=none; d=google.com; s=arc-20160816; b=BdTzljZuTFmPkzU4AEwff5V4zOlaJFwrSmlsBa0H2hDtqcUyBm0b5lAjNheDF6ujUT cO+idef0IcXZHdT+OjAVP5jt1rzfBK9ExwwENV+4EifKwf84pE9+ZQX8+78dzzzvLoNL LP9bEAMSFcJ33m7TbopIAxSmiyi7RHLsXBWPPGif7xDJidZnO88InPQS7zBFjopqDISn 73m0UdN0MoB6VztyeJpCxcktAd9TfLJe0hZ0+SYtKwf6tw86S1G5UnrXeBeHmFGqsb/i CSQqfV5j3rnlFGDy1TrAUDtygN8pCkhjeb4dLOZ41MpSXxEl8ckG1FZ/fP070Oh/Ovex jflw== 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=2TPRUwpGObkFEyVSdlYFWz9Qh+9FnJ+0sTa1Rv2+vVQ=; b=U4/novRlcTuPSrtSrMUuLHUV4WN02eECKJV+/vRIDQVDLhdWgYQHV11tVBZIhBhgy6 /Ni9hitRP1+4XnihPSua6QYmWQeOYEq0fmgYDmgXLdIYfNVnOYSqfhE2CHQ7s0gVbqD3 PVLRYWbQ2YhVIxyd82GAnIJ+kRzqWn4gsqklm6nB3Gmr1jG7EJ9LDaZbAIip4f9lHRPX DbXTBGhpJ8v0SA4NsVsvU6ZuXlWXCsR+BsHu8YPCdBdc0FYAi/whnWq1EGs4G5PBZuNG MzH/Bx6UaglQ3YzOIkIXSq5T3kN6rzbjeo7+9ZMlHNPcQ0GoyhcNRYGG7OCaNLT4bk/v hOtw== 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 u2si6529604pge.285.2017.06.25.00.48.14; Sun, 25 Jun 2017 00:48:14 -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 S1751480AbdFYHsF (ORCPT + 25 others); Sun, 25 Jun 2017 03:48:05 -0400 Received: from foss.arm.com ([217.140.101.70]:35038 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751402AbdFYHsD (ORCPT ); Sun, 25 Jun 2017 03:48:03 -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 F1BDA344; Sun, 25 Jun 2017 00:47:57 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F286A3F587; Sun, 25 Jun 2017 00:47: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 v3 6/6] staging: ccree: use signal safe completion wait Date: Sun, 25 Jun 2017 10:47:24 +0300 Message-Id: <1498376846-24136-7-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498376846-24136-1-git-send-email-gilad@benyossef.com> References: <1498376846-24136-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 7c2d88a..2c6937a 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;