Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbdFVM0Y (ORCPT ); Thu, 22 Jun 2017 08:26:24 -0400 Received: from mail-co1nam03on0089.outbound.protection.outlook.com ([104.47.40.89]:39239 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753256AbdFVM0U (ORCPT ); Thu, 22 Jun 2017 08:26:20 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; From: Geetha sowjanya To: will.deacon@arm.com, robin.murphy@arm.com, lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org, sudeep.holla@arm.com, iommu@lists.linux-foundation.org Cc: robert.moore@intel.com, lv.zheng@intel.com, rjw@rjwysocki.net, jcm@redhat.com, linux-kernel@vger.kernel.org, robert.richter@cavium.com, catalin.marinas@arm.com, sgoutham@cavium.com, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, geethasowjanya.akula@gmail.com, devel@acpica.org, linu.cherian@cavium.com, Charles.Garcia-Tobin@arm.com, robh@kernel.org, Geetha Sowjanya , Geetha sowjanya Subject: [PATCH v9 3/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 Date: Thu, 22 Jun 2017 17:35:38 +0530 Message-Id: <1498133138-20244-4-git-send-email-gakula@caviumnetworks.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1498133138-20244-1-git-send-email-gakula@caviumnetworks.com> References: <1498133138-20244-1-git-send-email-gakula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0116.INDPRD01.PROD.OUTLOOK.COM (10.174.208.32) To CY1PR0701MB2026.namprd07.prod.outlook.com (10.163.142.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c57820a4-4ca1-4815-4705-08d4b969d8e3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:CY1PR0701MB2026; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;3:VA4HKMpoHXdFcEjvAm9RpQEtPpnj2xqpZJI4P3FsBd+EtCVNqu6N4r8Wpj9Ekuzhv3oezgzez56nlYJiVXOhJfG3yvWIHDkl0Hf1upMBE60flUo/ZHIBK0F3yJP31pPhCmFoVtBefHZ89lYwConh+sDl7y54TGPP+uRFWbfDMzxITWvLYLSx5Ug1r51CGsoZMq/RO/zHnhUpwJrPUREAfYbZLTqRvsGBxq/pFyZGlEiXb2heswAFr0ngMxbULG35BtfnUMSVWYryBykaGivsBaHTkWig+W79/a/SsrhD0He1OTq2YqMLoHeWx8o9GndMiER23RNGkce6A6KTXyvMKA== X-MS-TrafficTypeDiagnostic: CY1PR0701MB2026: X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;25:km3kmcXIsfSUE/epSpme9QJY6Fo+FPAltC5M1R3hPgkN3L+MUItL1RKxSJaF7ul8MskvKu6rp3dJYtJJqm2mI5w+Y1SlrLRCQrWff+Q7cObnK1ugNAa42rQd6A4c/wfLxaJlu2lFXrMqcBUT6jETfx5Fkf7umHN9maOjoTyKWWAXahEvndD6ImuVB1H6rFteGMBjYQ9fnKlyr6y4Vql0E5sctXsnSxZiPQMTrhqc+MAAtEXr2LkHmkPdgp5MYT5z/V7j/OW/j4lMTVWCUiALJvKVSdCTClaH25ssmc2FlrBtQ2wst0PzkDr4eyBPY3WRKP29Q65flQewHi30B2Z8Wp9aKiwvp7A+CHkfi/iGcvFIRR+AUM/IYmf1XE88X7bX9SwjtJVr58YUyACL2+ud9NXGnzZqyO1dSG5VdpkcHhbafC8Gk7/ZE1lzdxmqYUDoeNoUKapaWo1YKJn1YbEDA5mqowuEiRzTdqG4hHT3HogsfqwwkqRwBNsdDMazqh+ITbaoiVxmiTEdRfsULXpc5TpfxWBqyS7wRqI6zZnCsgQ3uq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8ox35Xg7LobpOf0GU= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;20:AnX19vhFbnQJfTvxeoTNQBWAXll01UqDGZ6nIwF0gspATeap9ByLHJtQ6LFDw4pLugVKOVPsdSexPgo31UZG3MqCoc16En4aa6aCHFT4IWRf23JgIE6kVNNop/AxwTRSDgWW/ulVlsC0C6u0PHhxYO5NONLDy3zoF0PqAys+0aJa15nWUMKzkTDIoFSLHZvhBvdGE5CeSol0gRgVs+ooQ7eGbPnmgzqBrPRdMUL0ddATip7sKK0iaEPwG3dFjv3zbVyjmtZc/uDSLvkQRRBZxPWoTnkwIR+Pb70OxBoKJWgM3nBb9oR4ECrfxWRm8XJ1ybNYXHXJ5Bh/j1oREgUJ2FjyLAUaaKDqGYyE04QRc2XhS2CcgMEHDrqGz7uo2sCXvImYPDIIftiwpm9Ee7LpG0xTrECFtgQGDn5GWln74Jj2YPWTMtzHuOPIbgVT8zN19PFw/8D5iQamb7fFKbFvzTeubwcK7T4QLWhorCEN0CjTdMgaL6YwlOXTPR8ekJtdfnmbxDq4DEl8Qzrdh+cduakMI/LLaEsvbWsBDUtfHBqfn0ya/skCJXCW3680x4rmutsssdTLBZSsPV6hKDae2XU2XPJBXoGXCI2il/1gzR8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0701MB2026;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR0701MB2026; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB2026;4:7hBvsMAmf+DfWUMsEZp0jE4dF2nuqUxlmDhZWNVD?= =?us-ascii?Q?0EHCbK7mm1dif23Q6Ob//cud66vGYKOTrbXF/P4SLkkYu9BoayeflnEt9eoV?= =?us-ascii?Q?R907+cJFAOR1j+mh1DJfHe8G1XSoTtQ7URyViLU1n36YkegJsLpGsCwQ8GkK?= =?us-ascii?Q?0a868cdmRagt18vQEAs6Ep1lcjpFGlkdGZG2AOGmZHZnD0aqL5UrdQelu2Ri?= =?us-ascii?Q?ouOa/KxHEz1YUXm/DTAsad26xmVLcssJL/MR26vCedqgmlxvEysN22x9A9eh?= =?us-ascii?Q?RtB8zuz4msKvjBhu8DGBAfZbxkk3DqAErPVvyQNO1A6NeHNo+ZPS1Z4egIU/?= =?us-ascii?Q?YMnwraH6TDl/rRYDo8OjUnOlrfysemtlPGZAs45mC1MRlP8Y6uOYo8fEUex0?= =?us-ascii?Q?03N8V33nUCKnEP2dDHOnDveK3tzLaLNs9tvebwHaXlm2GloYCR43u7djJ3Wn?= =?us-ascii?Q?07WMUwb//5EC9jxD+GOmr5jFHy1ZenLiR31OoB0xVcnT94Vyv4qteJK/yBIG?= =?us-ascii?Q?NAvVRQY3GTOhluflO5XNPXn3mpag4apSH7ID9dRHV4SZqZi5NUEQc9tQp7dH?= =?us-ascii?Q?7ucB+UTeUXj85RW2Y5MqoFBh37pTJ0N7zTbRVzyUwiiVethFmHSs5v1jTQ0c?= =?us-ascii?Q?8Rj79dTdaZugC3/5UykR7mNiQTJnIwRyaU1Db0o9xZIwSR4dIGs5L4eztdkP?= =?us-ascii?Q?as5VqSOMM3hH0iAk0QuLm7aHZSPSCKZ5XCzcUUloCq4dfqdvy0WkjICzhE2/?= =?us-ascii?Q?s9PGvROG5CWL8r+i/k08kvwDNKCNnkJ47Eys9k7mApN7J0QawqXVW6AN0zcX?= =?us-ascii?Q?+sxTbuCTvRHOehom9Phydd+mh+cieoyM56tbtcS6YMT6JPvT2vjxbITS6Pql?= =?us-ascii?Q?88vpQQQ3LLvUhhDaCavnqQVgSJRJwvP0JZdvGx8NnsaMImed5OLSNaCRUMZy?= =?us-ascii?Q?yJ/3dFlmR1ReQPSf53suTWMAlCDuhmpXSAtrQU2phLKUf78Zv51gNZj3yvoF?= =?us-ascii?Q?mcFOF9wWfosAKGdr9Io37bA2jAXH+rajIdQ1LZZiEQ4eN+q9HKOUi6fKab0a?= =?us-ascii?Q?81krY5cbCkmNKiqmTAsu/ojFrFeCw6P9d1xGwC0WhlnYvXJ5LfTSOMCIvU41?= =?us-ascii?Q?d7wg6LHEAI8=3D?= X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39410400002)(39850400002)(39400400002)(39450400003)(39840400002)(54906002)(6506006)(66066001)(36756003)(47776003)(72206003)(110136004)(7736002)(189998001)(6512007)(3846002)(50226002)(81166006)(5009440100003)(8676002)(38730400002)(53936002)(6116002)(6486002)(6666003)(48376002)(42882006)(76176999)(50986999)(50466002)(33646002)(2950100002)(5003940100001)(2906002)(230783001)(7416002)(4326008)(305945005)(25786009)(5660300001)(478600001)(42186005)(110426004)(42262002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB2026;H:localhost.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB2026;23:KbkO5AqzUM6s6/FfdJuBSueI1aJP/CbY57CuA9A?= =?us-ascii?Q?KgAdWE3nqEBd5PlpjXZt7YUbuAgpW/CbU1drzgF7iSyN8ew960Gk2Tqwk2NH?= =?us-ascii?Q?Ii5h5tbXdd5GD6LANfpY6ZTjncmnkead9BURuoKnO/ZUZhVRfeM1cGnrvPjm?= =?us-ascii?Q?ri0oUhXVq8AGUawEmRJ8SsN84qfkovEYFNp6KLifGBzHxyv3YYp4ytSXBf/l?= =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pAJSdYyDfBx2hbQA/sJb/8rXuKEHk+A+f0?= =?us-ascii?Q?VfHOgjuli33myBNmEIq0fneqmnnMc0eUL8d51YCMV1n60COgyfywfG9Ieu4/?= =?us-ascii?Q?SQ2r5PQ2eX/I8htuDnDKYYL6A9FddiMGwafww+cV/W5fpFTVpsUROM1FEif9?= =?us-ascii?Q?U2YAilmB23XrZJG0DwsEfg85KbEFmNEE5mSb6KXHI4KPtx7fdSNI719Pom3V?= =?us-ascii?Q?WsIb2xAeRRXfdNECFWu1Q7soh6SfABdCCHd3sB2JaT1aezcvfWQhC90yBA3I?= =?us-ascii?Q?U6w=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;5:l8VsTkFK6O3IBVj9hrEx7xEWvpAHSzvb87FEzVdkmR+p+2QtUx109W0ctyyVzj9S/JBrt59v2EM0bWDK+2Frj7+4NvIqtFqiyJeblcTt8bKxFGiE2mdkDprH6gSpFXeEseM1YaUdUqPKguU9ju5h2BSmc0s05dvdDQX/hXPLODYn2DetXRkB7p3oFf1XWel4RCe2DKMs61dytXLyFt9H6nJFxq4/9+pnKevRshiEQEQzykGpPQZMoxB0v50HG5BZmm2GXNW6GBeT2zceQNF2W6glahrRUBaWmADGaC26SKttz2XqlbCbFyAc0RutDRcGOPRl/ueCXN1dcTIni6Sz2hTl+qqgIcTIF03fIYZaGic4stMgO/JBG6Ub/WDluXOfbpwI0oeniPefoqzcJ4fHLsEsZfDiZquf4JEph+HuRNLk4i1eDOeLWXgStF/LDKQU0iwofPvLs0cjS5HHQFKmTvzCq8UmE4O2fl/Cy2vE5J0RgMvkjQ8/Fz0ZKQ6f5KxH;24:uQMMUc6Bs5CZ6MEN7z4+ZAuFuFCS6iVH2oLYRiTexlly8zE4BEWW7KY4zTd9qMKpm7Ns6qsJOR7QifN9Aa8oPVVAT9kpX6V67Xz9JK0xe2Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB2026;7:MFA9HXnXAnn4tDPocpD8I6nR9GFp2zAe4q7e8MRPRLaxHS2TzTE7OVvno52+w8ox8Mvppx7iU7WPnCJEbw3A2R6xLikZiQgfOHgLf+PxmtrBPaiG0UqXL1UYQw1SSO8ZrmCl0Ru3ku/df2cT0AmLSnE62T5PyuNEkegANL2TnGsfGehZoBb/FdmAfUeDSAChC5g16OZjPyjfGSnB+lKe4332TSomvh8hS/zLOxccZH0vGvspeVfVdmoqZ5zpJd6zqLQk5fEfa/SrBJOllk2BoPmMya2nw90amET89tYBAlJHJgOD6gUv56FN5afN7T4JmuJatXfqlDxFqjvGhfEGdvowx3jIdw1n/GaHPUMOice5vQjwCTcIZZb3ho1AqBewFZG7r4NIrm+wYdbaoTPjXBCFKuDI3KU+xa8z2k0iIVqzSieAtreUvr495hupGsNtlTRvpHGkHK7PL5Av8Y91IEowVQlw7hO5r+xTI5oO09AjvbU2wUfYGSmR27Bxw63cAL7svABfiPqPI4nhitGLgUnK5xVJTg1w+i/KwX62bUQW+HrlbSMGKMGJZFp8/c8/CX2YX1H9Sz7fsx/dUfVQ/FKZTlBfg+jKUIYp3z+d8yNucWM28drmhQHLjbc0Rx4NVC2ZaC4z3+z0VyKBgBRkBUuS41twjYPmMMdR9fjZC3PdhynvuC+sBoR0eTNMCZ+3+TQnVcotB0AL6aAiGQpsL+VItQMLu2H0mz3pLOde7npl7OUHoEIAe3uu91UGtCbpbECRkNbjqEbSoc7If2LXYYUVWUMrxinRksAsHD5MDQw= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2017 12:25:55.7557 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB2026 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8417 Lines: 262 From: Geetha Sowjanya Cavium ThunderX2 SMMU doesn't support MSI and also doesn't have unique irq lines for gerror, eventq and cmdq-sync. New named irq "combined" is set as a errata workaround, which allows to share the irq line by register single irq handler for all the interrupts. Signed-off-by: Geetha sowjanya --- Documentation/arm64/silicon-errata.txt | 1 + .../devicetree/bindings/iommu/arm,smmu-v3.txt | 1 + drivers/acpi/arm64/iort.c | 54 +++++++---- drivers/iommu/arm-smmu-v3.c | 105 +++++++++++++++----- 4 files changed, 116 insertions(+), 45 deletions(-) diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt index 4693a32..42422f6 100644 --- a/Documentation/arm64/silicon-errata.txt +++ b/Documentation/arm64/silicon-errata.txt @@ -63,6 +63,7 @@ stable kernels. | Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 | | Cavium | ThunderX SMMUv2 | #27704 | N/A | | Cavium | ThunderX2 SMMUv3| #74 | N/A | +| Cavium | ThunderX2 SMMUv3| #126 | N/A | | | | | | | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 | | | | | | diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt index 6ecc48c..a5a1ca4 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt +++ b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt @@ -26,6 +26,7 @@ the PCIe specification. * "priq" - PRI Queue not empty * "cmdq-sync" - CMD_SYNC complete * "gerror" - Global Error activated + * "combined" - Handles above all 4 interrupts. - #iommu-cells : See the generic IOMMU binding described in devicetree/bindings/pci/pci-iommu.txt diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index c166f3e..43e1f13 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -828,6 +828,18 @@ static int __init arm_smmu_v3_count_resources(struct acpi_iort_node *node) return num_res; } +static bool arm_smmu_v3_is_combined_irq(struct acpi_iort_smmu_v3 *smmu) +{ + /* + * Cavium ThunderX2 implementation doesn't not support unique + * irq line. Use single irq line for all the SMMUv3 interrupts. + */ + if (smmu->model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX) + return true; + + return false; +} + static unsigned long arm_smmu_v3_resource_size(struct acpi_iort_smmu_v3 *smmu) { /* @@ -855,26 +867,32 @@ static void __init arm_smmu_v3_init_resources(struct resource *res, res[num_res].flags = IORESOURCE_MEM; num_res++; - - if (smmu->event_gsiv) - acpi_iort_register_irq(smmu->event_gsiv, "eventq", - ACPI_EDGE_SENSITIVE, - &res[num_res++]); - - if (smmu->pri_gsiv) - acpi_iort_register_irq(smmu->pri_gsiv, "priq", - ACPI_EDGE_SENSITIVE, - &res[num_res++]); - - if (smmu->gerr_gsiv) - acpi_iort_register_irq(smmu->gerr_gsiv, "gerror", - ACPI_EDGE_SENSITIVE, - &res[num_res++]); - - if (smmu->sync_gsiv) - acpi_iort_register_irq(smmu->sync_gsiv, "cmdq-sync", + if (arm_smmu_v3_is_combined_irq(smmu)) + acpi_iort_register_irq(smmu->event_gsiv, "combined", ACPI_EDGE_SENSITIVE, &res[num_res++]); + else { + + if (smmu->event_gsiv) + acpi_iort_register_irq(smmu->event_gsiv, "eventq", + ACPI_EDGE_SENSITIVE, + &res[num_res++]); + + if (smmu->pri_gsiv) + acpi_iort_register_irq(smmu->pri_gsiv, "priq", + ACPI_EDGE_SENSITIVE, + &res[num_res++]); + + if (smmu->gerr_gsiv) + acpi_iort_register_irq(smmu->gerr_gsiv, "gerror", + ACPI_EDGE_SENSITIVE, + &res[num_res++]); + + if (smmu->sync_gsiv) + acpi_iort_register_irq(smmu->sync_gsiv, "cmdq-sync", + ACPI_EDGE_SENSITIVE, + &res[num_res++]); + } } static bool __init arm_smmu_v3_is_coherent(struct acpi_iort_node *node) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 2dea4a9..0f83f7d 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -605,6 +605,7 @@ struct arm_smmu_device { struct arm_smmu_priq priq; int gerr_irq; + int combined_irq; unsigned long ias; /* IPA */ unsigned long oas; /* PA */ @@ -1314,6 +1315,29 @@ static irqreturn_t arm_smmu_gerror_handler(int irq, void *dev) return IRQ_HANDLED; } +static irqreturn_t arm_smmu_combined_irq_thread(int irq, void *dev) +{ + struct arm_smmu_device *smmu = dev; + + arm_smmu_evtq_thread(irq, dev); + if (smmu->features & ARM_SMMU_FEAT_PRI) + arm_smmu_priq_thread(irq, dev); + + return IRQ_HANDLED; +} + +static irqreturn_t arm_smmu_combined_irq_handler(int irq, void *dev) +{ + irqreturn_t ret; + + ret = arm_smmu_gerror_handler(irq, dev); + if (ret == IRQ_NONE) { + arm_smmu_cmdq_sync_handler(irq, dev); + return IRQ_WAKE_THREAD; + } + return ret; +} + /* IO_PGTABLE API */ static void __arm_smmu_tlb_sync(struct arm_smmu_device *smmu) { @@ -2230,18 +2254,9 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu) devm_add_action(dev, arm_smmu_free_msis, dev); } -static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu) +static void arm_smmu_setup_unique_irqs(struct arm_smmu_device *smmu) { - int ret, irq; - u32 irqen_flags = IRQ_CTRL_EVTQ_IRQEN | IRQ_CTRL_GERROR_IRQEN; - - /* Disable IRQs first */ - ret = arm_smmu_write_reg_sync(smmu, 0, ARM_SMMU_IRQ_CTRL, - ARM_SMMU_IRQ_CTRLACK); - if (ret) { - dev_err(smmu->dev, "failed to disable irqs\n"); - return ret; - } + int irq, ret; arm_smmu_setup_msis(smmu); @@ -2284,10 +2299,41 @@ static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu) if (ret < 0) dev_warn(smmu->dev, "failed to enable priq irq\n"); - else - irqen_flags |= IRQ_CTRL_PRIQ_IRQEN; } } +} + +static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu) +{ + int ret, irq; + u32 irqen_flags = IRQ_CTRL_EVTQ_IRQEN | IRQ_CTRL_GERROR_IRQEN; + + /* Disable IRQs first */ + ret = arm_smmu_write_reg_sync(smmu, 0, ARM_SMMU_IRQ_CTRL, + ARM_SMMU_IRQ_CTRLACK); + if (ret) { + dev_err(smmu->dev, "failed to disable irqs\n"); + return ret; + } + + irq = smmu->combined_irq; + if (irq) { + /* + * Cavium ThunderX2 implementation doesn't not support unique + * irq lines. Use single irq line for all the SMMUv3 interrupts. + */ + ret = devm_request_threaded_irq(smmu->dev, irq, + arm_smmu_combined_irq_handler, + arm_smmu_combined_irq_thread, + IRQF_ONESHOT, + "arm-smmu-v3-combined-irq", smmu); + if (ret < 0) + dev_warn(smmu->dev, "failed to enable combined irq\n"); + } else + arm_smmu_setup_unique_irqs(smmu); + + if (smmu->features & ARM_SMMU_FEAT_PRI) + irqen_flags |= IRQ_CTRL_PRIQ_IRQEN; /* Enable interrupt generation on the SMMU */ ret = arm_smmu_write_reg_sync(smmu, irqen_flags, @@ -2724,22 +2770,27 @@ static int arm_smmu_device_probe(struct platform_device *pdev) return PTR_ERR(smmu->base); /* Interrupt lines */ - irq = platform_get_irq_byname(pdev, "eventq"); - if (irq > 0) - smmu->evtq.q.irq = irq; - irq = platform_get_irq_byname(pdev, "priq"); + irq = platform_get_irq_byname(pdev, "combined"); if (irq > 0) - smmu->priq.q.irq = irq; + smmu->combined_irq = irq; + else { + irq = platform_get_irq_byname(pdev, "eventq"); + if (irq > 0) + smmu->evtq.q.irq = irq; - irq = platform_get_irq_byname(pdev, "cmdq-sync"); - if (irq > 0) - smmu->cmdq.q.irq = irq; + irq = platform_get_irq_byname(pdev, "priq"); + if (irq > 0) + smmu->priq.q.irq = irq; - irq = platform_get_irq_byname(pdev, "gerror"); - if (irq > 0) - smmu->gerr_irq = irq; + irq = platform_get_irq_byname(pdev, "cmdq-sync"); + if (irq > 0) + smmu->cmdq.q.irq = irq; + irq = platform_get_irq_byname(pdev, "gerror"); + if (irq > 0) + smmu->gerr_irq = irq; + } /* Probe the h/w */ ret = arm_smmu_device_hw_probe(smmu); if (ret) -- 1.7.1