From patchwork Sat Sep 26 13:00:03 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: 11801391 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 DE0FE112C for ; Sat, 26 Sep 2020 13:01:25 +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 ABFCF206D4 for ; Sat, 26 Sep 2020 13:01:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tceu2oHy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iUHAdBiM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABFCF206D4 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=gt76dNyZZSzhWUW9eKjDc0wBTN22MkqhIEmJcPMOfuU=; b=tceu2oHy+EwJYJSNT9AirbbzW D5m2gv89Gp/MpcJwseg+rV6qSjeQ78f0PGYxJzKuI5bDsYM8NykbHpzgb9O+MJ778nWKeSy5gL3+G BGIahqBcD08jLiALbvQ8mjtU/3dVlrLliMUEKpHXLAzQUlWh3tlB9ucFAELxMaYL0bHAlHJ1k4X9D 1/fEtorvEuA5sxYV0T8VkM3IqSq+ekaA1lB/a5cW5L5DvmUIVnwaOwtEoGnKTYeJskRoGKoZ6M/FF AsstEPyu9sCm5LBhCSPLi/JXGVM1BF9s277ovWgkINzLsxPiuCNDNWxTSJRBdnfeQFQ0G/2mAEf7x fzi35feug==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM9pC-0000DJ-ST; Sat, 26 Sep 2020 13:01:14 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM9oG-0008NP-Va for linux-arm-kernel@lists.infradead.org; Sat, 26 Sep 2020 13:00:20 +0000 Received: by mail-wr1-x441.google.com with SMTP id z1so6878701wrt.3 for ; Sat, 26 Sep 2020 06:00:16 -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=YJru3Yf9kUEHtScNf7bPezrHXeNo+5yqG0dd6MucAIM=; b=iUHAdBiM4Ztclp83OHMT5Spe42ecEdk6Ebg6KRMLcO5EmTMcu3595Gzo5uBdbdSJqb maGTK5QGoXom4E650DbDb87MPdXVAaDqOwD4oKu0TsU1J9T8mOi8H+WejzIl7RKnSViW CA0OjHc2YAetYFdlmdgrT4YVJjB7DM8GwRHz/cQIfuUF+Qg/yskAecqitcS4q9LwyaOT 5Ccxz5MQ5vdBM31N3pDL+7ocPQuIFCyc7cHqLoLTwPav8e5Bn/r7GILrJ5VXCovKeJXt yhhLmdUj6OH9g9wnN3VNY4Fr9b6XT7Nd8CJFpGUFvaHAgoYttdtta0XdT/rFx01BhuIo eTXQ== 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=YJru3Yf9kUEHtScNf7bPezrHXeNo+5yqG0dd6MucAIM=; b=G+5aPRZEAn2n9EzumPeGp9hMGmyOyLazCmD7z8Khbtboi26saLeXbbyChMAVv7zLPd XA/BKgaITfmYxWX8Yi+7I3/ikRj+E+SBS+ppD2XCEn/CF9w+x1VpsoiMl+jDLvztLKN2 JuwduJh0qD3vXVj98Ik3SaKkfpySexrpEMEZUMtxoXYc/aLngC7dSc/fSrjBCgqpmvL0 bkX4YPsKsleKkbf1xGxMG03yxqiV5kNQ5iy41G7qwJecJqPdjziIr+nthxhBpBi9Rp7I II8jKKGJPyg0/m7etCKKZKk4UZ8JV8+dyWq+KkdFUQwyPhORb6J1i3aHTXG8jVVzfbZL mk9g== X-Gm-Message-State: AOAM530+ZB58wAcincz9VeDKq9ZLIxkdERQOY2kfrsX45bcPKCuijd0S xQ/2B4hSGCGQen3oZNlfT90= X-Google-Smtp-Source: ABdhPJyFsQlj8vbeDAz3ASb3mPXPpgHdSK0AAp1BxkI4M+J1BqiaypCACxgG7WA9tqBFM1sOkflgEg== X-Received: by 2002:adf:e6cf:: with SMTP id y15mr9453310wrm.346.1601125216046; Sat, 26 Sep 2020 06:00:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 06:00:15 -0700 (PDT) From: kholk11@gmail.com To: will@kernel.org Subject: [PATCH 7/8] iommu/arm-smmu: Support stream_mapping_reset implementation detail Date: Sat, 26 Sep 2020 15:00:03 +0200 Message-Id: <20200926130004.13528-8-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_090017_577200_44C2CA99 X-CRM114-Status: GOOD ( 14.30 ) 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:441 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 Some IOMMUs may be in need of overriding the stream mapping reset function and this is seen on at least some Qualcomm SoCs: add a stream_mapping_reset function to the implementation details and call it in the appropriate function. Signed-off-by: AngeloGioacchino Del Regno --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 5 +++++ drivers/iommu/arm/arm-smmu/arm-smmu.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 8c070c493315..44571873f148 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1656,6 +1656,11 @@ static void arm_smmu_stream_mapping_reset(struct arm_smmu_device *smmu) { int i; + if (smmu->impl && smmu->impl->stream_mapping_reset) { + smmu->impl->stream_mapping_reset(smmu); + return; + } + /* * Reset stream mapping groups: Initial values mark all SMRn as * invalid and all S2CRn as bypass unless overridden. diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h index 2cd3d126f675..9c045594b8cf 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 (*stream_mapping_reset)(struct arm_smmu_device *smmu); void (*test_smr_masks)(struct arm_smmu_device *smmu); void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync, int status);