From patchwork Fri Dec 7 16:35:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 153172 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp703474ljp; Fri, 7 Dec 2018 08:35:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wv32ZZLPThs8TcIIjwSoQYwN4/XsvtZGWMyLbvOb7TpTyg48GJMHzn8PnJoaeDXhpZsjpt X-Received: by 2002:a63:7c13:: with SMTP id x19mr2530364pgc.45.1544200522186; Fri, 07 Dec 2018 08:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544200522; cv=none; d=google.com; s=arc-20160816; b=TlUJa1iDeMQkFTnwwKtPrDUq2K7PQHWLQZRfmbgYMB1IAoPe1gfWF3rkgMeznLKBrQ rFMu/+NA6Q+KRt3UD1s2iDGQwpUfsKoH8YD+E0c0+140YfiRi/Z/E9jvziHHBkGGvISK VsNvWRlKvc+m70Fqub6Xcxc9EYDLfMpJVJKRWZAIo6Se1jPFbe7r+kc2I1zpBarFBpWR LbSplTmL3ojRUMjM0Nb34u7c4uHrSFd2kHpFVL7i0jjwMuWs+PBSBO4AgwuDNNCzQux3 hlx+xQNYSMLO8COZzzPIetCg5G1+9sgRyOwTwfL2kVxwxETAOA6fjyV5kVoDaEEms4uK lBQg== 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=hDmi7dOsrT7Ls8ZplnW9Bia+hVR0nA2HPS973FGJUuQ=; b=K8K21HqP05yOctwXSyVRZqpLBIbEKQ42Az/SVuqNe5Dn7MxxjRxiy8nOP+KL4k0jtX t1SIkpkb6e/McN0ljn2GR0JoS4pK3RTLG7DyeU8SbMM7a8z+z6fjtcFhYPCD86wb6li+ MQ3tmmAiigpR6HmYwLn2wPWAWqEE+0DoLTCGixOh+ERJNYRWVt/z6k1Fx9uSN+Sxe/ns vCjCe6czuDORViY4XH4mMJp57sktIe1npvF4Qp3sCZONcs7cESiYPPkvm8ZNERkn9nMY ZAJTqz+d5EDsYrmFm9us6cFXaOqcX/IXRgOkOrbjSPVfVtCOVdr5HlsQTXYpJwHICiLY lgKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wqt5pzyV; 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 14si2941246pgx.178.2018.12.07.08.35.21; Fri, 07 Dec 2018 08:35:22 -0800 (PST) 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=Wqt5pzyV; 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 S1726159AbeLGQfU (ORCPT + 31 others); Fri, 7 Dec 2018 11:35:20 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36028 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbeLGQfT (ORCPT ); Fri, 7 Dec 2018 11:35:19 -0500 Received: by mail-wr1-f67.google.com with SMTP id u3so4405898wrs.3 for ; Fri, 07 Dec 2018 08:35:18 -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=hDmi7dOsrT7Ls8ZplnW9Bia+hVR0nA2HPS973FGJUuQ=; b=Wqt5pzyVek2bYy/i6/ZNz1C+LtsCHdt2Ud4zrBF54cIGOcETO1ykgd7c24PEikSSKp /LfVaPydgXv5HSNpcJyP1+zth3ByoCZPx2BNlMn2CI3wlQ4gesuvttSOslwrxJ67SFd9 XBbmQElENCUVvnKvD6+15TJXCQFf136mUodpc= 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=hDmi7dOsrT7Ls8ZplnW9Bia+hVR0nA2HPS973FGJUuQ=; b=N4df9ap4CS5qf2HaWtgcsxQX4ftE7LikgJ66WeCrR8ZoSByAGQgarCHd9UDtHr2SNO wuVFn4/u6Bz6UykhOTGz811sFgf6+aFOGuS7mALYsUL6UtPi6hgeBoX8X2rRt4cMhJr+ qPLXcArRHqjdXeTx0I00NiAF3npGK7iFP+f4XPnuyD9TS7qpy/qmKyj1qNrfU4fT35jv owOZ6RJeU4f7GffkCkWeRLkn919xTGXyiB36IuhG3BaENA69PT9dUhxesGUKQtzHdpPE MbX5QjTw9QSeolejYEg4jOJU5RQnE9NwTZPYNG9GAk0y+cmxh8fNCQocIRc2ZmmzR+8q DgXg== X-Gm-Message-State: AA+aEWYa1z5SVb7zvjyL/Pfn+z/YRk4TexOsAdfeJJBymbuaY/TpoYXD 0hLU47maXgeZhCViLMukheV00g== X-Received: by 2002:adf:ed46:: with SMTP id u6mr2506240wro.262.1544200517571; Fri, 07 Dec 2018 08:35:17 -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 w6sm4268752wme.46.2018.12.07.08.35.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Dec 2018 08:35:16 -0800 (PST) From: Srinivas Kandagatla To: robh+dt@kernel.org, gregkh@linuxfoundation.org, arnd@arndb.de Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, bkumar@qti.qualcomm.com, thierry.escande@linaro.org, Srinivas Kandagatla Subject: [PATCH v2 0/6] misc: Add support to Qualcomm FastRPC driver Date: Fri, 7 Dec 2018 16:35:07 +0000 Message-Id: <20181207163513.16412-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for reviewing the RFC, here is new version addressing the comments from RFC. 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 This patchset has been tested on DB410c(msm8916), DB820c (msm8996), SDM845 Qualcomm SoCs with sample apps like matrix multiply, calculator from Hexagon SDK. You can find more info on how to test this at: https://github.com/96boards/documentation/wiki/Dragonboard-Hexagon-DSP 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 (6): 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 misc: fastrpc: Add support for compat ioctls .../devicetree/bindings/misc/qcom,fastrpc.txt | 73 + drivers/misc/Kconfig | 10 + drivers/misc/Makefile | 1 + drivers/misc/fastrpc.c | 1422 +++++++++++++++++ include/uapi/misc/fastrpc.h | 42 + 5 files changed, 1548 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.19.2