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: 9805253 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 5D8B860329 for ; Thu, 22 Jun 2017 19:36:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D536728671 for ; Thu, 22 Jun 2017 19:36:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7FA228676; Thu, 22 Jun 2017 19:36:04 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5FAE228671 for ; Thu, 22 Jun 2017 19:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l7/l2bVwMd/iIbdWP9TgI4HTsZfiIHfM+XUTJ0M5L60=; b=hQr1tdBpD1YYzh 53UFZhLRMnwqmigOxqfjCNL9kkzswEsE0l1JWyJ8yMOgdyl+t+ja2OvGnLBxrb4HuO1+3FkhLnIf8 HxM62VLNXuAcDaaVeGE0XSiNjseHEcWLJGg4e4TbbVrStweB44AUCX8n4xvyeL8Zy5CKxlLDBTxxe sY0qMmbsjVY1aTGe/94IgtZVE2ukp11MvMDNWjcm30T2UIvAxPxmetPRiovHuk+HTG70nAMGLwaxJ dqM8bTiX1lLV3F/vbrGwJh6YBKNZdD+uHrLAIx8JGo7ahX+kG7BCszUbT82aUavqadlmrnR6qF96v SAtPCZwHjboroFyHRklQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dO7tZ-0002tD-62; Thu, 22 Jun 2017 19:36:01 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dO7tU-0002rI-Gy for linux-arm-kernel@lists.infradead.org; Thu, 22 Jun 2017 19:35:58 +0000 Received: by mail-wr0-x244.google.com with SMTP id 77so7047118wrb.3 for ; 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=REaXGW5KVkE0RrSypqeRkmzCpqnSYJ8XdUqvVXdHWKYUN7NjQ3373KIOnrQussR0g/ Q9WUD/We6We2lFRb0ETebkjtDNtkDgJM6O8ygwFz/Z+zYcNBHM8EiCLjo+G2TN3pigkK N27WvEFlH5KaXsA58NqFKel623wKKBcSsy2O/CEhJl9pZEOK9RnncP5QMzCxydhyy55c nXNHHl2wRtdjU/Xmh+x4W4NBE6gm8n1oPlvSi4QxZP2H5UD9S/BvDnGZOLEV0ezD1SzW 55laVwGT/dnv/XTWWpd4Q3tzWDbDvga5edUlp8RjS7utCyN8kUU//HbH/QtAYKxf3TPX 3I2A== X-Gm-Message-State: AKS2vOzP1+ASRttVB2PSBx2guxa/KlDmBlecKZf7ZD2zsM3diPJ4Jf1d Ry13ja/IH/CI+g== 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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170622_123556_784566_84D8857A X-CRM114-Status: GOOD ( 21.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, lorenzo.pieralisi@arm.com, linu.cherian@cavium.com, robert.richter@cavium.com, catalin.marinas@arm.com, Geetha sowjanya , rjw@rjwysocki.net, linux-kernel@vger.kernel.org, geethasowjanya.akula@gmail.com, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, jcm@redhat.com, sgoutham@cavium.com, Charles.Garcia-Tobin@arm.com, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org, devel@acpica.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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,