linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@lst.de>, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will@kernel.org>, Li Yang <leoyang.li@nxp.com>
Cc: freedreno@lists.freedesktop.org, kvm@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	iommu@lists.linux-foundation.org, netdev@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	David Woodhouse <dwmw2@infradead.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE
Date: Wed, 31 Mar 2021 17:07:56 +0100	[thread overview]
Message-ID: <163376d7-ab23-a470-5bba-7fcd8ae95a4e@arm.com> (raw)
In-Reply-To: <20210316153825.135976-17-hch@lst.de>

On 2021-03-16 15:38, Christoph Hellwig wrote:
[...]
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> index f1e38526d5bd40..996dfdf9d375dd 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -2017,7 +2017,7 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain,
>   		.iommu_dev	= smmu->dev,
>   	};
>   
> -	if (smmu_domain->non_strict)
> +	if (!iommu_get_dma_strict())

As Will raised, this also needs to be checking "domain->type == 
IOMMU_DOMAIN_DMA" to maintain equivalent behaviour to the attribute code 
below.

>   		pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT;
>   
>   	pgtbl_ops = alloc_io_pgtable_ops(fmt, &pgtbl_cfg, smmu_domain);
> @@ -2449,52 +2449,6 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev)
>   	return group;
>   }
>   
> -static int arm_smmu_domain_get_attr(struct iommu_domain *domain,
> -				    enum iommu_attr attr, void *data)
> -{
> -	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
> -
> -	switch (domain->type) {
> -	case IOMMU_DOMAIN_DMA:
> -		switch (attr) {
> -		case DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE:
> -			*(int *)data = smmu_domain->non_strict;
> -			return 0;
> -		default:
> -			return -ENODEV;
> -		}
> -		break;
> -	default:
> -		return -EINVAL;
> -	}
> -}
[...]
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> index f985817c967a25..edb1de479dd1a7 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> @@ -668,7 +668,6 @@ struct arm_smmu_domain {
>   	struct mutex			init_mutex; /* Protects smmu pointer */
>   
>   	struct io_pgtable_ops		*pgtbl_ops;
> -	bool				non_strict;
>   	atomic_t			nr_ats_masters;
>   
>   	enum arm_smmu_domain_stage	stage;
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> index 0aa6d667274970..3dde22b1f8ffb0 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> @@ -761,6 +761,9 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
>   		.iommu_dev	= smmu->dev,
>   	};
>   
> +	if (!iommu_get_dma_strict())

Ditto here.

Sorry for not spotting that sooner :(

Robin.

> +		pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT;
> +
>   	if (smmu->impl && smmu->impl->init_context) {
>   		ret = smmu->impl->init_context(smmu_domain, &pgtbl_cfg, dev);
>   		if (ret)

  parent reply	other threads:[~2021-03-31 16:08 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 15:38 cleanup unused or almost unused IOMMU APIs and the FSL PAMU driver v2 Christoph Hellwig
2021-03-16 15:38 ` [PATCH 01/18] iommu: remove the unused domain_window_disable method Christoph Hellwig
2021-03-30 12:04   ` Will Deacon
2021-03-16 15:38 ` [PATCH 02/18] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr Christoph Hellwig
2021-03-30 12:10   ` Will Deacon
2021-03-16 15:38 ` [PATCH 03/18] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY Christoph Hellwig
2021-03-30 12:15   ` Will Deacon
2021-03-16 15:38 ` [PATCH 04/18] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc Christoph Hellwig
2021-03-30 12:17   ` Will Deacon
2021-03-16 15:38 ` [PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows Christoph Hellwig
2021-03-30 12:22   ` Will Deacon
2021-04-01  9:29     ` Christoph Hellwig
2021-03-16 15:38 ` [PATCH 06/18] iommu/fsl_pamu: remove ->domain_window_enable Christoph Hellwig
2021-03-30 12:40   ` Will Deacon
2021-04-01  9:32     ` Christoph Hellwig
2021-03-16 15:38 ` [PATCH 07/18] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call Christoph Hellwig
2021-03-30 12:44   ` Will Deacon
2021-03-16 15:38 ` [PATCH 08/18] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn Christoph Hellwig
2021-03-30 12:46   ` Will Deacon
2021-04-01  9:34     ` Christoph Hellwig
2021-03-16 15:38 ` [PATCH 09/18] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device Christoph Hellwig
2021-03-30 12:48   ` Will Deacon
2021-03-16 15:38 ` [PATCH 10/18] iommu/fsl_pamu: enable the liodn when attaching a device Christoph Hellwig
2021-03-30 12:53   ` Will Deacon
2021-03-16 15:38 ` [PATCH 11/18] iommu/fsl_pamu: remove the snoop_id field Christoph Hellwig
2021-03-30 12:58   ` Will Deacon
2021-04-01  9:36     ` Christoph Hellwig
2021-03-16 15:38 ` [PATCH 12/18] iommu: remove DOMAIN_ATTR_PAGING Christoph Hellwig
2021-03-30 12:58   ` Will Deacon
2021-03-16 15:38 ` [PATCH 13/18] iommu: remove DOMAIN_ATTR_GEOMETRY Christoph Hellwig
2021-03-30 13:00   ` Will Deacon
2021-03-16 15:38 ` [PATCH 14/18] iommu: remove DOMAIN_ATTR_NESTING Christoph Hellwig
2021-03-30 13:04   ` Will Deacon
2021-03-16 15:38 ` [PATCH 15/18] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api Christoph Hellwig
2021-03-30 13:05   ` Will Deacon
2021-03-16 15:38 ` [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE Christoph Hellwig
2021-03-30 13:11   ` Will Deacon
2021-03-30 13:19     ` Robin Murphy
2021-03-30 13:58       ` Will Deacon
2021-03-30 16:28         ` Robin Murphy
2021-03-31 11:49           ` Will Deacon
2021-03-31 13:09             ` Robin Murphy
2021-03-31 15:32               ` Will Deacon
2021-03-31 16:05                 ` Robin Murphy
2021-04-01  9:59                   ` Christoph Hellwig
2021-04-01 13:26                     ` Will Deacon
2021-03-31 16:07   ` Robin Murphy [this message]
2021-03-16 15:38 ` [PATCH 17/18] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG Christoph Hellwig
2021-03-30 13:14   ` Will Deacon
2021-03-16 15:38 ` [PATCH 18/18] iommu: remove iommu_domain_{get,set}_attr Christoph Hellwig
2021-03-30 13:16   ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163376d7-ab23-a470-5bba-7fcd8ae95a4e@arm.com \
    --to=robin.murphy@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dwmw2@infradead.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).