Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1012317ybe; Fri, 13 Sep 2019 09:42:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQfJUaEgI0qD7VTuDzuHpvt9FIOzngE4Cd+ldbU/pHR9AWLFcBbzxzSLDpsPOylmXQDrqj X-Received: by 2002:a17:906:7621:: with SMTP id c1mr24854134ejn.39.1568392929985; Fri, 13 Sep 2019 09:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568392929; cv=none; d=google.com; s=arc-20160816; b=Y0RoQE7dhP8jLoXMx6hfq2Chq0+Bf5O9hs/lSaI46H+fUL4ikZFQgwo5uf16biATMW rKXu9lCb5EWKL74bHdxZCPUhnEF8Bnwgy+xvTaTQ5JSt/rjbOBJNu4jX1SElE9DOJGrB XnnzLoaIybYqSmAD59JRaX1thpOTFWRP9TWPFS0JqPSaatLgKRaKQfbkDHiDUwPKSh4H 7KRfaXeL4PifcgqBAbuOXXxjInpkhTE7fnJEUX0PW6TrWoW+BDBTh4f2e1ny4u2CV2iy H/AZ4ULaT0f2UPP7bxO9vljHcgRsyLhRYTEMqiPSRqL1Z+ilWWAePqbkjVpVTfyJ7zxO lLAw== 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=p4JJ1za/un5ZjDKV8/NetetgT9GSgh4N01CRf3iKlVOt5RxqlPEcPi4e+CfA7Ph7xL D40z+A5/bYN0HPdCNZNZdhl//j3ytKubBWARrfo51EEGyZXZ2d4k8g86x0aA1vp1hnCq ER2MAUa0ME5DUq482s/+grsDzs+6tuyNneyPMHb6UR8wqozb1brCgOkql3/Opt3JVwda OSxxe9LRbOQlTNZzyGvBkAfuveT7JrGSOIo6jwqboVst74RG/0qCClmQYmgW4GfKKgH8 p1i+BERp1VhnDTD7xlsdJ7VQyv3UiqD455r21dx4UzNTC5YjmY5QPpyekqtpBkzHwlGW /ZPA== 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-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 f9si14631556ejx.375.2019.09.13.09.41.46; Fri, 13 Sep 2019 09:42:09 -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=xEXgWcAm; 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 S2391489AbfIMPZp (ORCPT + 99 others); Fri, 13 Sep 2019 11:25:45 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39623 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391346AbfIMPZl (ORCPT ); Fri, 13 Sep 2019 11:25:41 -0400 Received: by mail-wr1-f67.google.com with SMTP id r3so2371876wrj.6 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=ffFhWpFly3g+qA/KToTE88py49DQcE2/bQPpWRv0pIh7e/LUe5XkDgYc5/2KpXdCEA Zb4F+AX1rs5P8gcbtFtJSDmF2EeZqU279ujIKj5Gk6NFJFSJHNivq+GX+Yczj77+woLJ 4MHzUtSGkBQHEDi0Ykripd1g5as3A4l5giKagsHTCeFugBoGqllwNs1y6J1Pj6H/DA70 rzHPMlx6MaYIra3xWA+pp+3GUomnu6hsKbV6sqjoQ4X1W/ycaNtou5iXbKdIFWkzgOnU PYEyk0OaWvphsfr7DkgcjFFgpepLqRgpRmuJoxvbnxZNO4OKvhs6wWNxfEQsmKBL6k3x IPBA== X-Gm-Message-State: APjAAAU7x/oddj2b06sMJmxG0/ZyOr8lIoJ1X7zeRb41KFY6HOT/4W6X KaUMckJKNHOmpZwrl7CG4xja9g== 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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; -- 2.23.0