Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753919AbdFWNyb (ORCPT ); Fri, 23 Jun 2017 09:54:31 -0400 Received: from mail-cys01nam02on0046.outbound.protection.outlook.com ([104.47.37.46]:16700 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751488AbdFWNy1 (ORCPT ); Fri, 23 Jun 2017 09:54:27 -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: [RESEND PATCH v9 3/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 Date: Fri, 23 Jun 2017 19:04:36 +0530 Message-Id: <1498224876-5200-1-git-send-email-gakula@caviumnetworks.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0073.INDPRD01.PROD.OUTLOOK.COM (10.174.144.141) To BLUPR0701MB2017.namprd07.prod.outlook.com (10.163.122.12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad1490cd-0313-4a0b-f96e-08d4ba3f5a9c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BLUPR0701MB2017; X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fvuB+9esQ+0SitGIR+AjDP7TtKdpb75VvSR2mNuTHO+MB63x0tyvrMPx2NhaiT1DYISgQ0dzwsNW0xnLnWLtIpbVFcFYvNTfEwc2O+8IqHOHrNjhosUm+yIq7RKqKRE+42hmUBMoaeL+4Lbxt0GxXc0yW2mtOTkmeORU+jJn5/L6bkFq05fOR0SwhKFGimlHeHk9ESLdRa8Mou1pzyR8qtPI3MdLtC7xezDXkvYXhmMDLs265D2hA6gzPnmPQwwyTSy78X1IXyBblx3clH6OMWJNIyA7V08g9x3mnPXNJ86K1Bva7h5ESOlPs2zNKFGG6hECRRgqai9Zt8i9Wx2YqSA7xsGtgCE6ZE2LMjEhOZwAZUXukQ/H1iq4jgOf72DjiZ5PHwZpt2iKelX6VhromWT3HWH8Lj8lIKF6Zbv0YN/eJBBtDiElWl3A6m/zoZC3QfpjiK4mmyp7qHz8+onvQCx2VvSPjo7uHOpyuFYc2NsfmZsfd9kKWrBj5jSAcPl7wcnIx0FaGnSUoDIszeNBqbgNid5JU/lwUrh0Fv7BSJM246Ta0Q3aRb7XihiG3x8uuS1dJR8+Jm/a9pBWjp70fEY1Gf8reVmKaJBi27bZg= 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)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BLUPR0701MB2017;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BLUPR0701MB2017; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB2017;4:d6hyrLgulvlGMHQWFIAYwccqJqMcJesOOzI8ngK+?= =?us-ascii?Q?EEglJJAhoYTHAT5JvZxvNX+pmrTRBT1G6ST2SjRnRUZx+HEQPF4VGakHqwqE?= =?us-ascii?Q?ORRGUXkI2olpr30kMdXdMVOBL2gPNKx8QU+oawNrvhO6RSxE+N806CVZC+Ps?= =?us-ascii?Q?DyerJsC0qJVr09XAE95btO9QTQOUViyY8KxTrCTd3I/j6aL9gOZ64+z7UyGI?= =?us-ascii?Q?c/5XehjUK+/uldsqzAt1Wj8wx971IzoB/AYOAjAlL1IVV0r1Zq6EftVnVZb8?= =?us-ascii?Q?BAcyLmvbqtHHtEkxHJPAzc8YHEI5D261DYVTdfX3S6g+QFohDyxwP6+Vhh3T?= =?us-ascii?Q?weeh+aiwDq4JSkl06KyhmJWhKS8F1UNyJ4Q3ZOUbP2D3Swc4/1L3pFROuMS7?= =?us-ascii?Q?ioAZUoN8344Y5uLvrB+Bui9mgEPDHzob1eIoQUsZolRH7a2wTa7yXGMvpxtR?= =?us-ascii?Q?rKSp1lR1vJzrujTsyBedpnsM6+PuYMTsGMwoLPdDO6+8w9Zo13dMZtExq25T?= =?us-ascii?Q?RR601TZTjFWfl+OfO5R2I8epaMKuVOL1yfiRt+zgQg2eEiuUwvLbbMukqlaH?= =?us-ascii?Q?xTe+Fw0KELI7hfM7yoOOnABVsumhiJEEgECITXdkeoE7CDY85hMNndkK6zld?= =?us-ascii?Q?8NEivdgbbncMRMYJzVTKXblbczf61YDS4uunbOOyTOoIRCiXrkEHP9CZFWcJ?= =?us-ascii?Q?wPgR0NYb6v/mZY10pzg4LlZEcwJoWug6kNkvrSkC/JE5a0/g43dXnZtctxiA?= =?us-ascii?Q?Ese69WI0EYcLWYADSSiw/wXvngIfSTahSoGIrn262FAEZt6VIwhSPItQs0qx?= =?us-ascii?Q?bG43/sZ6PudxEVSgEWj73HjGfIEsHClmbRMwLF2fWjjl+/GtqnTL0pbNeq0l?= =?us-ascii?Q?VtpDqU4zZ7JK9niTNmzdBhcnbhy4smJshrXZvCPHvq3YOaLcj3VCbHndK6Jh?= =?us-ascii?Q?k8iciPhkmEG9yhHZZ4cTOLF5D+0Bl7F54qd834h0DqxCZRCN00viAuolkmfh?= =?us-ascii?Q?0fPQhDd4F3s0OI2xL7JGM7Hxgqtz61l0rdDhfMh/fJ45nPvcRJwA+gIbixK5?= =?us-ascii?Q?rvcCKkcei70ThA1VhYF7+KpyyVFJDt/z2kroCECFzR/SL7FZ2NKvVv3Av7af?= =?us-ascii?Q?KwsSdHXd/kQ=3D?= X-Forefront-PRVS: 0347410860 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(39840400002)(39410400002)(39450400003)(39400400002)(39850400002)(8676002)(189998001)(81166006)(7416002)(305945005)(6486002)(7736002)(50466002)(48376002)(5009440100003)(3846002)(5003940100001)(47776003)(50226002)(66066001)(6506006)(50986999)(6512007)(230783001)(54906002)(36756003)(42186005)(33646002)(4326008)(6666003)(42882006)(38730400002)(478600001)(110136004)(107886003)(72206003)(53936002)(2906002)(5660300001)(25786009)(110426004)(42262002)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB2017;H:localhost.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB2017;23:rqusRkimlKBgtOgDK0gdhwabJjZkplRNsR+Kv1D?= =?us-ascii?Q?RFhjwOLPHSV747KxbXgIwf+O8HT52EyBioDF2lYfTBINQ/O6JUpUZDzpJWDi?= =?us-ascii?Q?sp/qri1pDJzQ6NUcafpQa1kZNcudorfcOz+9/+gjwOsuN6I2q/cdrKNrn3z0?= =?us-ascii?Q?Ly2Vca8Y+rdB/g4rRx+8ueAFIFHa40BmTCmwe/mrKWxRCpb1ZvWeJIH5NL79?= =?us-ascii?Q?y9Bf8VykT+2K87RxhWgKmjquS5DbnzXI+7ioX11amG4hK0g7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A4mmknPuK/D/MqLN70TbeLCWzQRdwbgf5Rg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB2017;6:Nyc7EbhKgbphws/HCypgdzShp/Pv+KvxlWjALmZW?= =?us-ascii?Q?z+ZkNqWQNoHn5LTkWfnZmZtbV0vgOxsFfyQ/7+dT3cEvww02aouVx0KVFqgf?= =?us-ascii?Q?tpQSkHglPgmdjrrxb2D1t8FIWjCnYofxXuXumnTUoIEj7hLhQOm0bCSOrR6p?= =?us-ascii?Q?mJ47Sd3NwWxGWklFatxIDOnlGUZbA1WyMLnWzfedmiO8zHhdufKCVA+pR4R1?= =?us-ascii?Q?kFtUKDgjLWIe57RbvvhjYThk3owaieSMdlUuuiKuuR+dJq2Ym87R6x3nP8u5?= =?us-ascii?Q?jdk7kKEHqKuGd+uKgzuVJI1nV6KEg4bfxsX5Lq/amwL01B8bo4qXtSspJ9mu?= =?us-ascii?Q?fKLQe8oZiu2Qmka0MP1Qdr/jNtUeuX8kDV0a+TAIYO80J1yuQV81Es+1bmyU?= =?us-ascii?Q?XgmqxsDdMTSIl28Bg+aC4HxpWCPPCBTptv6ceOspY07QvVOBH9UhopWn79Zx?= =?us-ascii?Q?2g8NmKVR6yUj4IeOyNlredGzLmoDg5LXTwkIYmjD90xpbjPlWFADwsJm+S1O?= =?us-ascii?Q?MlYyenYYTHYLQvW05/nab7wL29XZlgnUYiIwpsEerD1+aSZyOdG9wW4B5soT?= =?us-ascii?Q?CKU6nHajeMdY9xOalWWkpK82CseXmDq2jclzewYUv/o4Oh8ldPYuqixP9RyU?= =?us-ascii?Q?GK6LPvSKiZC/M44E4e284H7zH+Q1nymb7PQqcJc5VPkmoANTTcrTtQZ4Vmj8?= =?us-ascii?Q?zmhpAOlhGFH7IlhIizLg/Hre5+St+iOopB4A876T1MjVQPOATnkjoLG3iPZn?= =?us-ascii?Q?iBjna0Htx3HsL0dNQpOmEqDJMyMu/sC+q0BhtXjwY35E9ENvLnqQQrXBPyRu?= =?us-ascii?Q?Tsda112HqbgKcwajLGtRcrkCJKEFL5icooGZDf6NCExde+8sqwVMezPcxDet?= =?us-ascii?Q?qPsvk9DmuGCia2prQwoaHChwl164YtMnU8t9yl8l/NSUqxbRqTJWyzqJUbmS?= =?us-ascii?Q?6gS02rlzyMI6YpXnN5r8gN9zSa+CgJn7jj8Kzi9f2q0/8HUfhh1T1Mj6CKKx?= =?us-ascii?Q?wVI=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB2017;5:pAWHA9TU2mzq/DvA7LBEyrABgClK1iidrRuAu1lBvPzYp8e+T7nlX9cqflvrfwK10A+f6Sy6jqoFgKtSOmtV8CGJ42cPYNSGP7lzRQ0w7O810werB0vLNkNDPlhmPDXe2GNKlmQCMnUEJTnHar31mVz/rcboU57v38kTphqZCN7PfdZoLvxnOdBURF9tgeVTXdn3viUm+DQqPbhA78mAih/q7+3nHjvRJl1IF72K1XyYqaqEwAVxdCRdtCFm2ltua4BlOOWzshwWvLSvkUxcmaKOr/wzmmizFgaNmLhcafN+GXyF0q2lmd9IsGqXaCJLSYBGPh8xAHT8C+UgJZo09h7sBR4YxHbP9JucZ/ZxvAx0SMTPXBUDkiepIms/6OjX5eN6De1LD8onBEq3o1Agkz4oKEBGvbAmCLknJx1RhhjPhuWlq19OeLFHFf4t2dcTvZT+AMcF9S13QZNhxVBlasd+S4HSZHhiGWqlTfXHKUwn2KqOfjt4dTSv0NroD5L5;24:yq/k2gFyu+6GnygNKqFZWowNO8l+UIFw7GGsTrmjTR2L0Ehs1tDm7g0GiMFUFdWyvxo2qnq3doLw/+doJohZg3Po9bidXIMDFb3wNYUOIxk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB2017;7:A7HIrLmON9mDLPliTgbuRuKG687FKVwFIeFwcIasHLH7+m8/MTM9E5oXeApekSNw3RvI3K0lha4ATrHvDv54O7Kf3SQt6Jec1sevzmDki01NeMIsNNAr3k+boHgNp/aSEPyY0A38qpspBYrPxf19El+hNEGPjYig7T31b/Kcu6tVAO6YJIjA3e0VoEqrPwGC0A5JQB65A2x9Ld51ekKbUDbrzJKYR6iNhg3qjGGV/9XxElX5JPextuHprsnof6O9D0V7dlRwaZCG4TdjF+tK814gxkdZfRgdB3Qz0mtPIQzdxJh2nKs2Em3tZA1kcEgyh3p9K5L8/09uLQV/uFrBN0QXt3yT9UmjejHS1pmflqs+dD+Ufy8TZAxKlsdvSWPAFttBF43D2HJga8429frx61d+YV/EUaCQjPou8DL43rFZSMrgjTSSGgHK2O+pAuy1DGieb6XeMvUgb3Mk8bHfPmkJfIUXGr+oH51aDqOyGxQw9LcYLBURr3zTQ5Ge7NlzG7lPf2MiXhoako2faH1kzGXoL+aRCKiaF1EM/godq1j7y5hGPtIhjRLKssz6M/qWz69LYe9QxBBBfne55EhbeTyRTB5omHXzPHvGQ7+mDcZk92TLBRbpPxFfD9c3b+5i9CpATC6rJBFp+ctp0WG1tLNsyMMFAvoln3j3T6XxtSZNKUaZ3B7jk5dhymgbWEQAqXmYGreL8sRV+GmfKxEdpv5vz1BNKh1+p2vdqBgZ8+qIe0W9GT/NADgkyGyE6cnd2MUplpdvynruPxw85QOSjuAfermGqlGmvE+WNu2TIO0= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2017 13:54:17.5304 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB2017 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8789 Lines: 267 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 | 6 + drivers/acpi/arm64/iort.c | 57 ++++++++--- drivers/iommu/arm-smmu-v3.c | 100 ++++++++++++++----- 4 files changed, 121 insertions(+), 43 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 e7855cf..c9abbf3 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt +++ b/Documentation/devicetree/bindings/iommu/arm,smmu-v3.txt @@ -26,6 +26,12 @@ the PCIe specification. * "priq" - PRI Queue not empty * "cmdq-sync" - CMD_SYNC complete * "gerror" - Global Error activated + * "combined" - The combined interrupt is optional, + and should only be provided if the + hardware supports just a single, + combined interrupt line. + If provided, then the combined interrupt + will be used in preference to any others. - #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 bd97b7d..21c1ed3 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,39 @@ static void __init arm_smmu_v3_init_resources(struct resource *res, res[num_res].flags = IORESOURCE_MEM; num_res++; + if (arm_smmu_v3_is_combined_irq(smmu)) { + int irq = smmu->event_gsiv; - 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", + if (!(irq == smmu->pri_gsiv && irq == smmu->gerr_gsiv && + irq == smmu->sync_gsiv)) { + pr_warn(FW_BUG "Incosistent combined GSIV configuration\n"); + return; + } + acpi_iort_register_irq(smmu->event_gsiv, "combined", ACPI_EDGE_SENSITIVE, &res[num_res++]); + } else { - if (smmu->sync_gsiv) - acpi_iort_register_irq(smmu->sync_gsiv, "cmdq-sync", - ACPI_EDGE_SENSITIVE, - &res[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", + 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..fd5a48c 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,24 @@ 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) +{ + arm_smmu_gerror_handler(irq, dev); + arm_smmu_cmdq_sync_handler(irq, dev); + return IRQ_WAKE_THREAD; +} + /* IO_PGTABLE API */ static void __arm_smmu_tlb_sync(struct arm_smmu_device *smmu) { @@ -2230,18 +2249,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 +2294,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 +2765,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