From patchwork Mon May 6 07:21:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 241578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C30F62C0260 for ; Mon, 6 May 2013 17:24:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753016Ab3EFHWa (ORCPT ); Mon, 6 May 2013 03:22:30 -0400 Received: from mail-da0-f54.google.com ([209.85.210.54]:64891 "EHLO mail-da0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753262Ab3EFHW2 (ORCPT ); Mon, 6 May 2013 03:22:28 -0400 Received: by mail-da0-f54.google.com with SMTP id u36so1695408dak.41 for ; Mon, 06 May 2013 00:22:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=e9Bf0bfsEFiiwrqE4kT/sYeQts+1hqNunDv6V0DFzQ4=; b=jWoPf5oSjCajpg/wUDNVQX2TfgVimAwjbMtibd2Cf+jXfaf8n98MPtgIv1YA0dKSC2 qlxWrqacJbHyW8qj8utJ7Eef9Xh5ngVg8HzDu7bX3sGwFE8NkrrvRqXcGn8GEZFjrDM2 Kf8E/OTsiTh/XXJjhxVo1/c/NLyvo+2RjRk7MZfDmuTQA7fV4mOzAG9+FIPQ130AzILP hnfnY3JRebgT3wYVfQleRdRfvc5nZaB4aic8UtgvBh9Hkyqp8ky9yoYSz9tjsOpL+QPP h75QKOfoi6L2ToC7L/YYZBcJg4NmCqoedoe/FHMMp2d8A7nclq32a/TpXUbTc5XFct5v DHBQ== X-Received: by 10.68.92.196 with SMTP id co4mr24575857pbb.121.1367824947430; Mon, 06 May 2013 00:22:27 -0700 (PDT) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPSA id az5sm20593976pbc.18.2013.05.06.00.22.21 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 May 2013 00:22:25 -0700 (PDT) From: aik@ozlabs.ru To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , David Gibson , Benjamin Herrenschmidt , Alex Williamson , Paul Mackerras , Alexander Graf , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 1/5] iommu: Move initialization earlier Date: Mon, 6 May 2013 17:21:57 +1000 Message-Id: <51875a31.25ac440a.50d9.ffffe8fd@mx.google.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367824921-27151-1-git-send-email-y> References: <1367824921-27151-1-git-send-email-y> X-Gm-Message-State: ALoCoQn16crYskpmM1VuADQhmewIeZp4Qh5fib7NU+Ti9MRmeI0IN//HihFqTPKR/dP+7JI/4J5r Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org From: Alexey Kardashevskiy The iommu_init() call initializes IOMMU internal structures and data required for the API to function such as iommu_group_alloc(). It is registered as a subsys_initcall. One of the IOMMU users is a PCI subsystem on POWER which discovers new IOMMU tables during the PCI scan so the most logical place to call iommu_group_alloc() is when a new group is just discovered. However PCI scan is done from subsys_initcall hook as well, which makes use of the IOMMU API impossible. This moves IOMMU subsystem initialization one step earlier. Signed-off-by: Alexey Kardashevskiy Cc: David Gibson Signed-off-by: Paul Mackerras --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 5514dfa..0de83eb 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -890,7 +890,7 @@ static int __init iommu_init(void) return 0; } -subsys_initcall(iommu_init); +arch_initcall(iommu_init); int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr attr, void *data)