From patchwork Thu Jul 10 06:53:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 33388 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4B30C203C0 for ; Thu, 10 Jul 2014 06:57:52 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id v10sf53256323pde.7 for ; Wed, 09 Jul 2014 23:57:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=8O4QCJYztVYz975LDgS04wKoGbNkw7YfdXtQQqP7WMc=; b=PcbB/PxgvzsePwDF3ucEP+Yq4dAkzNQIoWApGxXMTo+oSGL/8QE5Eb6qetSRh9WDle W7rUZiBWrwLT3UtPHSXIfY7YuMOqfTDLNJMJoLd0fw6dsbZGlT92TWq0/svMOrRFaz/W hN9fNSLx6RwuhId1TLL8tQyjFtkhTBnCrdI0GLbXkU7BECdRaU1AxGGoJk+EMVe9iia6 Eol2DxZ9yaen3qAJGp2s8ldFIuLc1q+1nIwjOWN8+S/xccF9uJ9GY0kVabSwp1/XwWeE TpGhdfcCMKqWspKB5tsaTOIEmkv4bSg49wltruqH2O05mI155ODjpdhF9Ni9mZS2hroM XKKw== X-Gm-Message-State: ALoCoQm9Fb+/+Z2owvTiiq7yjrnise4nkLHaM9YlmvLeSaoM2ANu0ISOceDI3qQ+kbY9tdHnu68B X-Received: by 10.66.230.165 with SMTP id sz5mr22502191pac.33.1404975472055; Wed, 09 Jul 2014 23:57:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.34 with SMTP id i31ls2692617qgf.51.gmail; Wed, 09 Jul 2014 23:57:51 -0700 (PDT) X-Received: by 10.52.121.112 with SMTP id lj16mr36739801vdb.29.1404975471945; Wed, 09 Jul 2014 23:57:51 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id dr20si2767581veb.59.2014.07.09.23.57.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 23:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so9643883vcb.2 for ; Wed, 09 Jul 2014 23:57:51 -0700 (PDT) X-Received: by 10.52.171.18 with SMTP id aq18mr162878vdc.45.1404975471828; Wed, 09 Jul 2014 23:57:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp109653vcb; Wed, 9 Jul 2014 23:57:51 -0700 (PDT) X-Received: by 10.70.33.228 with SMTP id u4mr15630230pdi.6.1404975471001; Wed, 09 Jul 2014 23:57:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ib4si47879234pad.70.2014.07.09.23.57.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jul 2014 23:57:50 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X58Hc-00047y-2v; Thu, 10 Jul 2014 06:56:44 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X58G9-0001hI-Td for linux-arm-kernel@lists.infradead.org; Thu, 10 Jul 2014 06:55:15 +0000 Received: from 172.24.2.119 (EHLO szxeml452-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BWM48171; Thu, 10 Jul 2014 14:54:30 +0800 (CST) Received: from localhost (10.177.27.142) by szxeml452-hub.china.huawei.com (10.82.67.195) with Microsoft SMTP Server id 14.3.158.1; Thu, 10 Jul 2014 14:54:21 +0800 From: Zhen Lei To: Catalin Marinas , Will Deacon , linux-arm-kernel Subject: [PATCH v3 11/13] iommu/arm: Put off the initialization phase of arm_smmu_ops registration Date: Thu, 10 Jul 2014 14:53:04 +0800 Message-ID: <1404975186-12032-12-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.8.4.msysgit.0 In-Reply-To: <1404975186-12032-1-git-send-email-thunder.leizhen@huawei.com> References: <1404975186-12032-1-git-send-email-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.27.142] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140709_235514_382261_28FD357B X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: -1.4 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [119.145.14.65 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Zhen Lei X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: thunder.leizhen@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 When more than two SMMU drivers running at the same, should make sure all SMMUs device tree nodes can be probed before arm_smmu_ops registered. Signed-off-by: Zhen Lei --- drivers/iommu/arm-smmu-base.c | 3 ++- drivers/iommu/arm-smmu.c | 12 ++---------- drivers/iommu/arm-smmu.h | 2 -- 3 files changed, 4 insertions(+), 13 deletions(-) -- 1.8.0 diff --git a/drivers/iommu/arm-smmu-base.c b/drivers/iommu/arm-smmu-base.c index 8013751..d71af43 100644 --- a/drivers/iommu/arm-smmu-base.c +++ b/drivers/iommu/arm-smmu-base.c @@ -1066,7 +1066,7 @@ int arm_smmu_device_remove(struct platform_device *pdev) return smmu->hwdep_ops->device_remove(smmu); } -int __init arm_smmu_ops_init(void) +static int __init arm_smmu_ops_init(void) { /* Oh, for a proper bus abstraction */ if (!iommu_present(&platform_bus_type)) @@ -1079,3 +1079,4 @@ int __init arm_smmu_ops_init(void) return 0; } +subsys_initcall_sync(arm_smmu_ops_init); diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 6971e11..868e9ac 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -728,7 +728,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) void __iomem *gr0_base = ARM_SMMU_GR0(smmu); u32 id; - dev_notice(smmu->dev, "probing hardware configuration...\n"); + dev_notice(smmu->dev, "probing arm-smmu hardware configuration...\n"); /* Primecell ID */ id = readl_relaxed(gr0_base + ARM_SMMU_GR0_PIDR2); @@ -899,15 +899,7 @@ static struct platform_driver arm_smmu_driver = { static int __init arm_smmu_init(void) { - int ret; - - ret = platform_driver_register(&arm_smmu_driver); - if (ret) - return ret; - - arm_smmu_ops_init(); - - return 0; + return platform_driver_register(&arm_smmu_driver); } static void __exit arm_smmu_exit(void) diff --git a/drivers/iommu/arm-smmu.h b/drivers/iommu/arm-smmu.h index 3164ba78..9847a33 100644 --- a/drivers/iommu/arm-smmu.h +++ b/drivers/iommu/arm-smmu.h @@ -253,6 +253,4 @@ extern void arm_smmu_flush_pgtable(struct arm_smmu_device *smmu, void *addr, extern int arm_smmu_device_dt_probe(struct platform_device *pdev, struct smmu_hwdep_ops *ops); extern int arm_smmu_device_remove(struct platform_device *pdev); - -extern int __init arm_smmu_ops_init(void); #endif