Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1173571ybe; Fri, 13 Sep 2019 12:12:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKu0SeZsm3gHZec+duScVHmdAECfmguxAAUQeoEk7zw68YMpWHTnc7QIbqPsATqaW8xBi8 X-Received: by 2002:a50:ee9a:: with SMTP id f26mr48885052edr.21.1568401945093; Fri, 13 Sep 2019 12:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568401945; cv=none; d=google.com; s=arc-20160816; b=efEdXfAdrT5Jj63mtp9dRR/2OmPfdgpj3PVT/DYO7rH4fVxqc1O86O7P6STO7hxEcq e6H5SbciOBgtoTrzAWbTQXEf8gjxDx54zY1dS8XP6khKHldeMNyPTt2fGOgqb0x8MXUF NXqCvEB+DA8JCZv6RzEa3p8RWMMyVtoZDpLgYHVM70P2qzUJJ3VCOaAqjgxF3ER3gLqb KPFZLZOWGzkyILXXkmn+besIu6hv+3yrgASWj+XjIs+4+zPsql8qNHIvkM+rnzlh5Lmq 6IwIyaLrQD8tkSAp1tojvxVe6yBhXkoDCNr6QSvgA5JppOEHNiIfkxGvBqx8N5NqMWe6 +ipw== 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=TqYMbmZZrprKgflDEpdjw+1TWWR2L/8UpmHeUekry4ZHWizD+tU93Irzs8yJ0sXmKB u4fXd56ItAEtVNZCyYOVQk7vAfXrNfFTF7dQQWKSgMwqvUXFVz3M7vNFGJGT958/T2AE 0JJl5yk5gi7Z+vaTv29hvPfDZ1Ca8RO/Tkduy487+4SmAGv3I3Uri/nv62ZBag6J61eg FmdpTjfXvd2c8uLjd6eU7bvKCBG+6rdGESeD4eGHL/43lcAsaUAjBbiVvkCuo6yWSKiq RU/P3axMaa/SAVaDnIrCV+kHdsqQ+zkJUUvQ2UMgMt91Vf9yj2LKm3tufb4uLL5SkLWc G1rA== 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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q35si19032045eda.122.2019.09.13.12.12.01; Fri, 13 Sep 2019 12:12:25 -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; dkim=pass header.i=@linaro.org header.s=google header.b=TFdL1AcN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391583AbfIMPZv (ORCPT + 99 others); Fri, 13 Sep 2019 11:25:51 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46305 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389457AbfIMPZn (ORCPT ); Fri, 13 Sep 2019 11:25:43 -0400 Received: by mail-wr1-f66.google.com with SMTP id o18so1290437wrv.13 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=YBZ3PA4O6pOKJU+a9PhbWTFW5Cm7QH2tTe+yQ8JA7ajGE/iy//qo/pXYu9ZRThOi78 QBnFci+GFLrT27fEl6vC0lPYoTAw86Pl2SERAPCBkZbJp9em9FCr1aYjL1x3Vel5p2g+ E+2ih/y6SiOQXSSYDaumQfQ+Q/CzVa5QItvFS7Apm/E9W7GjWbMJ4TZRbTSdBVsOQuB8 RFst7VKqI26SZqdCKpWwRL5cY6nmNadU0r1CSOA1ArF8hspp43UioaKn3DsTComfYeSh O/+R8WFzTVuEx1yT104UQ0UsLYSFtHUXODxp5uh/Ra7ZYlVSfOrrz8KqebfdM8nV8rYd 6XBA== X-Gm-Message-State: APjAAAV+shl5mCPaFdM5E3LFjR5/+OlY37Xx9JJx40SVbbyxZsliNEzD 3284JwL8uq2w6lxvUiuNrFTqVZ2oGso= 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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); -- 2.23.0