From patchwork Fri Nov 30 10:46:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10706125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D447413B0 for ; Fri, 30 Nov 2018 10:48:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C45192E6D3 for ; Fri, 30 Nov 2018 10:48:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B70EE2E99A; Fri, 30 Nov 2018 10:48:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FBB62E6D3 for ; Fri, 30 Nov 2018 10:48:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbeK3V4v (ORCPT ); Fri, 30 Nov 2018 16:56:51 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37121 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbeK3V4v (ORCPT ); Fri, 30 Nov 2018 16:56:51 -0500 Received: by mail-wr1-f68.google.com with SMTP id j10so4816101wru.4 for ; Fri, 30 Nov 2018 02:47:58 -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=/jx7LbWVa5Ce2Es6m6aTsyTp+I82kqldODHcmjf78ls=; b=iketsFybB/O2dcvylgjf7WEpISOsctbaZPZAvfv0Rta1FqxGocixw2eRI7pKkcpOKd uhd2IxhcbwOLlGKfQIdVIioT8fB2djfU02yPWZWpgx3J6cwFDJwBiEeXKCNcd9mvSvZr sxOGPHBxEV3zfq/CoKxSAF1K9gcL4ZoiOPh1A= 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=/jx7LbWVa5Ce2Es6m6aTsyTp+I82kqldODHcmjf78ls=; b=DKuXgoIm8HHMe0o1T2vR4ddXSwC28asgYL+vsBbO7FFDn1lVyUptVGiYpAUabcx1Pk MdD2Rtge/eCjTbgHQ+R21PFi+3eJTk+HTfMQWQxn2Co8OnAPd2xf68r1FYSSj8PlmlOg 66e14r4hR8CbqP64FexcydDyeHAS5piCpVA+c8jKZ2YRk9LtT+33YPD3l4TaCq1/2phf 7Oowdwo0aLPAwcagW+u5ssK2ovEeuspa6LG2nIJe92iW3wgpgoQ6pMUP99gTfm4iP0CK 9nJa4mFPaf03q4riKCG7TkkgrkM0Ch5WpcGi2HdA5m+c0IguI4Xgh5AQSYjcuN8L/0xX Ok7w== X-Gm-Message-State: AA+aEWZiHBLVmVGpVRsLcJeyiQSdUn8eHsBGIp9zZesnh6x6bI4HOWeP o9jyA8hp1f0t7eyj7FLfbc5ROQ== X-Google-Smtp-Source: AFSGD/UqvuoVbXsYfnrYAp01sovn8r4WabMD+IMrXK9OayEBl/fNBlvKWpXLQO9uQK9yphbGvZFYHQ== X-Received: by 2002:a5d:538a:: with SMTP id d10mr4346863wrv.202.1543574877741; Fri, 30 Nov 2018 02:47:57 -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 18sm6964211wmm.32.2018.11.30.02.47.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Nov 2018 02:47:57 -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: [RFC PATCH 0/6] char: Add support to Qualcomm FastRPC driver Date: Fri, 30 Nov 2018 10:46:51 +0000 Message-Id: <20181130104657.14875-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.2 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 X-Virus-Scanned: ClamAV using ClamSMTP 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 Keeping the first version simple, below are few things are 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. Thanks, srini Srinivas Kandagatla (5): char: dt-bindings: Add Qualcomm Fastrpc bindings char: fastrpc: Add Qualcomm fastrpc basic driver model char: fastrpc: Add support for context Invoke method char: fastrpc: Add support for create remote init process char: fastrpc: Add support for dmabuf exporter Thierry Escande (1): char: fastrpc: Add support for compat ioctls .../devicetree/bindings/char/qcom,fastrpc.txt | 73 + drivers/char/Kconfig | 10 + drivers/char/Makefile | 1 + drivers/char/fastrpc.c | 1749 +++++++++++++++++ include/uapi/linux/fastrpc.h | 82 + 5 files changed, 1915 insertions(+) create mode 100644 Documentation/devicetree/bindings/char/qcom,fastrpc.txt create mode 100644 drivers/char/fastrpc.c create mode 100644 include/uapi/linux/fastrpc.h