Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966426AbbKGBss (ORCPT ); Fri, 6 Nov 2015 20:48:48 -0500 Received: from mail-bn1bon0117.outbound.protection.outlook.com ([157.56.111.117]:31036 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751530AbbKGBqY (ORCPT ); Fri, 6 Nov 2015 20:46:24 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=none action=none header.from=freescale.com; From: "J. German Rivera" To: , , , CC: , , , , , , , , , , , , , Subject: [PATCH v3 00/11] staging: fsl-mc: MC bus MSI support Date: Fri, 6 Nov 2015 19:30:16 -0600 Message-ID: <1446859827-6927-1-git-send-email-German.Rivera@freescale.com> X-Mailer: git-send-email 2.3.3 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD003;1:GocGpWF55Yed12kklM5XWd6A/WxKRtRdeMG/R0GKBF72kLC8xicwrJoVLMTtyHumef0MeX5tbVsQxZVmcEcwuNW/+wFovjnKZk5FtEdaibA62eF//pcftTwgdVDqnKNEu0Q3lcxslGxK/v9Gc+lTGEzgdh/2LZcSRwSWcdDpwgPtj2J9bzHB/aHSbMY2NgdY9+9iICUE8ePY6XYBLcSjQCz5jz7rVvz8FRB2lTFnnhQED3tyJJyqDh6vWGDNTgBMBiaq0GndXipCJ6f8lN0e/u+5x4cFe9CghoPC5GlJjnjuICfk5xA7/O4YOoeR6pvt1ROBHAkTCeJ+TZ0LmJKV8b4Vv2oAiS3bc0NcTVj+7CpDjTAJ+qSdpfpGXAkPvsG7Ci87Z6BAKkjW8bMIu7xVkg== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(5007970100001)(5001960100002)(11100500001)(189998001)(97736004)(6806005)(87936001)(77096005)(104016004)(5008740100001)(5001770100001)(92566002)(50226001)(5003940100001)(86362001)(50986999)(106466001)(2201001)(47776003)(229853001)(105606002)(85426001)(81156007)(50466002)(36756003)(48376002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR0301MB0721;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BN1PR0301MB0721;2:SMh9omtm0YZfT/ACMBo/NqjsYaiOlg8N0VOeB4/wmDMLVZ+awqkm+hoAr9meJ2G77uFD+I3x6tdyImNCQxCCZ0SpkUrPcDLRFwt+Ca+HF3w5uJur3UdCq6YWkwORzBsfE+3E3m1Lhcw7acKxzkXYn8x1z/pqIfOAqNyxw/MN9tE=;3:zQLJjmYmSx+exLgazXy1Mj/fwQCLQMcw1Iu4jkKPVaJLkq1ieQuOS4KGuSO9dC2RAG+T8i/G+aMEaEWOAzH14d9MNiM/D1cAvuxs9DzraaJ2dZIFYURlNJ+MGVLeS4pyKNNv28BaMfwjU7FqVMePA7eVQlBw4iDdjtCXfEOh05AS7vY6m37e4kfPN+7Krm/zw0lZLZAbyXsPTqAnzi9yCySSCURFk89z2+Zf/RX1Mlg=;25:xsW5fBhztJ18/k13OklVdmVUfZqWTJcnaM/+4JIbtCcLc5vpDuEatpCBR9O6GFAkB4pg2UBSJ2WPyFRd0ZO9UxkWlC0LyNMImETzCGHfwTA06tvkJh/X7rn/yTYxY1LwMllQr0Y0mGwr2HMKUCqQouem0BCSTK5EFE58lFepIOZOkjzYtD7U7mxnHEZCu6YA0Ni7Epmm9qPL5Xq4EizfdRE84eaggf/2ivNSMInreofX7sjWjT7cPNpGk9tpnfx3pbTMO2qATYdJtnK3RiCcXA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0721; X-Microsoft-Exchange-Diagnostics: 1;BN1PR0301MB0721;20:iNQAq/92529xfePmxu9A/VgUg2DQLEC/Ixg9vKLh8qR97peG6S+7LxpCjL/9KT/1IbNl+LpMqkZBQ2smFqyhbbJZXMtl9/OoK+pMue89IdbVE1jNLPyHyRbxx6MwCh/oZmrsfSpnitaJrILeovrq+wBAfQ/uZeOHVg8VcGsgnxh2AdnNX5I1tqUu7xpJa5B63oXc1+NAzf4ZBJRi2iUNzo3R2Ep1EIme6k+IzT+qan7q01aiGqHC03SNw8VSBKNhtHNu7K7JwfmPKcy2B83Au/QADtMJUAS6TAWCUnuMVkJMi//FFhAXG7gYrZGPf47bGtxLcwJDsrWczD+sOrPgWyCd4H1UUMsfE2F19H1YIKo=;4:3SkIzUbldRtUmw3KGMXyYXhJDWEMIaOQ0deAPSp0odat2DSyXpNq8p5AB/tjV75CAvG3TclBsi82TApF/RRyUNWqThJxvBIKDC8vGnJn++57itnP68rS1aWQhfCSvUt1M5XSqYuB+YMIlzAnfLEVcxIW/XDS2GZN2tDY4J0u4CVVaA0nZ+qnWqlozvc30zKH/UzYkJNUHpmE3GGcgzurxuH87DmBOvenKQTdPVIfMzHxUcTZO6ucf3jJZJQBLB3deu15yH37Qsw7Icx2icMSqgg1r7alF6pBLiIEe0wIptIqSlyoHcj/aS7jWEiXy7vQz1MJ/QBvCzYLHXlLkze4qzko6Y+k3Ew549dbezLKXyZoV7QyPRtkZFrJ2bzHbk5D X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046);SRVR:BN1PR0301MB0721;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0721; X-Forefront-PRVS: 0753EA505A X-Microsoft-Exchange-Diagnostics: 1;BN1PR0301MB0721;23:eAtWwRG3GjjLri4TH7Yz3l7IZCT6t7/XEjz/sxMiZeHYRA4WTvHb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;24:wNl1w6iLPJF+LqunYL39ZE3ozWux01Kq933HpYfH3O+w9zSDqZPYh1IY03YEs37bCK7Y/lqCif2VbIA4nwpFVPe6+oYfTjCcxog2W5Mwl7I=;20:j/7zGuvlHW3e0RAf17eWBkV/WKu8DS1ze2ftuq9isZa8urjPyxzhdQ6z8zAPN4oHTQ4zNrRre3pgo4JHG99xtg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2015 01:46:20.7068 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0721 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2999 Lines: 73 This patch series addresses the following item from the TODO list for the MC bus driver to exit staging: * Interrupt support. For meaningful driver support we need interrupts, and thus need message interrupt support by the bus driver. MC Bus MSI Support Architecture =============================== A new IRQ domain bus token is added for the FSL-MC bus. An MSI IRQ domain is created for each top-level (root) data-path resource container (DPRC), based on its msi-parent in the device tree (which is the GIC-ITS). Child DPRCs inherit the MSI IRQ domain form their parent DPRC. MC Bus MSI Allocation --------------------- Given the way in which the GIC-ITS works, we need to pre-allocate a block of MSIs in the GIC-ITS for the IRQs of all the DPAA2 objects in the same data-path resource container (DPRC) and for the IRQ of the DPRC iself. This is due to the fact that all the IRQs for DPAA2 objects in the same DPRC (and the DPRC's own IRQ) must use the same "device Id" in the GIC-ITS. Thus, all these IRQs must share the same ITT table in the GIC-ITS, and therefore must be allocated in the GIC-ITS as a block of MSIs for the same "device Id". This is because all the DPAA2 objects in the same DPRC (and the DPRC itself) use the DPRC's SMMU stream ID as their device Id for the GIC-ITS. The DPAA2 Management Complex (MC) firmware does not assign a separate SMMU stream ID to each DPAA2 object. The MC only assigns SMMU stream IDs to DPRCs. In MC terms, the stream ID assigned to a DPRC is known as the DPRC's Isolation Context ID (ICID). As a consequence of having to pre-allocate a block of MSIs in the GIC-ITS, the object allocator of the MC bus driver needs to be extended to provide IRQ allocation services to DPAA2 device drivers and to the DPRC driver. For a given DPAA2 object, MSIs are allocated from the corresponding DPRC's pool of pre-allocated MSIs. The MSI for the DPRC itself is also allocated from this pool. The following are the patches in this series: Patch 1: Added domain bus token DOMAIN_BUS_FSL_MC_MSI Patch 2: Added generic MSI support for FSL-MC devices Patch 3: Added GICv3-ITS support for FSL-MC MSIs Patch 4: Extended MC bus allocator to include IRQs Patch 5: Changed DPRC built-in portal's mc_io to be atomic Patch 6: Populate the IRQ pool for an MC bus instance Patch 7: Set MSI domain for DPRC objects Patch 8: Fixed bug in dprc_probe() error path Patch 9: Added DPRC interrupt handler Patch 10: Added MSI support to the MC bus driver CHANGE HISTORY Changes in v3: - Addressed comment from Marc Zyngier for patch 3. See details in patch 3. Changes in v2: - Addressed comment from Jiang Liu in patch 2. See details in patch 2. - Addressed comment from Dan Carpenter in patch 9 See details in patch 9. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/