From patchwork Fri Sep 13 15:25:30 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: 173770 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp297027ilq; Fri, 13 Sep 2019 08:25:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHONgk4c7Xl9BrdAuhiNS3cqIKwXly2NJ8uC0YgiVCqMpNUc2VpKym1LUOGXFPfNa5wFFV X-Received: by 2002:aa7:dcc3:: with SMTP id w3mr48674713edu.202.1568388345825; Fri, 13 Sep 2019 08:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568388345; cv=none; d=google.com; s=arc-20160816; b=ajq8Pr1mc7C8x1/Buf8UVSRw5MbD5jTNGYwdIiRgQrfOGz+yoOY08SaQNnOev1LM9G /PfiCrjD5UVjh+0y+9TJ7Sixao2kcsKdWyQ0+fOaPLHPdt5+6ThK1AsRfAPqc6jkrTyi FpafboiI+po3/BiDy7V2vXPZ6m1NIQJ4rJt1ysDtVPSfcdGSK6Sk/uU7L8ev8j1MdHXi OpIuBy6W7Y4Tttl7LP/ZTG4Kvw+lTCVe+N7G9O8PG5HKPvTOcQlAwVYjZIE6sX8qWdil enLdXrMzgBwXVrHWEGwQ0QDzgy6EE9wpp2S+F1go+eiS2/Fbuzn/NJQE4xlDnJycmhGu x9+w== 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=V4nZUxO6Mm4xe18R5imoxVeMnq5wn7Jg/kL+/NyaL6M=; b=QoxYTzehkmtnxkhvvKcZW0bYf/IlWkDw8nvFmv5SRyLdhX8jpEvo2sr34fT427I87Q d6pUyYFi3UdOfO+jT3whOnsTGr0iYxZcJj5uj5j1lCMKJYFnTGUICiHrdAQyIpkewxZM wyQD2L4d9MQ6Nud9QF2b41InCx4qWamZkcb5QJE6TxYfdqC+IA/f09oZvOXpE7gz3VEr 45xugR35Li0NPhlm/Kxsq7RZd24lHr602yF0EHyR0dt8DqSGWxnRKdkPkcW0I/3/je+J X9o8c+xU4Yu0aiK4H1izZ1051eV3WSapUq0gtjVNQFP1MseTpOTxhaoB0i/eaLGqdW0r wsbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xEXgWcAm; 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 s18si13258228ejb.49.2019.09.13.08.25.45; Fri, 13 Sep 2019 08:25:45 -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=xEXgWcAm; 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 S2391446AbfIMPZm (ORCPT + 15 others); Fri, 13 Sep 2019 11:25:42 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36325 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391347AbfIMPZm (ORCPT ); Fri, 13 Sep 2019 11:25:42 -0400 Received: by mail-wr1-f66.google.com with SMTP id y19so32515692wrd.3 for ; Fri, 13 Sep 2019 08:25:40 -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=V4nZUxO6Mm4xe18R5imoxVeMnq5wn7Jg/kL+/NyaL6M=; b=xEXgWcAmcjCbnlv2PZIcl4tioAQPW+pRHXZ+DDwIDcwrrtMgr3qzqom11PVXxCxWLM rpnWqp2cCPzw2MsLejDa1mjJrJeVnJoa2V29h4sJ1or6BjmehFfFbLaIIBzr63oTwD/U cWLVUpgY77Pykty1tSlJIZvHnZCrr95m6o6xxcyVVZkj9+8Kg+iKiOuzEkXkSDldyaqN jeSmbyKztRbCEANeQIPtJtx+a58FqrFnDfGaj3aEmWGVGO508KlSm1Vu01TC58fMZbiQ 8BlWyVnqIWBWynUp7gEFp0VVLUIdjzAzTLL4V57uqnQNh5NcAWTIEPEmufn8WsImKum3 V2pg== 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=V4nZUxO6Mm4xe18R5imoxVeMnq5wn7Jg/kL+/NyaL6M=; b=F6p7jKYQWbLrnTUYglAvIaQxAWfrvC8XmqcYXWRgtY5jwF2ctV/Bq7MXaGUlr1cXYc FWbdr2kQ/REhMOpa1Pl5IqE4pWrYVX/KOBWB57yOd610EtIhikAYS8uIRQeYbHrxKosX Y5mkbF+fmaav05IEVYuFDNl4JnfsecVyDa68dZzx7s5bD8Q3sZb95y4xth5Da5it124M kJWco8YbnmpY1ISEuCGRBi/LwZ5yj4JtvWsJr4aDDvLTKdRCSClzLzRZQ14ZkAEWTHFt XJY3oq3ZekvBh5PeymgnTXL1CEHn7JeL1AOEvgGSwiUJ/PwtdQuprg9TCE+sxDzoHoKi UI0w== X-Gm-Message-State: APjAAAV1G72AQ4axeRoM4jidykUe8x1G3eGFFOTYUbKZoHZkG+F/XgXM 8bHPyWinRSr6+ebZx+62kY/5Mw== X-Received: by 2002:a5d:4a05:: with SMTP id m5mr11622678wrq.265.1568388339932; Fri, 13 Sep 2019 08:25:39 -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.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Sep 2019 08:25:39 -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 3/5] misc: fastrpc: do not interrupt kernel calls Date: Fri, 13 Sep 2019 17:25:30 +0200 Message-Id: <20190913152532.24484-4-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 the DSP firmware requires some calls to be held until processing has completed: this is to guarantee that memory continues to be accessible. Nevertheless, the fastrpc driver chooses not support the case were requests need to be held for unbounded amounts of time. If such a use-case becomes necessary, this timeout will need to be revisited. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.23.0 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index bc03500bfe60..d2b639dfc461 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -927,8 +927,13 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel, if (err) goto bail; - /* Wait for remote dsp to respond or time out */ - err = wait_for_completion_interruptible(&ctx->work); + if (kernel) { + if (!wait_for_completion_timeout(&ctx->work, 10 * HZ)) + err = -ETIMEDOUT; + } else { + err = wait_for_completion_interruptible(&ctx->work); + } + if (err) goto bail;