From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D45A0C28CF8 for ; Tue, 20 Nov 2018 15:40:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF972206BB for ; Tue, 20 Nov 2018 15:39:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="wUURfH+u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF972206BB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727488AbeKUCJg (ORCPT ); Tue, 20 Nov 2018 21:09:36 -0500 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51]:31025 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725851AbeKUCJf (ORCPT ); Tue, 20 Nov 2018 21:09:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3kHm8MYX5v5yrDiNnxrDo6zLUwQT5WEakYZKQWe3AfA=; b=wUURfH+uyC9MiujtcnHNh51c3P0cUEelYoY0VtCjxjWeMRBERvtMD6naHu1co/Et0+9Fl6x/96XjyB6d3OnaN/Q/6l05w5lJx5QmG8c3o2qbwccMBZywlTZqrH50ZjeGVGqEAXFohfYcHkoiiJHbQUdpImePuAqahG/OnrdCrHg= Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com (10.172.255.18) by VI1PR0402MB3758.eurprd04.prod.outlook.com (52.134.15.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.30; Tue, 20 Nov 2018 15:39:43 +0000 Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::78a4:e54f:f26:36d9]) by VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::78a4:e54f:f26:36d9%7]) with mapi id 15.20.1294.045; Tue, 20 Nov 2018 15:39:43 +0000 From: Ioana Ciornei To: "gregkh@linuxfoundation.org" , Laurentiu Tudor CC: "linux-kernel@vger.kernel.org" , "netdev-owner@vger.kernel.org" , Ioana Ciocoi Radulescu , Horia Geanta , Leo Li , Ioana Ciornei Subject: [PATCH v3 0/4] bus: fsl-mc: enhance Management Complex userspace support Thread-Topic: [PATCH v3 0/4] bus: fsl-mc: enhance Management Complex userspace support Thread-Index: AQHUgOdCVUZqm1fvNkuWJ2UuNOh5Nw== Date: Tue, 20 Nov 2018 15:39:43 +0000 Message-ID: <1542728371-6972-1-git-send-email-ioana.ciornei@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR0701CA0037.eurprd07.prod.outlook.com (2603:10a6:800:90::23) To VI1PR0402MB2800.eurprd04.prod.outlook.com (2603:10a6:800:ad::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ioana.ciornei@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0402MB3758;6:G/17dZsbpy69hGD3OIDclYEYliwZhVu0ocauI4F0UKcwKM7AtHvxGIB51bzw3sATFspJPEkGsJEMWRIfvB5mJv1K9Dj7cKQLxoUu1/P+hNvYBYEQ3/7tosV5RxBotlp8W2BzozFYVvvIt+R6V4J02Xw1Vg9oalzE457v8jOFjWMYuTsWkZ/kLK4idoIs1EYWOfSc1OxvQFlbU4HhvNYmIURhVDrvt4yDJTBPBjm7JUQf7jZfRaljAXCZbjgKi3bfRM4ys0LTGKBlaIMBtgDDDje6dNydNEoJtEqaukrp6vbaxkTOfBDtHM8vzZoDHgPCn6FASne3rbXPap8LQJEJQeTkJzyTplWHYmGkuPB+J1oxBsGC9BNrjJpj1fSip+g+S2Ijfmjp37bT8dKuO8A9ryG6gqP+0o7tq1l/0Sd6B0DC2vMVG8XNWvy4QLw2FfPce8F6VP+KMXqaCdAR8bdpBw==;5:k729yYrg5TMNdceENGv8M9RIeD3xCf82BlXh5dtg9vgKnBjL5S8hO1SHxd9lfjV1Y1+R03Jfp4wd5X8Ig0tQ2Gy94pQI6mcFpBDmWRTPSbGlwnWeTFiXBGlJiUXEm9ZMYJHRCoPfApcUEr5C/nRugprB5mgDJgxO3yBmpEl1BP8=;7:VmZkyBRmlyBTtmQeFmcjhPpRu28rZvy3klJanodZy7+KxT0k0XtgC4BYrayPzteLT3rI3Knu+o6TDzQgBNMTOzHJOEPOxZ/XdBB6fcxLA7tHAtPlJZJy2YskLLU2So57Sae1qTCpLm1QvTCBas1FzA== x-ms-office365-filtering-correlation-id: 1f692d0b-6647-42fe-1e53-08d64efe6460 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0402MB3758; x-ms-traffictypediagnostic: VI1PR0402MB3758: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(84791874153150)(275809806118684); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231442)(944501410)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:VI1PR0402MB3758;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0402MB3758; x-forefront-prvs: 08626BE3A5 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(396003)(376002)(366004)(136003)(346002)(189003)(199004)(106356001)(4326008)(26005)(86362001)(5660300001)(105586002)(14454004)(7736002)(386003)(6506007)(53936002)(6116002)(966005)(66066001)(3846002)(102836004)(36756003)(25786009)(6636002)(52116002)(99286004)(2906002)(305945005)(81166006)(8676002)(8936002)(256004)(486006)(44832011)(2616005)(6436002)(476003)(68736007)(54906003)(97736004)(71190400001)(2501003)(71200400001)(110136005)(6486002)(81156014)(478600001)(2900100001)(186003)(316002)(6512007)(6306002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB3758;H:VI1PR0402MB2800.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ygFrz+b9NuQIr4VeEMfUU9F0yu9CsvNeWRJgyzJsJbglA9HOksP6FTGFpfIv67vHS14d2qqd0+HKV8fjEEm4C2i5+NIu+4ycTN56IJurYX86dU/YUMRYg2POPShVH4QQu93m3cRhirAA6m5pUB1ALK9WhEy44NkXZTHF5SHv+O/SUi3gILfFR9dEUGENmy/9EB/8ArqDUVu3y740XFamYh8IZyhtaFpgIBRJbI4SZPkhNyel+7TGE0hV4NoTwDM7AhstEu3igI6aUAhCHkyOJlRjzOqZHGHo+auBQAKh6waewRCZLKcUEFUN9pR50sdgAS+2DZDhVoS5pfSmWhnkkRuW7DjhuPfGgfYSk/Y7JXQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f692d0b-6647-42fe-1e53-08d64efe6460 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2018 15:39:43.7758 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3758 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set adds userspace support in the fsl-mc bus along with a rescan attribute to the root DPRC container. Also, the patches here depend on one other patch submitted but not yet accepted: - https://lkml.org/lkml/2018/11/15/776 An earlier discussion on this functionality can be found here: https://lkml.org/lkml/2018/3/23/941 The FSL_MC_SEND_MC_COMMAND ioctl acts as a direct passthrough to the Manage= ment Complex (or MC) by passing fixed-length command/response pairs. Keeping in = mind that the MC manages DPAA2 hardware resources and provides and object-based abstraction for sofware drivers, the proposed ioctl interface enables users= pace tools to do the following: - create and destroy DPAA2 objects - manage the DPRC container that objects live in (by moving objects betwee= n containers) - establish connections between different objects as needed The ioctl interface is intended for dynamic usecases where DPAA2 objects ne= ed to be created on demand or destroyed so that the underlying hardware resour= ces can be further repurposed. In static usecases, depending on the requirement= s, a firmware configuration file can be used to describe the needed DPAA2 object= s, their attributes or any link between them. Some examples of device drivers that probe on said DPAA2 objects are listed below: - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/= drivers/soc/fsl/dpio - https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/tree/= drivers/net/ethernet/freescale/dpaa2 - https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.gi= t/tree/drivers/crypto/caam/ Having a low-level ioctl interface where the command is passed through to t= he MC without any intervention from the fsl-mc bus reduces the complexity adde= d in the kernel while also making the command structure, in turn the ioctl, very stable. Changes in v2: - use root dprc MC portal by default - create the uapi misc device from the root dprc probe function - remove the rescan dev_attr on the remove path Changes in v3: - use dev_ instead of pr_ - remove dynamic_instance_count and uapi_created variables - do not assign true to a u32 - return the actual error code (the decision to defer is for the caller) Ioana Ciornei (4): bus: fsl-mc: move fsl_mc_command struct in a uapi header bus: fsl-mc: add fsl-mc userspace support bus: fsl-mc: add root dprc rescan attribute bus: fsl-mc: add bus rescan attribute Documentation/ABI/stable/sysfs-bus-fsl-mc | 19 ++++ Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS | 2 + drivers/bus/fsl-mc/Kconfig | 7 ++ drivers/bus/fsl-mc/Makefile | 3 + drivers/bus/fsl-mc/dprc-driver.c | 54 +++++++++- drivers/bus/fsl-mc/fsl-mc-bus.c | 41 ++++++++ drivers/bus/fsl-mc/fsl-mc-private.h | 41 ++++++++ drivers/bus/fsl-mc/fsl-mc-uapi.c | 168 ++++++++++++++++++++++++++= ++++ include/linux/fsl/mc.h | 8 +- include/uapi/linux/fsl_mc.h | 34 ++++++ 11 files changed, 368 insertions(+), 10 deletions(-) create mode 100644 Documentation/ABI/stable/sysfs-bus-fsl-mc create mode 100644 drivers/bus/fsl-mc/fsl-mc-uapi.c create mode 100644 include/uapi/linux/fsl_mc.h --=20 1.9.1