From patchwork Fri Feb 8 13:23:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 157838 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1951189jaa; Fri, 8 Feb 2019 05:23:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IYNWfTkfc1V0uHoz3xTQ1nxCvg6SyKlIpExO5JrtG5kOUt4ScGauiTcVNG1lqRXCt+PaMCD X-Received: by 2002:a17:902:280b:: with SMTP id e11mr22699748plb.269.1549632205676; Fri, 08 Feb 2019 05:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549632205; cv=none; d=google.com; s=arc-20160816; b=IlsCwwQaAFpvBAGsafTqnseEt6vvxagunu4o40VU1MbM35hcfQUYHvU0qsCxJtVHcj Fsfi/eVcRnRce1avsNSeW1j96O2OqPwn80knv0nToK8VkW36KyqyOl5Q0uKDjm3q6mzH lvqvcU6u4/XWHL6z/BaUt3dvHmt5ebwQDhTa4OEDe81xFIfBHRSbPpEpm/WYv9ZZEJeS kVqZbMTBEvB89++b4ZgDBvmVNkiKc25d1Chl0DVbhQpFReyWfdG7421V2U9tfsTUd+IW knydOXJ+ltsbjZO7grS9g31JfimSduxMXugx+IaX0enEr5TKwB9dJK6f6O4g63TkV7Au FfZw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=gF3HRrnToBNb9Vm3Va2jq+6CBn36T82L5pS+JyLAmHc=; b=CkmZpGWlfIudgw0zFpS6GWazOaDYFl3qGzrRyIB/zAxwWFLLOlvAXHBR8j8B9XOmtT eLb9Vaia0AliFnYDEQmmHxKk9qTLtzxDA3i0RLKfI8UVojVgryIkvLYbN9X/fNk54m0x K9Nn7s3HCP+CMi8sHGcq58+2jZv5vjJd9uP6qMnbzfHAKxjtXkeWXAOF+UH+bYeIWO2/ cDkR6ZNZt7H7TMQXbrxMhzQ5h4RHAy8HR2XFMg7Hs0H2ZmMKh87ur0TcnJtYbmRVKscO OJTAKoKI0Ku+IOclx5iT+ew3OdfUZMiPqx3aCdyZie82S3ZUuCdsYigmXXXTDmKenumD VSKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kvx1Kqgg; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 m9si2170078pll.349.2019.02.08.05.23.25; Fri, 08 Feb 2019 05:23:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=kvx1Kqgg; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1727587AbfBHNXY (ORCPT + 7 others); Fri, 8 Feb 2019 08:23:24 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39191 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727470AbfBHNXY (ORCPT ); Fri, 8 Feb 2019 08:23:24 -0500 Received: by mail-wr1-f65.google.com with SMTP id t27so3547236wra.6 for ; Fri, 08 Feb 2019 05:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gF3HRrnToBNb9Vm3Va2jq+6CBn36T82L5pS+JyLAmHc=; b=kvx1KqggRS41/8ecBa+FvibNHlIMvmQZu95hG5hj6LrnqD2m5z7JbjBqpMcoz3it9U BksAI822SxVBtJZsh+aLWi+JH/j3Ng09MrP73yvyKWLZyBzjf2RSyFPDskTQxkchvxkJ q03NKFq4AlI4/aYGQiZpxfVbFB8LGdwv5sbnSo0ES4MW1xL+ddGKxoW/xkD5E6bzWksR 0yTOTGElt64j4uZSX4qDeQvxrOXvtNtom9QGERHwJcXdvd9wyOwlBJWVK9my9lvXGWF/ l1uVLBCisyLMsXJVQCowscjEVWOGgc8YwZBmk/Gvs0lmvt1KDDnwLjZ18sBtOXpa9MwH ZxyQ== 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:mime-version :content-transfer-encoding; bh=gF3HRrnToBNb9Vm3Va2jq+6CBn36T82L5pS+JyLAmHc=; b=WpQswIxVWW0IRZe7wf7+fi+UmpJdJpiBunQop9DkaOHrrjFmWcaWwthNtCFo+qaUts TulvR1BLVECwAibuzQZEYDS7L4et4I8htxJjHx6d4D/L7UiT50Dl+5XM853Kh5cpfV4T TzCUBkzkaSRynvFs9QtTGZahqrLXZ7PssemsL+Y9QII/Vg7yg5WazfVsUV1bHi15++dE Dwd489mU6Ej12m7kotrRP7j1wvwz+HPS8vYqIsPjPWdxkEbMgDbSSNG2caPwC423mnG5 BxUQwuIF3c9hGmi0bxezCGcve8iajJQ0BiaE9IGS2nTBKE4lcY4wb3LIH/PA8wjVvG9o pfxA== X-Gm-Message-State: AHQUAuZDBYoqRd1GyAoQi6rDXgnK5iWGEOSQ/UzGHIjzwsauj7HrToJq 0ksDInYLgApDpBt4vAEx2Jor1Q== X-Received: by 2002:a5d:6850:: with SMTP id o16mr17115689wrw.123.1549632201760; Fri, 08 Feb 2019 05:23:21 -0800 (PST) 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 m21sm3033007wmi.43.2019.02.08.05.23.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Feb 2019 05:23:20 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org, arnd@arndb.de Cc: robh+dt@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, bkumar@qti.qualcomm.com, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v6 0/5] misc: Add support to Qualcomm FastRPC driver Date: Fri, 8 Feb 2019 13:23:01 +0000 Message-Id: <20190208132306.12571-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Thanks for reviewing the v5 here is new version addressing the comments from v6. This patchset adds support to Qualcomm FastRPC driver which implements an IPC (Inter-Processor Communication) mechanism that allows for clients to transparently make remote method invocations across processor boundaries. The below diagram depicts invocation of a single method where the client and objects reside on different processors. An object could expose multiple methods which can be grouped together and referred to as an interface. : ,--------, ,------, ,-----------, ,------, ,--------, : | | method | | | | | | method | | : | Client |------->| Stub |->| Transport |->| Skel |------->| Object | : | | | | | | | | | | : `--------` `------` `-----------` `------` `--------` Client: Linux user mode process that initiates the remote invocation Stub: Auto generated code linked in with the user mode process that takes care of marshaling parameters Transport: Involved in carrying an invocation from a client to an object. This involves two portions: 1) FastRPC Linux kernel driver that receives the remote invocation, queues them up and then waits for the response after signaling the remote side. 2) Service running on the remote side that dequeues the messages from the queue and dispatches them for processing. Skel: Auto generated code that takes care of un-marshaling parameters Object: Method implementation Most of the work is derived from various downstream Qualcomm kernels. Credits to various Qualcomm authors who have contributed to this code. Specially Tharun Kumar Merugu TODO: - Support INIT_STATIC process - Support remote mmap/unmap methods. - Handling secure compute context banks. - Add secure buffer support Change since v5 (https://patchwork.kernel.org/cover/10792749/) : - Fix domain id range check spotted by Thierry - Add missing dma_unmap_sg spotted by Thierry - Add refcounting to invoke context, to make sure that we do not free/unmap buffers when dsp is actively using it. - Rebased on top of char-misc-next branch Changes since v4(https://patchwork.kernel.org/cover/10779341/) : - collected acks for DT from Rob. - Removed unnecessary list safe iteration spotted by Greg KH. - Removed unnecessary syslog spams. - Added more checks to input validity. Changes since v3(https://patchwork.kernel.org/cover/10763343/) : - removed secured property from dt binding, defer it till we add support to secure buffers. - reword various bits in bindings suggested by Rob Herring Changes since v2 (https://lkml.org/lkml/2018/12/7/550) : - removed compat_ioctl specific structures and various cleanups as suggested by Greg KH - replace reg property with label property as suggested by Bjorn - minor content cleanup in bindings as suggested by Mark Rutland Changes since RFC: - moved from char to misc driver as suggested by Greg KH - updated ioctl data structures as suggested by Arnd. - cleaned up and reorganized most of the code from RFC review comments. Srinivas Kandagatla (5): misc: dt-bindings: Add Qualcomm Fastrpc bindings misc: fastrpc: Add Qualcomm fastrpc basic driver model misc: fastrpc: Add support for context Invoke method misc: fastrpc: Add support for create remote init process misc: fastrpc: Add support for dmabuf exporter .../devicetree/bindings/misc/qcom,fastrpc.txt | 78 + drivers/misc/Kconfig | 10 + drivers/misc/Makefile | 1 + drivers/misc/fastrpc.c | 1386 +++++++++++++++++ include/uapi/misc/fastrpc.h | 41 + 5 files changed, 1516 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/qcom,fastrpc.txt create mode 100644 drivers/misc/fastrpc.c create mode 100644 include/uapi/misc/fastrpc.h -- 2.20.1