From patchwork Fri Sep 13 15:25:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 173772 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp297164ilq; Fri, 13 Sep 2019 08:25:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwH9ewkju4qHzBYZNqWez9gnp3JbgGbKaTqAl6eUVpmm8djj40zL7f504kCrGg5KkJeGHvy X-Received: by 2002:aa7:c50b:: with SMTP id o11mr50243709edq.55.1568388353289; Fri, 13 Sep 2019 08:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568388353; cv=none; d=google.com; s=arc-20160816; b=09eJ4KC3ur1TAfLg0Yx8tDH/drCy0oe0ctnsNYCOUHr+RNL8ZXeiiAWiPyBh22JC8H qlh5+nNQLvB+A1QSJrL+u6otJZxcyOFlMHILtyzTwfYQtgmTe+X+Ew91sJqtuBGFegoU oEkEPcdUb0mbsmu2iy1c7+JLze0H21ZDoHLckdo7w9R+v9muTqeEc31kpvuvvV1x6Mj3 L4HQio4qTNcrtYWWNLGU36XWFWyqSQsdXfLgMBKOEVEpl4iIjqs4HWUIZ00Ziqat+77M jAP04tMhWIxc7SRWJiLOF4RP8dwthnCDazUBJ1kcGkaCB1QewOJQvIJjn/YC7Hgr8mpm I4rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bOYzS8r6FFCe1w6kMt/c64rHO9y9+Q16CQmrviT721s=; b=TQAMifzORBFTBYPiL/ZVXT9uBCBw3u1gWCBr7wA/4qKXp1rdRptmMfSiYlpycy1P1J k4NuqqklTOx4tmS2LZW8sEVhZ8jKlf9i+QEwwhekr6pSntCc/f+4c1DFVbKn6Sxh3c6k qJ/nCnGu06DDlSJmjcXIsKvqmIqX6Oz5ZibuwWC5FJitCnSk1FCEyf3qKIav6S8VBU3h bN6MgoQC7KT+WcG6fb853BywXUZ7gPjfdGPER5Y1XDXfgH5hDMPtNInyX/3q9o8+E2eG SCdygukTlKBUzVxMkktymoiadflUhcCNFsMo4ZxbmPkVYQetGtbX8q3xPYjsMQUPqL2h EZog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TFdL1AcN; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jx9si14638732ejb.218.2019.09.13.08.25.53; Fri, 13 Sep 2019 08:25:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TFdL1AcN; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391476AbfIMPZp (ORCPT + 15 others); Fri, 13 Sep 2019 11:25:45 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37693 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391455AbfIMPZo (ORCPT ); Fri, 13 Sep 2019 11:25:44 -0400 Received: by mail-wr1-f68.google.com with SMTP id i1so31928857wro.4 for ; Fri, 13 Sep 2019 08:25:41 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=bOYzS8r6FFCe1w6kMt/c64rHO9y9+Q16CQmrviT721s=; b=TFdL1AcNXLVgcVLdgEs8GmnKDUPQYd47eafZmqW1SB0DPG1x0WlYI6j0S78cMxlNuK L+0iYzlmdkBL/N6NfA65/iXx3ULpxhxvFF8rUMwsy//9R3VKaI9ZA+SbmBDXQm0bGZu8 fyA2aXG4bs8iJdTIo6XBFuZwdUU6FGdO5TNEUtIEyeNknU1bNVX1VRGMZkHjjfP8ZOHl +eB//bCZ9KdSmLfLAVRDXX1WAh3shOORm5NdZM32zjIgk8uoc9Cj6TEqOw/anaUAFLfw CLqGQqSPimZAubkFQs9HnU57zZ2KHcB4E/VkR5VbbFY0RS/d56IBw7ZA9dfDlyRXpNXX 08MQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=bOYzS8r6FFCe1w6kMt/c64rHO9y9+Q16CQmrviT721s=; b=L9+/fT1Aibo74/xEF6pMfxsS9gLpvnwvOub+58CstPW2p1SRHLhwQ3gecDAcWXksss o0Oqqw0b7p4WxDVgFLhA+SA0C2MZ3WGlDt8213HwYXJ9CukDGWQUOPsmXFb7hCvvP/Tb lrnJ5kPbdoswOt25NNjz40MGcO1QU5EiEDbIjyhE9G3EOb+dghIpVVHAPTzwwaFx7bH6 WKqEw9yZksoi8/4KLySAg+RjfP5+HNasuiyN5OZ+i1tG31nOuUNxZDP/PV6AIDZQlPbu QPbdGge0uBiZf6Y01W3UZaWq5kfKThK+Jtot4Gy+Qf17LWf9G+p9nTKJqUzQjWRo8n1d P2pg== X-Gm-Message-State: APjAAAVqn68vxgAJmENpsX41JXb32igXLZXfbjQjjos+kcZ/3usw2Eda jtvG5YJI6CglBBKGBYsiHmgE5w== X-Received: by 2002:a5d:5450:: with SMTP id w16mr19578762wrv.55.1568388341124; Fri, 13 Sep 2019 08:25:41 -0700 (PDT) Received: from localhost.localdomain (69.red-83-35-113.dynamicip.rima-tde.net. [83.35.113.69]) by smtp.gmail.com with ESMTPSA id d9sm48717728wrc.44.2019.09.13.08.25.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Sep 2019 08:25:40 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, gregkh@linuxfoundation.org, arnd@arndb.de, srinivas.kandagatla@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 4/5] misc: fastrpc: handle interrupted contexts Date: Fri, 13 Sep 2019 17:25:31 +0200 Message-Id: <20190913152532.24484-5-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913152532.24484-1-jorge.ramirez-ortiz@linaro.org> References: <20190913152532.24484-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Buffers owned by a context that has been interrupted either by a signal or a timeout might still be being accessed by the DSP. delegate returning the associated memory to a later time when the device is released. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.23.0 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index d2b639dfc461..40b48db032b5 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -952,12 +952,13 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel, } bail: - /* We are done with this compute context, remove it from pending list */ - spin_lock(&fl->lock); - list_del(&ctx->node); - spin_unlock(&fl->lock); - fastrpc_context_put(ctx); - + if (err != -ERESTARTSYS && err != -ETIMEDOUT) { + /* We are done with this compute context */ + spin_lock(&fl->lock); + list_del(&ctx->node); + spin_unlock(&fl->lock); + fastrpc_context_put(ctx); + } if (err) dev_dbg(fl->sctx->dev, "Error: Invoke Failed %d\n", err);