Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752381Ab2EDGeN (ORCPT ); Fri, 4 May 2012 02:34:13 -0400 Received: from hqemgate03.nvidia.com ([216.228.121.140]:14300 "EHLO hqemgate03.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751570Ab2EDGeM convert rfc822-to-8bit (ORCPT ); Fri, 4 May 2012 02:34:12 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 03 May 2012 23:34:02 -0700 From: Hiroshi Doyu To: "swarren@wwwdotorg.org" CC: "linux-tegra@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "joerg.roedel@amd.com" , "thierry.reding@avionic-design.de" , "linux-kernel@vger.kernel.org" Date: Fri, 4 May 2012 08:33:58 +0200 Subject: Re: [PATCHv3 3/4] iommu/tegra: smmu: Refrain from accessing to AHB Thread-Topic: [PATCHv3 3/4] iommu/tegra: smmu: Refrain from accessing to AHB Thread-Index: Ac0pv+N9/bQtE66UT6euhdUzTU4+3g== Message-ID: <20120504.093358.2098007825524274078.hdoyu@nvidia.com> References: <1336061147-10245-1-git-send-email-hdoyu@nvidia.com><1336061147-10245-3-git-send-email-hdoyu@nvidia.com><4FA2C4E9.2080509@wwwdotorg.org> In-Reply-To: <4FA2C4E9.2080509@wwwdotorg.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-nvconfidentiality: public acceptlanguage: en-US Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1799 Lines: 50 From: Stephen Warren Subject: Re: [PATCHv3 3/4] iommu/tegra: smmu: Refrain from accessing to AHB Date: Thu, 3 May 2012 19:48:25 +0200 Message-ID: <4FA2C4E9.2080509@wwwdotorg.org> > On 05/03/2012 10:05 AM, Hiroshi DOYU wrote: > > Use "tegra_ahb_enable_smmu()" to inform AHB that SMMU is > > ready, instead of directly aceessing AHB registers. > > You need to make the Kconfig option for the SMMU either depend on or > select the TEGRA_AHB option. If you don't, then if someone disables the > AHB driver, the SMMU driver may still build, yet fail to link since the > AHB API it calls doesn't exist. > > > diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c > > > @@ -398,10 +388,8 @@ static void smmu_setup_regs(struct smmu_device *smmu) > > > > smmu_flush_regs(smmu, 1); > > > > - val = ahb_read(smmu, AHB_XBAR_CTRL); > > - val |= AHB_XBAR_CTRL_SMMU_INIT_DONE_DONE << > > - AHB_XBAR_CTRL_SMMU_INIT_DONE_SHIFT; > > - ahb_write(smmu, val, AHB_XBAR_CTRL); > > + err = tegra_ahb_enable_smmu(smmu->ahb); > > + return err; > > You can just "return tegra_ahb_..." here. > > > @@ -911,14 +899,16 @@ static int tegra_smmu_probe(struct platform_device *pdev) > > > + smmu->ahb = of_parse_phandle(pdev->dev.of_node, "ahb", 0); > > Hmm, "ahb" should probably be "nvidia,ahb". Does this mean the following in dts? ahb: ahb@6000c004 { compatible = "nvidia,tegra30-ahb"; reg = <0x6000c004 0x14c>; /* AHB Arbitration + Gizmo Controller */ }; smmu: smmu@7000f000 { nvidia,ahb = &ahb; }; ^^^^^^^^^^ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/