From patchwork Wed Oct 9 14:41:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 175621 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp855364ill; Wed, 9 Oct 2019 07:41:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqy42HvcobzhPMTB8ZUA9Plmi1QezNFGK2rmz/sN2K9aiQzg3d5cpnUlVEknt4e0YdJM6Pak X-Received: by 2002:a05:6402:21d6:: with SMTP id bi22mr3260208edb.19.1570632097160; Wed, 09 Oct 2019 07:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570632097; cv=none; d=google.com; s=arc-20160816; b=Yrz/Y7LE04vWDX26bf4MsGrL//bOz0GZdKcR6/sKCj4akjtyNJlbgzLLUbLGAS2Dbk yv/qz+y58rGEIZuAYxfLxnzKFIL4AALw19F5J3TlLJNj48lZQxCOXSjLzelx8miHWPMz E9tmV8xPlQpaMYJEigtZXU2uP17cRKr3mTMQYeoOK3+HeSBFHwH/Z74fMTVm0Dj2wiAb c67WMBmdxL0FsAvtBFhYYec1pwkGENlFo3EziHej7pGTd8hAUn8tzB2jtE7Hik3sHDgY SMYgbaOgMEi+pCRxpB2gcWf0PGBokqEjVYq4a5FuPVd2QsXQpoJOrSCMUMJyn5uS5Sf0 QlCQ== 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=5nBXWrU6aXm7J3BteGnTL1p5DiTQVhK5l9RgM79wd9Q=; b=voIjyAyqIW9STtRCwVo481h/tkR9aY070Si9fsnf+zGsoY+jImuTa4bgl61zfN4Rxe 8OoHYO/SaRQJN4osxSSfcszCBxs3jU+Lof+UMJn4iYfzVx81uAPk3w4EduKiIUwhBKYN 3J5ntVONjtae4G+WY+UqCtGxtKtD0I6iyGb86l2uDuei0txJuj1TbqIAKIoG929XnzZ7 fFdVf89nwhAHDsUA7TEfLluVBKHgCRXcnOFzjKemJyejsvEqM+FakLcmVkyKDRDsD3Vd yu/GsCh7Fxq+57HQ1qI063tWmUz7+PyKkE8SlmJRkm4KFG6M6Y9uj+yHb1ESjfVsVGzK 8uAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Pp/82ul4"; 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 gf9si1238818ejb.230.2019.10.09.07.41.36; Wed, 09 Oct 2019 07:41:37 -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="Pp/82ul4"; 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 S1731400AbfJIOlf (ORCPT + 15 others); Wed, 9 Oct 2019 10:41:35 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46640 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729471AbfJIOlf (ORCPT ); Wed, 9 Oct 2019 10:41:35 -0400 Received: by mail-wr1-f66.google.com with SMTP id o18so3309066wrv.13 for ; Wed, 09 Oct 2019 07:41:31 -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=5nBXWrU6aXm7J3BteGnTL1p5DiTQVhK5l9RgM79wd9Q=; b=Pp/82ul4P/+RGjIomCpUJ4eu9DMl7AC6QuLhmdhJSlAy4pqSVzACr3MFk0Kpfk9hD2 jBrFkVIrdaUzgStNzi01a+MUimxAkCQ5NGzFvOSAHvV7xNx1naxnLKICvuQJegHInhM/ 46Fzhfqqk+yKIbVEwSwkcDuMD773pXrQwrr3LYpvbIri3/t4XHgvOVLhskQqVI1lUHTJ v7fNp9LupQaX5mYOO/S4LLEXxJMiK4IWY/psBVHhdXjwmMsI0Wr9PPm3UVIvGyB2TqLS VSH//ViPVSBfJmxxu5yVkUswa+JZmA0WpwiRYAb+a+Zm5lXgtfZ5GPRd02KTsE6A9YNE 4aFg== 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=5nBXWrU6aXm7J3BteGnTL1p5DiTQVhK5l9RgM79wd9Q=; b=UugJwKlgupy4qL8FcZDmkEXd6wPPQHt8KkORXNJqYtN3VevaEwoyPIr4n8clDImJrt 0tucploUB2o7FusEF0q9+yIx84YH0ajE3ifEwmLD8z21p7l/fcXQ2WCn6sznKjdlX1FE O7ui3+YsTkivMie2C8IXlsd2IOELwx99Y7k8wmK9O0OJ3th0dpRMBKFITjwsw0DDkSL9 Q27CjcKEAwneYh7NwMNibW2qLHbI+652USBtAsOraiUKl8xh0u85/OpuG3SPOBh8DU3r t/GEDRzPKorSG6Gd5caECcn0hAZ1B8oHWNqnVpozdpJ4RYZXSr+ltDR6xIVmcgM0rhzq Ds6A== X-Gm-Message-State: APjAAAWGi7LiXJ7qQE/OraCJe/vur8+OO2pTQesRTFUfVs9LC2a5WO8c kn2BsKOEKP5Qie2TZYaaS7/FvplCUwM= X-Received: by 2002:adf:aacc:: with SMTP id i12mr3240033wrc.15.1570632090761; Wed, 09 Oct 2019 07:41:30 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id b7sm3031770wrx.56.2019.10.09.07.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 07:41:30 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jorge Ramirez-Ortiz , Srinivas Kandagatla Subject: [PATCH v3 1/5] misc: fastrpc: add mmap/unmap support Date: Wed, 9 Oct 2019 15:41:19 +0100 Message-Id: <20191009144123.24583-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191009144123.24583-1-srinivas.kandagatla@linaro.org> References: <20191009144123.24583-1-srinivas.kandagatla@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 From: Jorge Ramirez-Ortiz Support the allocation/deallocation of buffers mapped to the DSP. When the memory mapped to the DSP at process creation is not enough, the fastrpc library can extend it at runtime. This avoids having to do large preallocations by default. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Srinivas Kandagatla Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 181 ++++++++++++++++++++++++++++++++++++ include/uapi/misc/fastrpc.h | 15 +++ 2 files changed, 196 insertions(+) -- 2.21.0 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 47ae84afac2e..aa1249bb581a 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -34,6 +34,7 @@ #define FASTRPC_CTXID_MASK (0xFF0) #define INIT_FILELEN_MAX (64 * 1024 * 1024) #define FASTRPC_DEVICE_NAME "fastrpc" +#define ADSP_MMAP_ADD_PAGES 0x1000 /* Retrives number of input buffers from the scalars parameter */ #define REMOTE_SCALARS_INBUFS(sc) (((sc) >> 16) & 0x0ff) @@ -66,6 +67,8 @@ /* Remote Method id table */ #define FASTRPC_RMID_INIT_ATTACH 0 #define FASTRPC_RMID_INIT_RELEASE 1 +#define FASTRPC_RMID_INIT_MMAP 4 +#define FASTRPC_RMID_INIT_MUNMAP 5 #define FASTRPC_RMID_INIT_CREATE 6 #define FASTRPC_RMID_INIT_CREATE_ATTR 7 #define FASTRPC_RMID_INIT_CREATE_STATIC 8 @@ -89,6 +92,23 @@ struct fastrpc_remote_arg { u64 len; }; +struct fastrpc_mmap_rsp_msg { + u64 vaddr; +}; + +struct fastrpc_mmap_req_msg { + s32 pgid; + u32 flags; + u64 vaddr; + s32 num; +}; + +struct fastrpc_munmap_req_msg { + s32 pgid; + u64 vaddr; + u64 size; +}; + struct fastrpc_msg { int pid; /* process group id */ int tid; /* thread id */ @@ -123,6 +143,9 @@ struct fastrpc_buf { /* Lock for dma buf attachments */ struct mutex lock; struct list_head attachments; + /* mmap support */ + struct list_head node; /* list of user requested mmaps */ + uintptr_t raddr; }; struct fastrpc_dma_buf_attachment { @@ -192,6 +215,7 @@ struct fastrpc_user { struct list_head user; struct list_head maps; struct list_head pending; + struct list_head mmaps; struct fastrpc_channel_ctx *cctx; struct fastrpc_session_ctx *sctx; @@ -269,6 +293,7 @@ static int fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev, return -ENOMEM; INIT_LIST_HEAD(&buf->attachments); + INIT_LIST_HEAD(&buf->node); mutex_init(&buf->lock); buf->fl = fl; @@ -276,6 +301,7 @@ static int fastrpc_buf_alloc(struct fastrpc_user *fl, struct device *dev, buf->phys = 0; buf->size = size; buf->dev = dev; + buf->raddr = 0; buf->virt = dma_alloc_coherent(dev, buf->size, (dma_addr_t *)&buf->phys, GFP_KERNEL); @@ -1130,6 +1156,7 @@ static int fastrpc_device_release(struct inode *inode, struct file *file) struct fastrpc_channel_ctx *cctx = fl->cctx; struct fastrpc_invoke_ctx *ctx, *n; struct fastrpc_map *map, *m; + struct fastrpc_buf *buf, *b; unsigned long flags; fastrpc_release_current_dsp_process(fl); @@ -1151,6 +1178,11 @@ static int fastrpc_device_release(struct inode *inode, struct file *file) fastrpc_map_put(map); } + list_for_each_entry_safe(buf, b, &fl->mmaps, node) { + list_del(&buf->node); + fastrpc_buf_free(buf); + } + fastrpc_session_free(cctx, fl->sctx); fastrpc_channel_ctx_put(cctx); @@ -1179,6 +1211,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) mutex_init(&fl->mutex); INIT_LIST_HEAD(&fl->pending); INIT_LIST_HEAD(&fl->maps); + INIT_LIST_HEAD(&fl->mmaps); INIT_LIST_HEAD(&fl->user); fl->tgid = current->tgid; fl->cctx = cctx; @@ -1284,6 +1317,148 @@ static int fastrpc_invoke(struct fastrpc_user *fl, char __user *argp) return err; } +static int fastrpc_req_munmap_impl(struct fastrpc_user *fl, + struct fastrpc_req_munmap *req) +{ + struct fastrpc_invoke_args args[1] = { [0] = { 0 } }; + struct fastrpc_buf *buf, *b; + struct fastrpc_munmap_req_msg req_msg; + struct device *dev = fl->sctx->dev; + int err; + u32 sc; + + spin_lock(&fl->lock); + list_for_each_entry_safe(buf, b, &fl->mmaps, node) { + if ((buf->raddr == req->vaddrout) && (buf->size == req->size)) + break; + buf = NULL; + } + spin_unlock(&fl->lock); + + if (!buf) { + dev_err(dev, "mmap not in list\n"); + return -EINVAL; + } + + req_msg.pgid = fl->tgid; + req_msg.size = buf->size; + req_msg.vaddr = buf->raddr; + + args[0].ptr = (u64) (uintptr_t) &req_msg; + args[0].length = sizeof(req_msg); + + sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_MUNMAP, 1, 0); + err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc, + &args[0]); + if (!err) { + dev_dbg(dev, "unmmap\tpt 0x%09lx OK\n", buf->raddr); + spin_lock(&fl->lock); + list_del(&buf->node); + spin_unlock(&fl->lock); + fastrpc_buf_free(buf); + } else { + dev_err(dev, "unmmap\tpt 0x%09lx ERROR\n", buf->raddr); + } + + return err; +} + +static int fastrpc_req_munmap(struct fastrpc_user *fl, char __user *argp) +{ + struct fastrpc_req_munmap req; + + if (copy_from_user(&req, argp, sizeof(req))) + return -EFAULT; + + return fastrpc_req_munmap_impl(fl, &req); +} + +static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp) +{ + struct fastrpc_invoke_args args[3] = { [0 ... 2] = { 0 } }; + struct fastrpc_buf *buf = NULL; + struct fastrpc_mmap_req_msg req_msg; + struct fastrpc_mmap_rsp_msg rsp_msg; + struct fastrpc_req_munmap req_unmap; + struct fastrpc_phy_page pages; + struct fastrpc_req_mmap req; + struct device *dev = fl->sctx->dev; + int err; + u32 sc; + + if (copy_from_user(&req, argp, sizeof(req))) + return -EFAULT; + + if (req.flags != ADSP_MMAP_ADD_PAGES) { + dev_err(dev, "flag not supported 0x%x\n", req.flags); + return -EINVAL; + } + + if (req.vaddrin) { + dev_err(dev, "adding user allocated pages is not supported\n"); + return -EINVAL; + } + + err = fastrpc_buf_alloc(fl, fl->sctx->dev, req.size, &buf); + if (err) { + dev_err(dev, "failed to allocate buffer\n"); + return err; + } + + req_msg.pgid = fl->tgid; + req_msg.flags = req.flags; + req_msg.vaddr = req.vaddrin; + req_msg.num = sizeof(pages); + + args[0].ptr = (u64) (uintptr_t) &req_msg; + args[0].length = sizeof(req_msg); + + pages.addr = buf->phys; + pages.size = buf->size; + + args[1].ptr = (u64) (uintptr_t) &pages; + args[1].length = sizeof(pages); + + args[2].ptr = (u64) (uintptr_t) &rsp_msg; + args[2].length = sizeof(rsp_msg); + + sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_MMAP, 2, 1); + err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc, + &args[0]); + if (err) { + dev_err(dev, "mmap error (len 0x%08llx)\n", buf->size); + goto err_invoke; + } + + /* update the buffer to be able to deallocate the memory on the DSP */ + buf->raddr = (uintptr_t) rsp_msg.vaddr; + + /* let the client know the address to use */ + req.vaddrout = rsp_msg.vaddr; + + spin_lock(&fl->lock); + list_add_tail(&buf->node, &fl->mmaps); + spin_unlock(&fl->lock); + + if (copy_to_user((void __user *)argp, &req, sizeof(req))) { + /* unmap the memory and release the buffer */ + req_unmap.vaddrout = buf->raddr; + req_unmap.size = buf->size; + fastrpc_req_munmap_impl(fl, &req_unmap); + return -EFAULT; + } + + dev_dbg(dev, "mmap\t\tpt 0x%09lx OK [len 0x%08llx]\n", + buf->raddr, buf->size); + + return 0; + +err_invoke: + fastrpc_buf_free(buf); + + return err; +} + static long fastrpc_device_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { @@ -1304,6 +1479,12 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int cmd, case FASTRPC_IOCTL_ALLOC_DMA_BUFF: err = fastrpc_dmabuf_alloc(fl, argp); break; + case FASTRPC_IOCTL_MMAP: + err = fastrpc_req_mmap(fl, argp); + break; + case FASTRPC_IOCTL_MUNMAP: + err = fastrpc_req_munmap(fl, argp); + break; default: err = -ENOTTY; break; diff --git a/include/uapi/misc/fastrpc.h b/include/uapi/misc/fastrpc.h index fb792e882cef..07de2b7aac85 100644 --- a/include/uapi/misc/fastrpc.h +++ b/include/uapi/misc/fastrpc.h @@ -10,6 +10,8 @@ #define FASTRPC_IOCTL_INVOKE _IOWR('R', 3, struct fastrpc_invoke) #define FASTRPC_IOCTL_INIT_ATTACH _IO('R', 4) #define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create) +#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap) +#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap) struct fastrpc_invoke_args { __u64 ptr; @@ -38,4 +40,17 @@ struct fastrpc_alloc_dma_buf { __u64 size; /* size */ }; +struct fastrpc_req_mmap { + __s32 fd; + __u32 flags; /* flags for dsp to map with */ + __u64 vaddrin; /* optional virtual address */ + __u64 size; /* size */ + __u64 vaddrout; /* dsp virtual address */ +}; + +struct fastrpc_req_munmap { + __u64 vaddrout; /* address to unmap */ + __u64 size; /* size */ +}; + #endif /* __QCOM_FASTRPC_H__ */ From patchwork Wed Oct 9 14:41:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 175622 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp855370ill; Wed, 9 Oct 2019 07:41:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY1lxV/wvqx8sACjThQyPbSse3SZizplZE/cD5hRfElnUWkpOmbZ/Ew+0HeJMpxVZMu8y5 X-Received: by 2002:a17:906:6d87:: with SMTP id h7mr3225057ejt.4.1570632097540; Wed, 09 Oct 2019 07:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570632097; cv=none; d=google.com; s=arc-20160816; b=t4TMrvWmePWk3D5KuWoigJYZLpmNLd3bMOh5HXLnSlSDM8VpuBXbcXyeAcHyLyhUgq N4BJwlF/Hoqy+zYxwdvHtpDXz5c/WY1hXQoiIEXO3gWz/DZVXshPNIX3Lha+/i+JIGKn 0hyiS7oT59VSjMdWmdpT2Ne7BCaN27UFvWOt1ZGMbk53rkut5cpqBp1z9d2U0NeIK8fV UFs/oJWgjOQCC+PaxSnCPi6De0B+BeUc0vCCe/88mA0N2yAxgc7eY+eLNkw0tQmiNlSc RQHPG8MuL/ZHIx2tGf6OYwwWcI6thWwz0Pv5kZhSACyFtYIzCfNpXkkWulkEmE5YISzn Wm8Q== 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=kcLlMzjMsysWETgQh91f6OPcWKj+qkhd5X668mmqw/Q=; b=Q2YsWpA/Df7T8XVS98J2J9r9yQ8FgJz4AjXSS/qpAqCirYR6Pze76+zbHTJ2vY0Em/ xgRZk80x3D8g37eBNwOfnsUusxP1VFJQYSOBxKTB1xLtQ17wGMw5G490hhT8EYjPIJBO 0YSI/d6cnuZtY9vw7xb+TpaAYncW9AG6splieAf0+zy0cesJFJtsV7yJYdvU89cR7/Fc hwPTbgNmU7rA6K5lo+Mm0jv/CJzVIvUd6SzU0GdE0jfHmQkVUn6+XbvReOHa8EiFLsPx OJKXS44QBZflucaQ99mMpGbetoQK0oXOP3VEXbZ53iVjzKTkd89c7WUhYv4TLmlK2FPi tGKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GWaEyzGq; 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 gf9si1238818ejb.230.2019.10.09.07.41.37; Wed, 09 Oct 2019 07:41:37 -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=GWaEyzGq; 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 S1729471AbfJIOlg (ORCPT + 15 others); Wed, 9 Oct 2019 10:41:36 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41688 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731434AbfJIOlf (ORCPT ); Wed, 9 Oct 2019 10:41:35 -0400 Received: by mail-wr1-f68.google.com with SMTP id q9so3345678wrm.8 for ; Wed, 09 Oct 2019 07:41:34 -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=kcLlMzjMsysWETgQh91f6OPcWKj+qkhd5X668mmqw/Q=; b=GWaEyzGql51eoXnd1+9HbztdXoU4S+/WAXkpE3JiLjoAdSXYFfOCdRlo8ka9teKRo+ qctTklxUCgnX3HTAEi1A/qI8zu4jpaZ8Gpl0WdfdlypBR0CL9S2J6Kf/MT1h2byvXceh QK/dtGGW0CV4g99zEJvCwYenJUQLXrnwtV6F3uoN4j3DxmWgw7W3Io/JU8KvRo5Pcp8L Hdk2SNOFCK/hZLLxkSTEnvE8/h6YMePlmmSNE9eLQk3bWmnXbJspBYFqHiU7dmQb1xOs SHODCutnrqaEqWbryPH3ZYsK4fGW2F3TBYA3Lwu0I1O9fZWYurW1/M2EpF/1Bj4zKuMj H6BA== 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=kcLlMzjMsysWETgQh91f6OPcWKj+qkhd5X668mmqw/Q=; b=fF1lMfOsYSbWxvzGU6bQmOZeLCNKzO0poLaac9gnjuEiF5zV20i33SuKhQgVKxnHm/ vSXAb166COrTscJ+A5klXffXCXnxGwUXYdZTlr9RzU7FK3lr5OEhnp4B+DWcHB/8jaAr tK9ylaDNAZun4vv3n8yDBc9SOhyIEpRyRBoCun2FeLDkyZZkg0kUVCSYU6DhYT97WaKK xnmUkelb0nBCoatsx2tiLPjrsJICEv8j2bdV/SPEdpxQX4SrIZgpO0V9pAzgStQGJD4d OCQK0a6IooiIIBk4hmD1Sv1RiQC77YJaS39nQXnBOBpYlhGrARPWTjJRXOf6X2JoU2Qf 4eBw== X-Gm-Message-State: APjAAAV1nnNswLLGx+pvFPy5k54tEu+gtvp0tPdK/KKWIUj/biyHoB1X mSmvtK0SJwurd6o9Q8BYYMX21g== X-Received: by 2002:adf:de85:: with SMTP id w5mr3185456wrl.278.1570632093491; Wed, 09 Oct 2019 07:41:33 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id b7sm3031770wrx.56.2019.10.09.07.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 07:41:32 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jorge Ramirez-Ortiz , Srinivas Kandagatla Subject: [PATCH v3 3/5] misc: fastrpc: do not interrupt kernel calls Date: Wed, 9 Oct 2019 15:41:21 +0100 Message-Id: <20191009144123.24583-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191009144123.24583-1-srinivas.kandagatla@linaro.org> References: <20191009144123.24583-1-srinivas.kandagatla@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 From: Jorge Ramirez-Ortiz 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 Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.21.0 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index c0fe3419c685..666c431380ce 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -959,8 +959,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; From patchwork Wed Oct 9 14:41:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 175624 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp855657ill; Wed, 9 Oct 2019 07:41:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqy197HLVoHfOgHXaGNKL7O63Jrmg9ImCe2F4AKAM2uEorclj8QsuiofLCAma/akczi2GhSw X-Received: by 2002:a17:906:27c5:: with SMTP id k5mr3104479ejc.173.1570632111689; Wed, 09 Oct 2019 07:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570632111; cv=none; d=google.com; s=arc-20160816; b=OMVbSIuM6ap8xWGYSraJ6wJvzzFK5EBsPcCbUdjPERJtTanLU70M8sgX/3TJiE5rW/ NTtCAc/LSorhFuolTYMYvD2U/tvfXQLB2mq3Jtp8uKab5kSU8dD4tv4vvzFa0zZ1rlTf 9qFIZVrlz3mJOVvw3ozQI3Tki2IWEIWiSvV7iy44v8TULjbzDuz/l8dEHt/8tH31kzbY le6VBkA3hHTb0SUz+EtHVyoHllX6sUsOTThAS/IySMu0qdwAO6lLn7ftvX5XjdEjYZ4l IeMZnkaGkOMdxsE3MsigjoBmcVVo1fVqITvFNlVVB1R0tjas86kI5n7Qpjy4w9LIto1f Ssow== 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=x6OiJB7EuLtp7p4md9nfqD7cxFgmkO+0cPK10Zj1xY4=; b=z6kdzhSdtN4XSQROK3NnHk/cAe38ZfMPG+prIA5bM7HNXaX57cBaZrcS5VEen0DHGe 5IKOCY0iahdHoGJDT1H/1yW2toP+YeO0Kyg+sdh2Q2RrIyJhgq/atRkcPEOMd2uPUSS6 ouQaFU8TpDOFHwlQKoiT+Ce7SxN+7gDrGbUswf5Hycjs7Q380okW2TXW+jTKBwkw4Azn gdgCHphgTSBT/9dxXbp4c9sZ83OuNwhnFSLsADdd+Gk1yZs9UCM3qmg2Gh8Hpf21nkH1 eLF5PamUt1g6J7b2GAMGC77y19li8MRHhGif0wgRFi7Tm1epOTVKqYpcH7O9szGxHHYU itlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S37KM856; 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 si30si1294119ejb.92.2019.10.09.07.41.51; Wed, 09 Oct 2019 07:41:51 -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=S37KM856; 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 S1731586AbfJIOlv (ORCPT + 15 others); Wed, 9 Oct 2019 10:41:51 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36335 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731568AbfJIOlg (ORCPT ); Wed, 9 Oct 2019 10:41:36 -0400 Received: by mail-wm1-f67.google.com with SMTP id m18so2917286wmc.1 for ; Wed, 09 Oct 2019 07:41:35 -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=x6OiJB7EuLtp7p4md9nfqD7cxFgmkO+0cPK10Zj1xY4=; b=S37KM856wHDnECg/1FKkIy1yjXEgnkQZyXIgt16MoukNlQDooW2oElREMEGO9tw42c AN0H2HND1RtIjiWZr5Fo+xtOP9xOk176a+hD22LrL5O9GSyT4botIELjYdWGET/4hcDF MSnQufVUYttCnPzEAqqOarb+lb97gnpLlsqgoN9KOEiH629AypzkAIhnbqv3tknO6SkK FRN+R9m1a/e1/sTZ2XFgbsuZdeP8lIROsVWrKCc9X5BLqc22aK4ZCiTbb0gi/H/ZCFF8 iUyxB5Om0WyMwD3xAeu98dsJPGZ06bln/EFt4pVLcPpPvIdRTLhK3woc13l4ShOYOBVW 1Klw== 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=x6OiJB7EuLtp7p4md9nfqD7cxFgmkO+0cPK10Zj1xY4=; b=FcTgRI+C3DLUTRmS25MNYGDDY9j8Phpkab7hULNR134eUrKjMwBp99zIE+4RKfPw+d eJoR2FGTPg4NeCQLVijmkjnuNRlsYekiXYhgJVriSd1kQuAGEKw7ohYHjg9O+ntiqBDa 5XVtp3EHMQTP7KSeIUZeHqaat5re/+tpj8+ey6DM5NftBN0LN4Woz4D9TaV3Th5iHqfa 4HQR7Lg7jc2b5lTPZ4Msl+2b8XUPrBX+7Iy3TWpa/07lm0iJiaBZGNYgOIAVNW0+5+Fq o+ZBTRAG+VHZjK3iSsFmwE+uezCKV6Ivq7OmJshIjPNA7g6LwQtUkC8+Lptgb3f6GhgA ejWQ== X-Gm-Message-State: APjAAAULjtdRNCeZHkPmFtDSydqFz9oCib9zwx0BaoBuUsP9VihwCQ9P vHZPiUWcPwcsnmBEqypq3yMW0g== X-Received: by 2002:a7b:ce89:: with SMTP id q9mr2928113wmj.2.1570632095145; Wed, 09 Oct 2019 07:41:35 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id b7sm3031770wrx.56.2019.10.09.07.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 07:41:33 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jorge Ramirez-Ortiz , Srinivas Kandagatla Subject: [PATCH v3 4/5] misc: fastrpc: handle interrupted contexts Date: Wed, 9 Oct 2019 15:41:22 +0100 Message-Id: <20191009144123.24583-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191009144123.24583-1-srinivas.kandagatla@linaro.org> References: <20191009144123.24583-1-srinivas.kandagatla@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 From: Jorge Ramirez-Ortiz 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 Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.21.0 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 666c431380ce..eef2cdc00672 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -984,12 +984,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); From patchwork Wed Oct 9 14:41:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 175623 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp855502ill; Wed, 9 Oct 2019 07:41:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzprQBTK++AkI/YHC+Np8vB8Hz8sffhwe/OaGN2wUdRfOjGE3zmpq1iFizICyHbW5xPmhwV X-Received: by 2002:a50:9f66:: with SMTP id b93mr3158975edf.236.1570632104367; Wed, 09 Oct 2019 07:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570632104; cv=none; d=google.com; s=arc-20160816; b=uysX8XH0rDQK2ScznoDjg6fLawqEZFEtir5yFL3/p+7KUa0oyZYSo+/JATCXHS3/q5 7eGk589fbVcRvLon4JGzOu1il6mTipptFtaiKAYncXhKWUTDfWVcqMw7Hshw8ceO3AiP U4BoHezW/SGxlw+jMo1ah1nG+HKkM26LBt2+SjfPIJn0xzbkIEd2tsnpre8AP+ZMxp0a QafCmYDlPhQqS4bo6zas1LWaVul4PIRIvsWilYhYFlfMeP2wzbjNEPLDyCJG/cp1gTTj Mz4P/D/6W/cp1hbxHjUnWQHwb/AZEPAfqOjMiYUXRF8srJ+EE0fp7CJSK9xEJpiu3rRS Qazg== 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=HkWnKjTS7NNaz0B8BlFiWfLhS4jldKU7yfNvUhiWaQM=; b=jRVOC7f/SCwumLsZnqgOR7KgyfJVSRCAOW5rJEhznUJK6pYJ00NxAkq5OWSZ7jhuKQ qpL4r0Wwe5gf+dnCSaIeZfNfHjLcSIE6HaJY7AgXDxLe5/N/imjdVOGwgiMYb3c6nzXD 3oMCOLmwohVqj8GylYn2wmBLPlGJv4LVyFRjEHL09aX9livRPgcmgOXCGZ9+xvAMBl53 HfLemDb6+IcAT9426tyR0JYR9RkXvgJzrQL8orMBaRKZ1sGVzIivAKWwscBXlwTZ1gbo 7NPf/WpKlY6oQOZTFuBDKVnOJ3SFM0omnDO8ux61pAY3OHbtxUdqrQuYLyC43M967s8U vFWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f7ss43sX; 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 f8si1255859ejd.270.2019.10.09.07.41.44; Wed, 09 Oct 2019 07:41:44 -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=f7ss43sX; 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 S1731599AbfJIOlm (ORCPT + 15 others); Wed, 9 Oct 2019 10:41:42 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37927 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731584AbfJIOll (ORCPT ); Wed, 9 Oct 2019 10:41:41 -0400 Received: by mail-wr1-f67.google.com with SMTP id w12so3349291wro.5 for ; Wed, 09 Oct 2019 07:41: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=HkWnKjTS7NNaz0B8BlFiWfLhS4jldKU7yfNvUhiWaQM=; b=f7ss43sXwKeRE+g80ck8yRpx+79MpXlAU1ICqgUsyPCZ2LLoVvxA6BOR3KRt21gjwW kj915Hpw47CWN/pKnCTCFjdRM/v5W+s/gP8vs150QmXsqlTTQOTwS72avXQMVZWJnN7w zKo+Hh6J9IYLXPkRfaF7Ab76QKgZTdMr2EHbyDJ9DLBwwO7YhAOjCf8xeg7skOoPZ1nv ya8FNp987bJwuINtL34bTWlctIy/qGZ5UVjvTb+h2al2y5U2fwK9m3feljXXWwWmPa36 LAFwBkOEVebcAmYlLeNYoSRxrgjlVI1E80f6VOPl5n2DSZaCAuOuebstfC8IHlKoC0RQ o8BA== 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=HkWnKjTS7NNaz0B8BlFiWfLhS4jldKU7yfNvUhiWaQM=; b=ZA9/pP8k5hDalysOafDCGD2ufuqo2f5sbwduvhN6bf75cwd9/SMR/hRBLEBWIfebCO YBlcBkTKmpeVmz4tAcEONqaTR/aBOX1oBONej4oOJ54ttSLtwaV99UgLHSCLuL9de0TS SdzlCgQObyCMVZK6waz1naJ8vAR2OIkXSnE9xegF6ygJCeSurG/g565bDGV43tM0f4ZB LjeQhSwUPSJ86T10ykK3iMhlymA31LRh+qL63JiB0QbjJhrWIGb8aosBxJHBtu8x3nZM JAnZ70lVXX0l3a3k/eMIhONlcBpbJf4XPiUUieL0NcLxm1w2iv5uHXCLBo6YkJwHpbD4 QV7g== X-Gm-Message-State: APjAAAUf7xifP95siQZ1MVlzNN8UDtj7OD3zxvhgsNnbvyF/qiRqqm1I YvEhUBeq7ZW5anohaDl3Npj2xA== X-Received: by 2002:adf:dfc4:: with SMTP id q4mr3238951wrn.302.1570632099807; Wed, 09 Oct 2019 07:41:39 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id b7sm3031770wrx.56.2019.10.09.07.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 07:41:36 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jorge Ramirez-Ortiz , Srinivas Kandagatla Subject: [PATCH v3 5/5] misc: fastrpc: revert max init file size back to 2MB Date: Wed, 9 Oct 2019 15:41:23 +0100 Message-Id: <20191009144123.24583-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191009144123.24583-1-srinivas.kandagatla@linaro.org> References: <20191009144123.24583-1-srinivas.kandagatla@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 From: Jorge Ramirez-Ortiz With the integration of the mmap/unmap functionality, it is no longer necessary to allow large memory allocations upfront since they can be handled during runtime. Tested on QCS404 with CDSP Neural Processing test suite. Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Srinivas Kandagatla Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index eef2cdc00672..b6420aae45b9 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -32,7 +32,7 @@ #define FASTRPC_CTX_MAX (256) #define FASTRPC_INIT_HANDLE 1 #define FASTRPC_CTXID_MASK (0xFF0) -#define INIT_FILELEN_MAX (64 * 1024 * 1024) +#define INIT_FILELEN_MAX (2 * 1024 * 1024) #define FASTRPC_DEVICE_NAME "fastrpc" #define ADSP_MMAP_ADD_PAGES 0x1000