From patchwork Fri Feb 1 13:09:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10792749 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 3C651922 for ; Fri, 1 Feb 2019 13:11:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CCAC31A76 for ; Fri, 1 Feb 2019 13:11:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 213E431F81; Fri, 1 Feb 2019 13:11:49 +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 AE54331A76 for ; Fri, 1 Feb 2019 13:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbfBANLr (ORCPT ); Fri, 1 Feb 2019 08:11:47 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55617 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbfBANLF (ORCPT ); Fri, 1 Feb 2019 08:11:05 -0500 Received: by mail-wm1-f66.google.com with SMTP id y139so6017547wmc.5 for ; Fri, 01 Feb 2019 05:11:03 -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=Ii/yIFzorgv8lkQFo9ZE4bXTzg8Ln5fex3jmkqOo5gc=; b=Yy7Q/kCW5mCuskNdBU79fGTLZr4b2xKeft7piZcPu11809VGXO84AogqAWeFOLudZc AVL4QLUFQxwWH0oauMZ/TnTzYxwLA4dSr3nP1xDaOM9bzCcWco+3mnT70VBlptpOermG 7Z2Ds7lmjNYpl1Nq/i7P336ihexxNcgUjf2LU= 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=Ii/yIFzorgv8lkQFo9ZE4bXTzg8Ln5fex3jmkqOo5gc=; b=WAjZHCix5I42Q1nD4rqD53+LjJ6Rjl/F2Jq+jbtGt2MRNn0ghuvAgXwJP4XPNDxXq5 yov01+w7Y9JO5Iqtb6jDKIVxcyBLO1joq4sn3TGyCQBtHBHNrlH5tTd6vTkMm/pvtX1A 5c1pRWJvvU/6ZXyLhZHroUvLXGakpHTWDRHrmK4NA93C3J7K+EWnRWd9FT1Hz/ic92FG /czDdnGNkReSFIj7YNovWoq2kVNASbBnF+3Vy7Ya4E6W0YaLtTQ+kqQuavrwrZje0tsn IDZiJJtBLJAfDvTtJZt/ykII2QQlDJKpAjZjKXAHReLMOz885RgMKCs5QYGfyfOKmN7d R7Og== X-Gm-Message-State: AHQUAuZ/H+AmxNieW8GidLySc/yQCFLnkAxpR2T/9PMW0HCJVDyotrHe zlGP+DPCf2tVI8ZfBCYNZarlNQ== X-Google-Smtp-Source: AHgI3IYRdFpO8JFcQQmrFmya3my2B+zXoaUS/Hg4U5nHSUkRzpSED9M79wBbxMN/zoWgpVkpRWFUuQ== X-Received: by 2002:a1c:f509:: with SMTP id t9mr2560911wmh.76.1549026662944; Fri, 01 Feb 2019 05:11:02 -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 a12sm12563461wro.18.2019.02.01.05.11.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Feb 2019 05:11:02 -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 v5 0/5] misc: Add support to Qualcomm FastRPC driver Date: Fri, 1 Feb 2019 13:09:20 +0000 Message-Id: <20190201130925.27066-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.20.1 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 Thanks for reviewing the v4, here is new version addressing the comments from v4. 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 and QCS404 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 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. 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 | 1366 +++++++++++++++++ include/uapi/misc/fastrpc.h | 41 + 5 files changed, 1496 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