Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1811592pxk; Sat, 26 Sep 2020 06:04:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYcyA4DFRexKQK+6CdX1ldhR0dKUkk3VzqarTEnyhq1UEeY7R9XUFyC7Es3RdrPEntTcYI X-Received: by 2002:a17:906:c191:: with SMTP id g17mr7516014ejz.117.1601125444790; Sat, 26 Sep 2020 06:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601125444; cv=none; d=google.com; s=arc-20160816; b=MpKPCoTD39ReP42M+m+Krgr5F7+vfBl2KQmccEDpuVGcM6M8y0QY4dP+ajatoWbUaG tr6Tka9+4NwEKYHJEq3TV2nez3uGpUUM1ekqLZdkqIDQbLPPk84zJ+CkZuyITLwxW62f 8BF8D3EjV9A7+egtJkgz3VqMGvvHAhqnpVD30Q4SBHl1s4gomqLrmUfd/fbxaKXdmE7e /s9q/NzOAmCujA9/nTQT/aHloEeNQ3MU+uEGwLPkgaBrbX6c+fNDMT/2kTD6Ou3KPc7Z w/I7CD0B66FB8zUSh2EbrBRbT7cYc70f24ZKfH2ZELUhgILyf93ZXq8Mvvp3v+Ml7mfo wwJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YJru3Yf9kUEHtScNf7bPezrHXeNo+5yqG0dd6MucAIM=; b=zPWL031liS3T9VwA3WDlafo+y6LMZVoN8RjmJgX8ll0AE7T80SEfByGLwZzDvpcKUc pzFgkZ5WvN2IW4BlbRATTRbxhbgSrRNihsl5QHVIHppD3b0PDWCbkSq9QTu57mlfsLjW P8lfcrjAHwpwKEHrHIg4S7FNbZMTskkLtP1tGYbhHqyQ7hmHvG0ZLoW8b92/dinNkc4t Gu6oBf/+jF1bNuz+iK2vR9lQb7TaaSR7ZDJBnnVhXdFsrK/UIEofyAWRrTjETCjAqfgd gWnwgwpbUlmi24Qj2skaoo5iYhIsTqLVoeGBZIfVGKFC8gEVql6U3rTxeAWNOyypEnAO lGYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iUHAdBiM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci4si3684885ejc.612.2020.09.26.06.03.41; Sat, 26 Sep 2020 06:04:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iUHAdBiM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729636AbgIZNAe (ORCPT + 99 others); Sat, 26 Sep 2020 09:00:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729445AbgIZNAR (ORCPT ); Sat, 26 Sep 2020 09:00:17 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767A5C0613D4; Sat, 26 Sep 2020 06:00:17 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id o5so6810275wrn.13; Sat, 26 Sep 2020 06:00:17 -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=PDY8wS6vfYtrcojNFdh9h9uRFIV1eLeSLbOZxi9XJ2nqXTMDwUHIwGlAbk/3UruYbn Q3TGKiwWtIy6KmhKxbCSnJJgS3r8iA1k+J9KU8k9L/d/uPgT8pjh7PPoZNLwovwuOADX a/Dx/khPvqMD1Wf8aqQSMQwEUfrzPnS9+hqqKyNHAUGMiNM3heMAF8PQ67ojDJZ6Fvbg DoFrj6IpoOinp4GtYY8AzsxKVFoqreclCcr3fvBFyH2IHS/e7B+DCp29pM6cYZF2fBQl uzU95lIRyp3/2ca1Tz9rNd9OyEJbRy8rbPTm/GQbuDsbSqBwTWtY3d8uJ+6qn3VkCuDh 3bCQ== X-Gm-Message-State: AOAM530UaN/CSrgV7FduD4fAE0M1e4o0gFiKPTkYsJdBh90SXrFFMBfJ 98wUXWM0aBuX2cMOtBsKKj8= 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 Cc: robin.murphy@arm.com, joro@8bytes.org, bjorn.andersson@linaro.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, kholk11@gmail.com, marijns95@gmail.com, konradybcio@gmail.com, martin.botka1@gmail.com, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org, linux-kernel@vger.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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.28.0