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.3 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, URIBL_BLOCKED,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 4685AC433E7 for ; Wed, 14 Oct 2020 15:54:28 +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 C35972222A for ; Wed, 14 Oct 2020 15:54:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XlzgThqg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C35972222A Authentication-Results: mail.kernel.org; dmarc=fail (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=0r+befBinjYpHy67GAaOWXgpitGTf/cuzqGnFyzoedU=; b=XlzgThqg44pjMcLo5ydlqFUEK gwD37MZ89180btY7IUyzfnUNWZ7EZmwhABoysnNA3cHHuqt8cmkqXiOPaW+f7GQ97Yf87+Lfw4q+k ehQtTBFjB+uLCjLnIJ/4KUbSz7Pu5cuoVTiIWNKQzzmEEFwO0VNqHJtpirrOyCbyxPeT5dy07/vLR DzY4mZGrOn5+yyVrGz0ShhlQtsMvdhsPXk/5Ou4T5DM+YsBvS61+2A8s7LKLuIGmv3xxY3OPpqhSn +FqFseegOTHSIhJFmOizJawKxKl7rAV9dLtlkcHfihA2H5Z+FFHmfAhTRMhqlVhueBNh9hpYDbovR QEQF4rjZg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSj5M-0002Pq-RS; Wed, 14 Oct 2020 15:53:04 +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 1kSj5J-0002Ol-9n for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 15:53:02 +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 21EBFD6E; Wed, 14 Oct 2020 08:52:59 -0700 (PDT) Received: from [10.57.48.76] (unknown [10.57.48.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2F2A23F71F; Wed, 14 Oct 2020 08:52:57 -0700 (PDT) Subject: Re: [PATCH 4/8] iommu/arm-smmu: Support test_smr_masks implementation detail deviation To: kholk11@gmail.com, will@kernel.org References: <20200926130004.13528-1-kholk11@gmail.com> <20200926130004.13528-5-kholk11@gmail.com> From: Robin Murphy Message-ID: <00afa417-d897-22ee-25a5-cba1bf96c669@arm.com> Date: Wed, 14 Oct 2020 16:52:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20200926130004.13528-5-kholk11@gmail.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_115301_397809_400AE84C X-CRM114-Status: GOOD ( 21.78 ) 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, marijns95@gmail.com, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, joro@8bytes.org, konradybcio@gmail.com, bjorn.andersson@linaro.org, martin.botka1@gmail.com, phone-devel@vger.kernel.org, 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-09-26 14:00, kholk11@gmail.com wrote: > From: AngeloGioacchino Del Regno > > At least some Qualcomm SoCs do need to override the function > arm_smmu_test_smr_masks entirely: add a test_smr_masks function > to the implementation details structure and call it properly. > > Signed-off-by: AngeloGioacchino Del Regno > --- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 ++++++ > drivers/iommu/arm/arm-smmu/arm-smmu.h | 1 + > 2 files changed, 7 insertions(+) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index 09c42af9f31e..446a78dde9cd 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > @@ -977,6 +977,12 @@ static void arm_smmu_test_smr_masks(struct arm_smmu_device *smmu) > > if (!smmu->smrs) > return; > + > + if (smmu->impl && smmu->impl->test_smr_masks) { > + smmu->impl->test_smr_masks(smmu); Meh, this doesn't need a special hook - just have ->cfg_probe() initialise your masks early and bail out here if smr_mask_mask is already set. You could actually bypass this test as-is by marking all your SMR entries as valid, but that's likely to cause far more problems elsewhere than it solves here ;) Robin. > + return; > + } > + > /* > * If we've had to accommodate firmware memory regions, we may > * have live SMRs by now; tread carefully... > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h > index d890a4a968e8..2cd3d126f675 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.h > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h > @@ -387,6 +387,7 @@ struct arm_smmu_impl { > int (*cfg_probe)(struct arm_smmu_device *smmu); > int (*reset)(struct arm_smmu_device *smmu); > int (*init_context)(struct arm_smmu_domain *smmu_domain); > + void (*test_smr_masks)(struct arm_smmu_device *smmu); > void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync, > int status); > int (*def_domain_type)(struct device *dev); > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel