From patchwork Mon Jan 14 19:41:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10763343 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 DA12A17FB for ; Mon, 14 Jan 2019 19:42:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCCCF29EF9 for ; Mon, 14 Jan 2019 19:42:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB5B529F14; Mon, 14 Jan 2019 19:42:56 +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 6135F29F1D for ; Mon, 14 Jan 2019 19:42:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbfANTmP (ORCPT ); Mon, 14 Jan 2019 14:42:15 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40827 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbfANTmO (ORCPT ); Mon, 14 Jan 2019 14:42:14 -0500 Received: by mail-wr1-f68.google.com with SMTP id p4so249123wrt.7 for ; Mon, 14 Jan 2019 11:42:13 -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=wiZisbbakRt+Z0PHj0nHYS0qlLXlPgH++E8Oy4B0iQo=; b=XC40RIRDL4TBODvCy35jmiqNYAU1iglGEDX2oeg8Xw8ChxFe01C5CqonzpktbcwJyh f+GopzIum5Ttn1BNegG3Ov2gpQrglDNa2FoidTFxWeOBgEplx9gu5cYr+e/dkXSGL70L 6mZ8Pa2702ZyEURgxXVyzfsB/hsCwgOpuRo3w= 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=wiZisbbakRt+Z0PHj0nHYS0qlLXlPgH++E8Oy4B0iQo=; b=mFQu8NNBOe8MNEukZ17WjIxz1+ldneu01iPQp/sRlnVPdJdVUqcP4Z4N7SW3kGvfz2 UO5Xb6xc3nWKlD8w8iL0EGBaQK3h5zjxuBOhaW9X5andB2fD3CLdKwRQoC/m9VLigKBe qCF1oc54pJN11Fa4QqPthQAT7MtIx2xkKRYV7uuNDJsz/0LAxmLFUCgRshOQe/P76POg CzgvEBS6ZAjc4CoNBk8oXXWdVfYXECOS2MfGXUt4KGswE2DCO6WFhIsNYL735mIJqRIK oEbA9obDF9pLHl4ROMNLcc9mWwmiN6a+LV8rixduUkl3cm39o5zWo8GG6xeQjKfx3r9w mknw== X-Gm-Message-State: AJcUukcb3BrbiSE7bumPjBsT5hS5VEhqZpisqjbrrrhqMqGV8ffGWczb 5fCps7/4e1PQAvntBpeVhxATog== X-Google-Smtp-Source: ALg8bN4/DbDdQpp4u8ElbhbNP3ERTJ6xcfvOJ4l15up7w0j0/6FRPVmTokfSCkftbQpsRv6BRHNLTw== X-Received: by 2002:adf:a357:: with SMTP id d23mr50868wrb.195.1547494932606; Mon, 14 Jan 2019 11:42:12 -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 b7sm66779996wrs.47.2019.01.14.11.42.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Jan 2019 11:42:11 -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, bkumar@qti.qualcomm.com, linux-arm-msm@vger.kernel.org, thierry.escande@linaro.org, Srinivas Kandagatla Subject: [PATCH v3 0/5] misc: Add support to Qualcomm FastRPC driver Date: Mon, 14 Jan 2019 19:41:07 +0000 Message-Id: <20190114194112.32567-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 v2, here is new version addressing the comments from v2. 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 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 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 | 84 + drivers/misc/Kconfig | 10 + drivers/misc/Makefile | 1 + drivers/misc/fastrpc.c | 1356 +++++++++++++++++ include/uapi/misc/fastrpc.h | 41 + 5 files changed, 1492 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