Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp672480pxu; Wed, 14 Oct 2020 10:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDZQsBRiTVlMy7ogjuHK77KI0jdrqjdgW+HmjHmIdGamUKz2rxR7CC15vmNOVjJYVdxcTq X-Received: by 2002:a05:6402:22b7:: with SMTP id cx23mr25100edb.246.1602697218069; Wed, 14 Oct 2020 10:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602697218; cv=none; d=google.com; s=arc-20160816; b=rg2P1nWftIZ4nm6PKSWkTUi7I98s5wpmQs/9JzWYTFHPWJWh89Fc9buJWLjjn8b18I YiMcKQuI5XZ/2sBBAbT194MaDqOKleRajJbZD+X1w1UffVw2VzGLfmz07UTYEM7SQnHf Z0zR0gwTXniJfAJR2ADsK/o7sU27y/Ccsf2ReSXyeCkizjT1l8FNScukNZEomRYU30rY 2XykkcxwOA/psz2fwunQ/2EdL8hY8Dpqi5JuvRi1hlFacSkUPP2xYgGT9vIFYNH9l+eY cBrsMFi4kTun2Lm49WCOL7j8ZRmfKp0oillqii6BUS9QLSg6oGfyXFaBBxOnBajl36N8 J/og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=vPqiGIWqh1VrEKZT5CoNrMBug2OTYXQNjJqRKoJlBNs=; b=gUCNUo1IaBWx8tdRtY8insbh8D/XCxjzHq3z6pUY2KIO9zL/hItYmFr8jIeSi4X99z suByBP2jjP5Wdst3MJkQsYd3XN+FoFf12qaeQ0MUydW+oyPIlsN8h2XsvCS1W8F56yFj 2+UuCbnTSLA3g7Ue51l86iRmu79tK07MTM9DzLKK9+SGI7sd3yh5fPQjJI7TQe96ThTv MgDI9FVFqPHObsS1rDvDrXyBgBbCx3uqDBKEWZFs6YEx+LH+3g2L0l0c2JtKkHE9I3bM gy1J1HuzuF35Mlxr/+oE7sZINdp+EvLi6VXGGJ/aOLXseWUTyURv1Ha7TLPwXvK7U9mY TLag== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si240179ejr.659.2020.10.14.10.39.54; Wed, 14 Oct 2020 10:40:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730034AbgJNP4U (ORCPT + 99 others); Wed, 14 Oct 2020 11:56:20 -0400 Received: from foss.arm.com ([217.140.110.172]:52284 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgJNP4U (ORCPT ); Wed, 14 Oct 2020 11:56:20 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B33FCD6E; Wed, 14 Oct 2020 08:56:19 -0700 (PDT) Received: from [10.57.48.76] (unknown [10.57.48.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8D09F3F71F; Wed, 14 Oct 2020 08:56:17 -0700 (PDT) Subject: Re: [PATCH 6/8] iommu/arm-smmu: Move stream mapping reset to separate function To: kholk11@gmail.com, will@kernel.org Cc: joro@8bytes.org, bjorn.andersson@linaro.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, 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 References: <20200926130004.13528-1-kholk11@gmail.com> <20200926130004.13528-7-kholk11@gmail.com> From: Robin Murphy Message-ID: <70da2261-df85-e982-7646-8b3b8988a9fc@arm.com> Date: Wed, 14 Oct 2020 16:56:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20200926130004.13528-7-kholk11@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-26 14:00, kholk11@gmail.com wrote: > From: AngeloGioacchino Del Regno > > Move the stream mapping reset logic from arm_smmu_device_reset into > a separate arm_smmu_stream_mapping_reset function, in preparation > for implementing an implementation detail. > > This commit brings no functional changes. Please coordinate with Bjorn's series so you're not wasting time developing 'competing' implementations of the exact same thing. You don't need these last 3 patches, for reasons I've already explained over there. Robin. > Signed-off-by: AngeloGioacchino Del Regno > --- > drivers/iommu/arm/arm-smmu/arm-smmu.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > index 446a78dde9cd..8c070c493315 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > @@ -1652,14 +1652,9 @@ static struct iommu_ops arm_smmu_ops = { > .pgsize_bitmap = -1UL, /* Restricted during device attach */ > }; > > -static void arm_smmu_device_reset(struct arm_smmu_device *smmu) > +static void arm_smmu_stream_mapping_reset(struct arm_smmu_device *smmu) > { > int i; > - u32 reg; > - > - /* clear global FSR */ > - reg = arm_smmu_gr0_read(smmu, ARM_SMMU_GR0_sGFSR); > - arm_smmu_gr0_write(smmu, ARM_SMMU_GR0_sGFSR, reg); > > /* > * Reset stream mapping groups: Initial values mark all SMRn as > @@ -1673,6 +1668,18 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu) > arm_smmu_write_context_bank(smmu, i); > arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_FSR, ARM_SMMU_FSR_FAULT); > } > +} > + > +static void arm_smmu_device_reset(struct arm_smmu_device *smmu) > +{ > + u32 reg; > + > + /* clear global FSR */ > + reg = arm_smmu_gr0_read(smmu, ARM_SMMU_GR0_sGFSR); > + arm_smmu_gr0_write(smmu, ARM_SMMU_GR0_sGFSR, reg); > + > + /* Reset stream mapping */ > + arm_smmu_stream_mapping_reset(smmu); > > /* Invalidate the TLB, just in case */ > arm_smmu_gr0_write(smmu, ARM_SMMU_GR0_TLBIALLH, QCOM_DUMMY_VAL); >