Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3934547imu; Fri, 30 Nov 2018 08:15:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uzr5oj4m/Pr8QQzEapByIyUZ6R4ZSNL/cY+E9OTPANI1w4t9ThjV7l9pVaJf/qyMFzWllt X-Received: by 2002:a63:9e0a:: with SMTP id s10mr5376484pgd.239.1543594502607; Fri, 30 Nov 2018 08:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543594502; cv=none; d=google.com; s=arc-20160816; b=OLKmNwgvvYWNhY1g0BKXdD2rUE8UOLQ+77wAQyvtt90yxMUairSHeB96d+3DqKThgC luGnbSTCsegDWDR5KG8ZzQ8x5G8TVIZHHsiNeGDLDWDPVQ+b2JlUs0Ho+5tFR3/IxDTj 0hKy3hEyo0+lUbov2prlm+xluESnUmlHbY37SY137e14O2H8NJjGq2oSWXpC70/ipTYw Jkl1/YuLEurmxUqE5X4IFRIGN+RXXFgokrQHhOpUMRb0haBX6R/W8DPcxc3ouXZk1uzm AEZTmsd7v4qOke1pY1utFXsd/KNV6ZT5HERdd+5DOpfMXT7C6rtrCmJV9Tu2pOWgZXAL jHqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6T0Yri4HLdj7Hep4JBrUETODLfSNhI8a2thDpF01qOc=; b=j8aa7JBT4AMYGpYD1+fLKNgOZ8aV0TQg+jPGyJt58US/ukeAy8YCmGjDVLCcuA3Myq S7Ufp45rvR96R0wQpOUwWf38BnbdqLnDm7DRwnO8oa+vT0WAiIzdJNxmOkC2w5h2yo/+ qi2/nvBYWhj/L0/u3wxZcWj/41g3whT49h37Y54X+tstI4hkPAO2bw+gZjxVF7Iyon8G DV368HIQqlf6/uar9ss/j+Pc+CaRVX+xbt4m+WbLX3v0a55Vi3tmydIBW2YY59KWzgOu iRnIgjqTqedBiKGGrJaGcLRdWdfM08tJba3+3Rw/Kj6kho5yz0UxnHAMfA9qpE1Ra6qs sM0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="I84HEa/6"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si5175452pgq.535.2018.11.30.08.14.26; Fri, 30 Nov 2018 08:15:02 -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=@kernel.org header.s=default header.b="I84HEa/6"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726996AbeLADXP (ORCPT + 99 others); Fri, 30 Nov 2018 22:23:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:46994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbeLADXP (ORCPT ); Fri, 30 Nov 2018 22:23:15 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E259620867; Fri, 30 Nov 2018 16:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543594406; bh=0TMm+YuxAQj6SLqp9O4eKuFfuk3UdTULTJYQIdgusLM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I84HEa/6tija6bCML0DDRSlZI93lpZGFp67UWpz7zmBHaTfqOMVSo4maG8lAbQui7 UqVcC3lEJfIYMD+5+6XWefSk8A/tQeV9uN6psIxwlfjA4RBGMcu/qWmzxpPdAuJgoY p5TUolxrmOvOmuHBLdO5/wikt/e+lmhF6pvYwuSE= Date: Fri, 30 Nov 2018 17:13:24 +0100 From: Greg KH To: Srinivas Kandagatla Cc: robh+dt@kernel.org, arnd@arndb.de, 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 Subject: Re: [RFC PATCH 2/6] char: fastrpc: Add Qualcomm fastrpc basic driver model Message-ID: <20181130161324.GA8031@kroah.com> References: <20181130104657.14875-1-srinivas.kandagatla@linaro.org> <20181130104657.14875-3-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181130104657.14875-3-srinivas.kandagatla@linaro.org> User-Agent: Mutt/1.11.0 (2018-11-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 30, 2018 at 10:46:53AM +0000, Srinivas Kandagatla wrote: > This patch adds basic driver model for qualcomm fastrpc. > Each DSP rpmsg channel is represented as fastrpc channel context and > is exposed as a character driver for userspace interface. > Each compute context bank is represented as fastrpc-session-context, > which are dynamically managed by the channel context char device. > > Signed-off-by: Srinivas Kandagatla > --- > drivers/char/Kconfig | 10 ++ > drivers/char/Makefile | 1 + > drivers/char/fastrpc.c | 337 +++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 348 insertions(+) > create mode 100644 drivers/char/fastrpc.c > > diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig > index 9d03b2ff5df6..75fd274c67df 100644 > --- a/drivers/char/Kconfig > +++ b/drivers/char/Kconfig > @@ -552,6 +552,16 @@ config ADI > and SSM (Silicon Secured Memory). Intended consumers of this > driver include crash and makedumpfile. > > +config QCOM_FASTRPC > + tristate "Qualcomm FastRPC" > + depends on ARCH_QCOM || COMPILE_TEST > + depends on RPMSG > + help > + Provides a communication mechanism that allows for clients to > + make remote method invocations across processor boundary to > + applications DSP processor. Say M if you want to enable this > + module. > + > endmenu > > config RANDOM_TRUST_CPU > diff --git a/drivers/char/Makefile b/drivers/char/Makefile > index b8d42b4e979b..30ec9187350e 100644 > --- a/drivers/char/Makefile > +++ b/drivers/char/Makefile > @@ -58,3 +58,4 @@ js-rtc-y = rtc.o > obj-$(CONFIG_XILLYBUS) += xillybus/ > obj-$(CONFIG_POWERNV_OP_PANEL) += powernv-op-panel.o > obj-$(CONFIG_ADI) += adi.o > +obj-$(CONFIG_QCOM_FASTRPC) += fastrpc.o > diff --git a/drivers/char/fastrpc.c b/drivers/char/fastrpc.c > new file mode 100644 > index 000000000000..97d8062eb3e1 > --- /dev/null > +++ b/drivers/char/fastrpc.c > @@ -0,0 +1,337 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. > +// Copyright (c) 2018, Linaro Limited > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define ADSP_DOMAIN_ID (0) > +#define MDSP_DOMAIN_ID (1) > +#define SDSP_DOMAIN_ID (2) > +#define CDSP_DOMAIN_ID (3) > +#define FASTRPC_DEV_MAX 4 /* adsp, mdsp, slpi, cdsp*/ > +#define FASTRPC_MAX_SESSIONS 9 /*8 compute, 1 cpz*/ > +#define FASTRPC_CTX_MAX (256) > +#define FASTRPC_CTXID_MASK (0xFF0) > +#define FASTRPC_DEVICE_NAME "fastrpc" > + > +#define cdev_to_cctx(d) container_of(d, struct fastrpc_channel_ctx, cdev) > + > +static const char *domains[FASTRPC_DEV_MAX] = { "adsp", "mdsp", > + "sdsp", "cdsp"}; > +static dev_t fastrpc_major; Why do you need a whole major number for this? Why not just use the misc interface instead?