From patchwork Sat Sep 26 13:00:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11801397 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50706112C for ; Sat, 26 Sep 2020 13:02:00 +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 23B22221EA for ; Sat, 26 Sep 2020 13:02:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l43ncs6k"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LlSED+QC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23B22221EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=o3hfSWdp41exdr1SVjgiihjTG1V4hFY3zUXwAtIsIek=; b=l43ncs6k6++wchvpxQcq9LN2M zXxbhN2jiosyx62fxO6HbuuiiWsWN7NxYnJCYNcZJccQ45tJO3bxeVVF1tZHA49xGaWdrkGdEcphs r3AXJDTPTYQ2KHqXB7IltmqNcXZEv0Cg9RGjbLZTbaZhB9epmfx27X+zsmgG8FghCNXM6b5lPeV+B KZ/yI8XG/MjWCzb04202ZXx4m561f17gFLAfWQniQLecOpisyx1OxbUt7OE3EYzzG9FpHR433A6v+ kM9pstkLYFugjyLo1b10V43kz2/1Igusf8T3wNLKt7OnoPLq5nH7o2tJjv5Y652TcO4h8XCSrkj/r 10FOqIlqg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM9oS-0008RL-QZ; Sat, 26 Sep 2020 13:00:28 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM9oF-0008Lk-BW for linux-arm-kernel@lists.infradead.org; Sat, 26 Sep 2020 13:00:17 +0000 Received: by mail-wm1-x344.google.com with SMTP id v12so2112057wmh.3 for ; Sat, 26 Sep 2020 06:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kfKqlQuYC0e0jDmwMTghnvCFGTLGac0UG8r/BLo/Ke0=; b=LlSED+QC3XXij9wjZJZMy/EDszLM/ISPhWAXpsfhsElXVvFu2qm+Tm6hTEqOppETcC y9uLte3DwjCtXi7qrAWx0gZevpCLoXydl4hYxJ2yl3Sk9crveMwDuUutqM3jNQjBhx8T k6PyThtfts4V1dxE3zcJINMzp0UcxdCky2UIk/1t+4Gagrl3/Ki4WQpBCz+yO2BaHWIt oD5vV8HrF69jOZin82O4P6qIb3mCdJ+k08wNg56Bgsxenp/dofyqomQMTVUhOb5jKcSP fvH6DWRB0tbx9CiPE/LbEepz+HxiO+0hJhZAVcJ0vbgtm/Zu1lT8s0w8LGrgpidUQLrC 9QeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kfKqlQuYC0e0jDmwMTghnvCFGTLGac0UG8r/BLo/Ke0=; b=VqrIToqcNaFhsHCPa6AOD2snBdxjlAy/w6sc58Xe8mGAU2blO4r89D0vqvLZDTNpPb gbTQEq+hUm/9z7ei6kJkapdXA2BvVei9Lbr0r1jKVIgXHyH0Z7YDWBVHb935R2sDgdsG vdhif7niBKslSYNwGqhNAnJ/NdNiZ9yL1y9YlabkzngmVokS68pFD7dV0HjaSINHXEyI GqN+wLzprLmytamc3rt1pXXDPTd6jz2nOMVHkCraXqBGXDG0Yd5inZqfYCAS3tcryB2n Rs8XTcGEw7ALCWdle1mgqyR7Qmmh8Eg0pbOfAuPl3UuT2GGGOmO6z5n7K283CcRkAtkR yy8A== X-Gm-Message-State: AOAM53310Cp642K0SyIophO4yI6XvXz2rJC6y15YlAxckP5DEz2GXlXT JbAhbHQfej/KblGWvzL2sRk= X-Google-Smtp-Source: ABdhPJzMcK+iZK0k6ZZgTjWyhO/xS6/OemqWzbpjQ6TO2WbiVL666VwtCSqyNrAtia99xD1QNxdu7Q== X-Received: by 2002:a1c:6487:: with SMTP id y129mr2668961wmb.90.1601125212771; Sat, 26 Sep 2020 06:00:12 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([2.237.20.237]) by smtp.gmail.com with ESMTPSA id b11sm6462896wrt.38.2020.09.26.06.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 06:00:12 -0700 (PDT) From: kholk11@gmail.com To: will@kernel.org Subject: [PATCH 4/8] iommu/arm-smmu: Support test_smr_masks implementation detail deviation Date: Sat, 26 Sep 2020 15:00:00 +0200 Message-Id: <20200926130004.13528-5-kholk11@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200926130004.13528-1-kholk11@gmail.com> References: <20200926130004.13528-1-kholk11@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_090015_426226_AA795CBB X-CRM114-Status: GOOD ( 14.48 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:344 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [kholk11[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [kholk11[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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, phone-devel@vger.kernel.org, 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, kholk11@gmail.com, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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); + 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);