From patchwork Thu Jun 22 19:35:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 9805249 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 922B560329 for ; Thu, 22 Jun 2017 19:35:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB03C2865D for ; Thu, 22 Jun 2017 19:35:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEFF128672; Thu, 22 Jun 2017 19:35:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BC5B28671 for ; Thu, 22 Jun 2017 19:35:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753612AbdFVTfm (ORCPT ); Thu, 22 Jun 2017 15:35:42 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34508 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753599AbdFVTfk (ORCPT ); Thu, 22 Jun 2017 15:35:40 -0400 Received: by mail-wr0-f194.google.com with SMTP id k67so7034945wrc.1; Thu, 22 Jun 2017 12:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=J3Nmo08TEMLYkVe/HI6qKiuDnVnSWuET14ehV4KcHpE=; b=oCbrpFZWLnIzdiA0UzDIwgjuk2KMeKFIj2gct/jlGzRy4+ao9kH5YUMT2h/a73IDJl JKb5ZF5xC0DEwuBWj+cR2EhHLz58CKLgHw/TZhfvs/iQPveiaBKC4DOqRO3iwbivdJU9 qbYBkRbq7d1hAcGElQ+RbtGVrn/I+t6TfPR7pnP89Ubyk1qSpVNoGMFIk1jWi3Dhhyg1 AlhRlPn/71LeTMDG9oehimEfCIUcRSk6VA9XaX9or1+nYyi61XOrSUjvAbVrvzFwPaYu nPMS74bujph7sMJ/XzqAJ5orchn7zIzf3C4Zf2O28oqs1m6EufndJ32ekdtpnciihd3Q jm7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=J3Nmo08TEMLYkVe/HI6qKiuDnVnSWuET14ehV4KcHpE=; b=I9WWc9JUtZ084TveUM1MHm+VKImHKStkVt4I7uUikMbxAHEy7aT6rZAahUOSkH1Xcx tpFoDzONi4GhLqAzxYqycNAzwmekYXhWwwEk1Ob5AOAWmvwdU6uLu9yEnRJLp7f1zoF6 Bno3tep49sIeGQsUgHUygGwjL2YXtwFooWZejJdmWs9KCS0MFP1udUg3ineN1Pnh4BRt BfiYNxAKbz4zQ1LOVdxUA2f1s75UsvcH/JsjTreH5e/W7o9ZnZjMNy4wdcCoqA2wTUil 7K62e9Pxc17b8U6ikGJrore+VBkygTkiy27dyJKvswLjemRVV8+r2MuJKgwqauj+2l0K f00Q== X-Gm-Message-State: AKS2vOyubPIhG/mZLxjLlPFXtnVn78kNT9TAwOv8HZOVhDqnJJTNPvHf 8ZhBUfKDnTRx4w== X-Received: by 10.28.212.203 with SMTP id l194mr2864151wmg.59.1498160139170; Thu, 22 Jun 2017 12:35:39 -0700 (PDT) Received: from rric.localdomain (x4e33f4c7.dyn.telefonica.de. [78.51.244.199]) by smtp.gmail.com with ESMTPSA id f21sm2881165wra.5.2017.06.22.12.35.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 12:35:38 -0700 (PDT) Date: Thu, 22 Jun 2017 21:35:35 +0200 From: Robert Richter To: Will Deacon Cc: Geetha sowjanya , linux-arm-kernel@lists.infradead.org, robh@kernel.org, devel@acpica.org, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, Charles.Garcia-Tobin@arm.com, geethasowjanya.akula@gmail.com, jcm@redhat.com, linu.cherian@cavium.com, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, sgoutham@cavium.com, robin.murphy@arm.com, robert.richter@cavium.com Subject: Re: [Devel] [PATCH v9 0/3] Cavium ThunderX2 SMMUv3 errata workarounds Message-ID: <20170622193535.GA10237@rric.localdomain> References: <1498133138-20244-1-git-send-email-gakula@caviumnetworks.com> <20170622182257.GI15336@arm.com> <20170622185822.GK15336@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170622185822.GK15336@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 22.06.17 19:58:22, Will Deacon wrote: > On Thu, Jun 22, 2017 at 07:22:57PM +0100, Will Deacon wrote: > > On Thu, Jun 22, 2017 at 05:35:35PM +0530, Geetha sowjanya wrote: > > > Cavium ThunderX2 SMMUv3 implementation has two Silicon Erratas. > > > 1. Errata ID #74 > > > SMMU register alias Page 1 is not implemented > > > 2. Errata ID #126 > > > SMMU doesnt support unique IRQ lines and also MSI for gerror, > > > eventq and cmdq-sync > > > > > > The following patchset does software workaround for these two erratas. > > > > I've picked up the first two patches, and left comments on the final patch. > > ... except that it doesn't build: > > > drivers/acpi/arm64/iort.c: In function ‘arm_smmu_v3_resource_size’: > drivers/acpi/arm64/iort.c:837:21: error: ‘ACPI_IORT_SMMU_V3_CAVIUM_CN99XX’ undeclared (first use in this function) > if (smmu->model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX) > ^ > drivers/acpi/arm64/iort.c:837:21: note: each undeclared identifier is reported only once for each function it appears in > make[4]: *** [drivers/acpi/arm64/iort.o] Error 1 > > > I don't see ACPI_IORT_SMMU_V3_CAVIUM_CN99XX defined, even in linux-next. > > What's the plan here? It is defined already in acpica and we actually waiting for the acpi maintainers to include it: https://github.com/acpica/acpica/commit/d00a4eb86e64 We could add /* Until ACPICA headers cover IORT rev. C */ #ifndef ACPI_IORT_SMMU_V3_CAVIUM_CN99XX #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x2 #endif to both files: drivers/acpi/arm64/iort.c drivers/iommu/arm-smmu-v3.c This is similar to what Robin did. (I checked arm64 include files and the closest was arch/arm64/include/asm/acpi.h, bug this seems not really suitable to me.) I have created a separate patch to be applied at first below. We can revert it after acpica was updated. -Robert From ad7f0112a2a71059c32bd315835c33cc7bc660b8 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Thu, 22 Jun 2017 21:20:54 +0200 Subject: [PATCH] iommu/arm-smmu-v3: Add temporary Cavium SMMU-V3 model nuber definitions The model number is already defined in acpica and we actually waiting for the acpi maintainers to include it: https://github.com/acpica/acpica/commit/d00a4eb86e64 Adding those temporary definitions until the change makes it into include/acpi/actbl2.h. Signed-off-by: Robert Richter --- drivers/acpi/arm64/iort.c | 5 +++++ drivers/iommu/arm-smmu-v3.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 797b28dc7b34..15491237a657 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -31,6 +31,11 @@ #define IORT_IOMMU_TYPE ((1 << ACPI_IORT_NODE_SMMU) | \ (1 << ACPI_IORT_NODE_SMMU_V3)) +/* Until ACPICA headers cover IORT rev. C */ +#ifndef ACPI_IORT_SMMU_V3_CAVIUM_CN99XX +#define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x2 +#endif + struct iort_its_msi_chip { struct list_head list; struct fwnode_handle *fw_node; diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 380969aa60d5..c759dfa7442d 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -412,6 +412,11 @@ #define MSI_IOVA_BASE 0x8000000 #define MSI_IOVA_LENGTH 0x100000 +/* Until ACPICA headers cover IORT rev. C */ +#ifndef ACPI_IORT_SMMU_V3_CAVIUM_CN99XX +#define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x2 +#endif + static bool disable_bypass; module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO); MODULE_PARM_DESC(disable_bypass,