Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758503AbcDAFoS (ORCPT ); Fri, 1 Apr 2016 01:44:18 -0400 Received: from mail-by2on0056.outbound.protection.outlook.com ([207.46.100.56]:16669 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758075AbcDAFoM (ORCPT ); Fri, 1 Apr 2016 01:44:12 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; 8bytes.org; dkim=none (message not signed) header.d=none;8bytes.org; dmarc=permerror action=none header.from=amd.com; X-WSS-ID: 0O4XWL3-07-GYR-02 X-M-MSG: From: Wan Zongshun To: Joerg Roedel , CC: Suravee Suthikulpanit , Borislav Petkov , Ray Huang , , , , Wan Zongshun Subject: [PATCH V3 9/9] iommu/amd: Set AMD iommu callbacks for amba bus Date: Fri, 1 Apr 2016 09:06:05 -0400 Message-ID: <1459515965-2865-10-git-send-email-vincent.wan@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459515965-2865-1-git-send-email-vincent.wan@amd.com> References: <1459515965-2865-1-git-send-email-vincent.wan@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(428002)(189002)(199003)(106466001)(229853001)(105586002)(50466002)(48376002)(101416001)(92566002)(2906002)(76176999)(4326007)(189998001)(50226001)(33646002)(50986999)(86362001)(81166005)(5003940100001)(47776003)(36756003)(586003)(87936001)(2950100001)(11100500001)(5001770100001)(5003600100002)(19580395003)(53416004)(19580405001)(77096005)(1096002)(1220700001)(5008740100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR12MB0705;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;MX:1;A:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: d97b31fd-0d58-4e2d-fe75-08d359ee98f0 X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0705;2:HGomik4hNzRRiC+zn1BQwKK2TLQ5dTLzyCreVUv8kDl1eddWdqy1Dh5TjeON2ipthTMF7ovvnxPqEi3BrY8WYeBdO6tFJj4FBkVCQBNJGsLsMazz3avDPkoGXW8KHFvbL/ZDlLdRuAtslYcV4/OaZtxYvfBjw3qcbuR0XMfCTa5KjkEvVkBufTjnbcoVtvwl;3:FhTj0scDkD+wEi4ggy+O/LenMNLNLkQxy/ozs651E1VaX4k+GqiuiH7q9pW4+n+OHcLFY0L3dHFiTynirpQReUO0jqaTzxiboplEpzX3rVlRKDjDpO9JC+Dkau0yvfirSbSKgTNaKpE2XmFBGUVqrgKqw72ntKmPgjJeoTgGn/24OvK6cW0i0wswTs+cn/sfQO7irt8E8VseKN4E6vIhDi2N11MueBNds4ynIpKJCgA= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0705; X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0705;25:tgLCABe1w1ITL8Ef/1VfuG06Ly+fisb85lsmFfSiY/GEnBCW3+PTEEbQ/kveKv/ds8NVutacpFfJSJOXCI5hCLhai95VK0stWIJx1zUEUzdNhvbr3W1j3OE/1krzxnOq0id11jQXD4NRAqvXuE5JgBNxBlU5fmmESa9NQ1inquJPpLyNGv0Shyko6aHOmO8N1V5O8bGYJycelPzk8c2qabAqPfm8kuJ+9vow2pJMEGFcOLmeFY/icBV3Gs4ifS7/cepUz8In8qUUkVS++P4GsjWuY3oF4ZXZAJSIZg22QCZbMdr84t2Q34awWKTdLqibm39dbPMyRUPJCBaCwNarPuWX60iC6YxZMFgHnoNprmbt/DadrUvtZrFjW1KEwv5FbePBbzjirs56+WF0qWcB4JBIz6RL6iy0Bn1RRzasBQYTpdod9YYsV6vbfXRgS7gAQt3OYCKUa96Ofx/NXE2cU+MDZXQClrzulMG6xQX7+RfcV87usQangZs2d5GbbI6ZvC6m5Cizz/bf5LiaMyIMaGRNOJRxJMIe/FpyHWZT1wePBdPiPrKvIKQJulD8yfYhuDDT2rnBayB/6pT5ZfEOWJCDmNjVcQtANH7gL78ozP0Iyk+T1xT86YD9sv1OjhCc X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0705;20:Zs9gvA4QphC48R88Yk4ownBxAxJZGGtNz0pMWCh6LHEkf9tPWJ7v+WgnircFWwBYepuxOydcf0FagkXZFeoB9KBhSKQjdLwtVbuw1rr6e6YISx918hSOG9QQSQIRa2sLGAz4ryyYJKplxTlknvnqZVx1u6gUYhrnS7AUYf4T2eGfl/zhTAu202X2+uIn8OXrG0X0NIqdtD02P2H5XZq/UuMVWmLV4P7yjN6aUuiHe7V/DV+i+jvN+8fbi7QRunLPtoBrksnDBt9wKZaWoy3vu70L5NqnFhbZULj6epvCG5WMswiC2pbdvMI/tLN3Uok8FtowFbCXP0K4ReuFrrMcv0PwF2xf0qREjSQsivrFvE2fTiJjUfVARPSrmK+fPo3JJtC1h5EEqKGBfE+sbj6qWeaN/sCdo66DsLzRDk1kh9QjLIkeRtLZRFx/dnSnCCw1wayH8PE5uxya2u41iJI9Dwoa3JXPnSIxMRhJF7ShLT6ueH44RzUyptZXTmGICXw+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13018025)(5005006)(13017025)(13015025)(13024025)(13023025)(8121501046)(10201501046)(3002001);SRVR:BLUPR12MB0705;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0705; X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0705;4:mWZqSXaHkxfTIB1J0tX6Qtegeg9GF5dmwdTwBl/CgBPaltmY3/xd57rPUMZOejoUGAtqoVC/yCWNMTyuRTqwQ2vvRGHBRHPxQyqFWlKzoUQjmM5P5rOWJJGfC3OdmLMQsMg5ad0bw8gDzgvXDZOUDdYzMm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teY9IVvck3djReTNaNe7NWW?= =?us-ascii?Q?clREL2in49NpUhUgnaZYQfRJp5Dz7bm7nFYZbpcPCIsFdjiowJeLrqqylaLw?= =?us-ascii?Q?1WRZE2+gz5hd4JCnxRNUAOL7z/tIWj4jeZePXuKrrAj3PRciEU+0pxi5KBoW?= =?us-ascii?Q?/ffLo8LUu09+NGoKqKtztbB9qcZK5uJXK1ShFSPquv911qFJmgoT670JA1vt?= =?us-ascii?Q?5uRwSXAMurrQRQ1tcZtsONnDi2HF9bNF6ua73a/kFDi+jCQrSYzxdy9UpW8L?= =?us-ascii?Q?KQBll6bbsOpvNTx+2H/FN3qT5aEti8Qh8Zr50lvnzioMwSMiXCXsFzqFMc4+?= =?us-ascii?Q?1wZFKRTXXZkD3AMeeAaGy6mJT7jqWYiZxt5CQExOEvjBROeta+/Ru2bbSSdw?= =?us-ascii?Q?GaOkgkBe0Ninc4ciYLghAeiZn+JlAWV8G64RKnThUTdzrwtZuvk+ToLf9aRA?= =?us-ascii?Q?dtQ97o30n+GSyWozYD7Kaf7?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0705;5:BLwlhkmxPR/FwbsznrIPzqphETLPsN28pUxmypIl9AagmX5heDc822nr0UCz9kDsJhDSQ/yXawKQ9vM1AvyqMN4V66bKzdtaxOK6IGlojx3+nAduT69b3cF/T7nQee6JiSmt2teZsqLHGv9QE4HhIQ==;24:JElVfHvi5VoThymRaaIWRgMfgjHnsl4/jTDwQxL35ZSw8QTCwC6VuYCsne61hLcBeT3rkvkB9QOswF48A4+bMOixgvILkJpGMOriZVuTorU=;20:8MGQY+RwUrrGdmuhi7lzL7/WRRz3l138vQLk7Nsedn3yfe5QpcyjqJ549yUFSTdj7sUZhMMckaKnVI8EnCDvZFZ5u+1bHQeqrH6lCHoYhSm3XdSz63097cotz5Y1kMo5hHNHhS/WZwh0nOM0r/NWODtWNQSaq7vvpAK8zPG2w1ZnM34HITKaO+QKPg+rMsRyLBkPBZ5P+lv9uzFpbYOpWsRMY6dRnq7jDRW1RJpGwmlAlHwIxRAa4xqDsQjSrmtc SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2016 05:29:28.6140 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0705 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1179 Lines: 45 From: Wan Zongshun AMD Uart DMA belongs to ACPI HID type device, and its driver is basing on AMBA Bus, need also IOMMU support. This patch is just to set the AMD iommu callbacks for amba bus. Signed-off-by: Wan Zongshun --- drivers/iommu/amd_iommu.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 713e7ea..c430c10 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -2969,7 +2970,17 @@ static struct dma_map_ops amd_iommu_dma_ops = { int __init amd_iommu_init_api(void) { - return bus_set_iommu(&pci_bus_type, &amd_iommu_ops); + int err = 0; + + err = bus_set_iommu(&pci_bus_type, &amd_iommu_ops); + if (err) + return err; +#ifdef CONFIG_ARM_AMBA + err = bus_set_iommu(&amba_bustype, &amd_iommu_ops); + if (err) + return err; +#endif + return 0; } int __init amd_iommu_init_dma_ops(void) -- 1.9.1