From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18DE5C433ED for ; Wed, 15 Jul 2020 10:22:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB521205CB for ; Wed, 15 Jul 2020 10:22:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="szsSIqU5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB521205CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=64U45S3UfgS/kMMo8K3760j21Q97JgOygQPaolO69xQ=; b=szsSIqU55Xv6d6yQ8KRIyCwxw eHwF5YXbhEAigLsObxTBQtIl6EgKYUxzw/WrO8u8znIXuJj1n+vMIEeUkXIM7QnVhWlOSU62PRpLz //Q7evRhOSYHLAW0xzCRsfBE1/+nLoqEPZT1TW/80I75YYCEnLs3Dk+EC9AJ3YvCG+IV47DMuGdoG 1LBV94Ve9n4n3nj2Wm009snqGFvJdgYaS6BP96q5BNzcDh86HOWGY1Fxw3dNV6aujtCio+d1UodC8 3bx5LTuYI/0WuccB8WpT0fKMXsK9M4+Lc13u+YNY2Pw8Vw45QsQjg2iEC+XdrG30yWz3Oe9oyqDnV ejr1rAVgA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jveWt-0006QD-Mp; Wed, 15 Jul 2020 10:20:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jveWp-0006Lx-Nu for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2020 10:20:44 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 320B930E; Wed, 15 Jul 2020 03:20:41 -0700 (PDT) Received: from [10.57.32.45] (unknown [10.57.32.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 50A073F718; Wed, 15 Jul 2020 03:20:39 -0700 (PDT) Subject: Re: [PATCH v4 1/4] iommu/arm-smmu: Call configuration impl hook before consuming features To: Tomasz Nowicki , will@kernel.org, joro@8bytes.org, gregory.clement@bootlin.com, robh+dt@kernel.org, hannah@marvell.com References: <20200715070649.18733-1-tn@semihalf.com> <20200715070649.18733-2-tn@semihalf.com> From: Robin Murphy Message-ID: Date: Wed, 15 Jul 2020 11:20:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200715070649.18733-2-tn@semihalf.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200715_062043_835564_68086906 X-CRM114-Status: GOOD ( 22.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, nadavh@marvell.com, iommu@lists.linux-foundation.org, mw@semihalf.com, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-07-15 08:06, Tomasz Nowicki wrote: > 'cfg_probe' hook is called at the very end of configuration probing > procedure and therefore features override and workaround may become > complex like for ID register fixups. In preparation for adding Marvell > errata move 'cfg_probe' a bit earlier to have chance to adjust > the detected features before we start consuming them. > > Since the Cavium quirk (the only user) does not alter features > it is safe to do so. Sorry for the confusion of failing to match my own intent in the first place ;) Reviewed-by: Robin Murphy > Suggested-by: Robin Murphy > Signed-off-by: Tomasz Nowicki > --- > drivers/iommu/arm-smmu.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > index 243bc4cb2705..19f906de6420 100644 > --- a/drivers/iommu/arm-smmu.c > +++ b/drivers/iommu/arm-smmu.c > @@ -1728,7 +1728,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) > unsigned int size; > u32 id; > bool cttw_reg, cttw_fw = smmu->features & ARM_SMMU_FEAT_COHERENT_WALK; > - int i; > + int i, ret; > > dev_notice(smmu->dev, "probing hardware configuration...\n"); > dev_notice(smmu->dev, "SMMUv%d with:\n", > @@ -1891,6 +1891,12 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) > smmu->features |= ARM_SMMU_FEAT_FMT_AARCH64_64K; > } > > + if (smmu->impl && smmu->impl->cfg_probe) { > + ret = smmu->impl->cfg_probe(smmu); > + if (ret) > + return ret; > + } > + > /* Now we've corralled the various formats, what'll it do? */ > if (smmu->features & ARM_SMMU_FEAT_FMT_AARCH32_S) > smmu->pgsize_bitmap |= SZ_4K | SZ_64K | SZ_1M | SZ_16M; > @@ -1918,9 +1924,6 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) > dev_notice(smmu->dev, "\tStage-2: %lu-bit IPA -> %lu-bit PA\n", > smmu->ipa_size, smmu->pa_size); > > - if (smmu->impl && smmu->impl->cfg_probe) > - return smmu->impl->cfg_probe(smmu); > - > return 0; > } > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel