From patchwork Sat May 13 09:47:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shameerali Kolothum Thodi X-Patchwork-Id: 99745 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp700484qge; Sat, 13 May 2017 02:53:38 -0700 (PDT) X-Received: by 10.99.127.73 with SMTP id p9mr8163981pgn.169.1494669218459; Sat, 13 May 2017 02:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494669218; cv=none; d=google.com; s=arc-20160816; b=UlBoCqkBnIW3DyM0j+4V1EUyAg1lAwLsLpC4NHY/7dgNIluMGp+7guKdIDODlnkWPM /SSqAm1SK1FwZ4fXgRu2Lgc26Nkr2k9IFkTWyAmiIeg2XzQ/bQvXzq5WYmCgpKyQsIhb heROShpe6uYtC7JKuTqL/eahTDoGEnwIlD3SB9H3NiypVi1thAAQKNhgcz/Otk7J4qfM u+SNuXrSSFUa422k5GkoiKVvO80JoQAOwNXFA6IvCWjLpF4qeXuhySU42gELnAtgXwA8 LofpnfzTrBg8X9gdZkSbMO2quV6YXfeEOD64r9+3xmIMYZmriALvbhaoi//vmeQcuyNv g1Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=SeFWzkoKKMI+F83xR6VwukpJUL+CKf4fg3GMsKZn71Y=; b=BcBS/dQ/C62QWe7XfS1imGBe+QD1fAUm+9slvtcEv22plbXaTvrwD74J/d7HGefDvI wgmhAH239y15LqKWovYySZ0bpy2Opb4vgoMuykbUpVcYnFhQCiYhe6vzggup1zxswfqA VndMAF8bMSCI20NgA3PmZ7xy/Qju2jL0ppfdUvcSs1S5f0QZ6egQE9/vP/hKKa2oFRhk /7i0kt+O8rhYkwGwldfgxYkmvw/vYe1aUzWxGyvUaXMpCWBlYhrFWQQjc9MRL8cRo/xX tN+IuRVY2u679Ph4Jgt1jc9DK4W9zLM4QvL/89u9Sd3gVeybRc9oR/qOCJxOsVU7/dc4 b3Cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c26si5622017pfl.163.2017.05.13.02.53.38; Sat, 13 May 2017 02:53:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752676AbdEMJxh (ORCPT + 7 others); Sat, 13 May 2017 05:53:37 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:6286 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751885AbdEMJxg (ORCPT ); Sat, 13 May 2017 05:53:36 -0400 Received: from 172.30.72.55 (EHLO DGGEML404-HUB.china.huawei.com) ([172.30.72.55]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AOL14083; Sat, 13 May 2017 17:53:04 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.47.91.84) by DGGEML404-HUB.china.huawei.com (10.3.17.39) with Microsoft SMTP Server id 14.3.301.0; Sat, 13 May 2017 17:51:06 +0800 From: shameer To: , , , , CC: , , , , , , , , , , shameer Subject: [RFC v1 4/7] iommu/arm-smmu-v3: Enable HiSilicon erratum 161010701 Date: Sat, 13 May 2017 10:47:28 +0100 Message-ID: <20170513094731.3676-5-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170513094731.3676-1-shameerali.kolothum.thodi@huawei.com> References: <20170513094731.3676-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.91.84] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.5916D783.003A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9a45a414b2a43475240e69b4981d090d Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This replaces the existing broken_prefetch_cmd quirk using the new erratum framework. Signed-off-by: shameer --- arch/arm64/Kconfig | 10 +++++++++- drivers/iommu/arm-smmu-v3.c | 36 ++++++++++-------------------------- 2 files changed, 19 insertions(+), 27 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a39029b..21d61ff 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -508,8 +508,16 @@ config QCOM_FALKOR_ERRATUM_1009 If unsure, say Y. -endmenu +config HISILICON_ERRATUM_161010701 + bool "HiSilicon erratum 161010701: Skip SMMU Prefetch Cmd" + default y + help + On HiSilicon Hip06/Hip07 platforms, the SMMU v3 doesn't support the + CMD_PREFETCH_CFG. This will skip the prefetch cmd usage. + If unsure, say Y. + +endmenu choice prompt "Page size" diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index f20d5d5..14538cb 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -650,16 +650,6 @@ struct arm_smmu_domain { struct iommu_domain domain; }; -struct arm_smmu_option_prop { - u32 opt; - const char *prop; -}; - -static struct arm_smmu_option_prop arm_smmu_options[] = { - { ARM_SMMU_OPT_SKIP_PREFETCH, "hisilicon,broken-prefetch-cmd" }, - { 0, NULL}, -}; - enum smmu_erratum_match_type { se_match_dt, }; @@ -677,7 +667,17 @@ struct smmu_erratum_workaround { }; static const struct smmu_erratum_workaround smmu_workarounds[] = { +#ifdef CONFIG_HISILICON_ERRATUM_161010701 + { + .match_type = se_match_dt, + .id = "hisilicon,erratum-161010701", + .desc_str = "HiSilicon erratum 161010701", + .enable = erratum_skip_prefetch_cmd, + }, +#endif + { + }, }; typedef bool (*se_match_fn_t)(const struct smmu_erratum_workaround *, @@ -735,20 +735,6 @@ static struct arm_smmu_domain *to_smmu_domain(struct iommu_domain *dom) return container_of(dom, struct arm_smmu_domain, domain); } -static void parse_driver_options(struct arm_smmu_device *smmu) -{ - int i = 0; - - do { - if (of_property_read_bool(smmu->dev->of_node, - arm_smmu_options[i].prop)) { - smmu->options |= arm_smmu_options[i].opt; - dev_notice(smmu->dev, "option %s\n", - arm_smmu_options[i].prop); - } - } while (arm_smmu_options[++i].opt); -} - /* Low-level queue manipulation functions */ static bool queue_full(struct arm_smmu_queue *q) { @@ -2695,8 +2681,6 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev, else ret = 0; - parse_driver_options(smmu); - smmu_check_workarounds(smmu, se_match_dt, dev->of_node); if (of_dma_is_coherent(dev->of_node))