iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: iommu@lists.linux-foundation.org, Kit Chow <kchow@gigaio.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] iommu/amd: Implement dma_[un]map_resource()
Date: Wed, 9 Oct 2019 10:17:36 -0600	[thread overview]
Message-ID: <c5f6750f-b415-3562-9abe-0937bae94f75@deltatee.com> (raw)
In-Reply-To: <20191009065750.GA17832@infradead.org>



On 2019-10-09 12:57 a.m., Christoph Hellwig wrote:
> On Tue, Oct 08, 2019 at 04:18:35PM -0600, Logan Gunthorpe wrote:
>> From: Kit Chow <kchow@gigaio.com>
>>
>> Currently the Intel IOMMU uses the default dma_[un]map_resource()
> 
> s/Intel/AMD/ ?

Oops, yes, my mistake.

>> +static dma_addr_t map_resource(struct device *dev, phys_addr_t paddr,
>> +		size_t size, enum dma_data_direction dir, unsigned long attrs)
>> +{
>> +	struct protection_domain *domain;
>> +	struct dma_ops_domain *dma_dom;
>> +
>> +	domain = get_domain(dev);
>> +	if (PTR_ERR(domain) == -EINVAL)
>> +		return (dma_addr_t)paddr;
> 
> I thought that case can't happen anymore?
> 
> Also note that Joerg just applied the patch to convert the AMD iommu
> driver to use the dma-iommu ops.  Can you test that series and check
> it does the right thing for your use case?  From looking at the code
> I think it should.

Yes, looking at the new code, it looks like this patch will not be
needed. So we can drop it. We'll test it to make sure.

I believe the other two patches in this series are still needed though.

Thanks,

Logan


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: "Logan Gunthorpe" <logang@deltatee.com>
To: "Christoph Hellwig" <hch@infradead.org>
Cc: "iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>, Kit Chow <kchow@gigaio.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] iommu/amd: Implement dma_[un]map_resource()
Date: Wed, 9 Oct 2019 10:17:36 -0600	[thread overview]
Message-ID: <c5f6750f-b415-3562-9abe-0937bae94f75@deltatee.com> (raw)
Message-ID: <20191009161736.cjfxHKTCXzSHOFZXOboYc73lgMbIB19lE3Av9SD6niM@z> (raw)
In-Reply-To: <20191009065750.GA17832@infradead.org>



On 2019-10-09 12:57 a.m., Christoph Hellwig wrote:
> On Tue, Oct 08, 2019 at 04:18:35PM -0600, Logan Gunthorpe wrote:
>> From: Kit Chow <kchow@gigaio.com>
>>
>> Currently the Intel IOMMU uses the default dma_[un]map_resource()
> 
> s/Intel/AMD/ ?

Oops, yes, my mistake.

>> +static dma_addr_t map_resource(struct device *dev, phys_addr_t paddr,
>> +		size_t size, enum dma_data_direction dir, unsigned long attrs)
>> +{
>> +	struct protection_domain *domain;
>> +	struct dma_ops_domain *dma_dom;
>> +
>> +	domain = get_domain(dev);
>> +	if (PTR_ERR(domain) == -EINVAL)
>> +		return (dma_addr_t)paddr;
> 
> I thought that case can't happen anymore?
> 
> Also note that Joerg just applied the patch to convert the AMD iommu
> driver to use the dma-iommu ops.  Can you test that series and check
> it does the right thing for your use case?  From looking at the code
> I think it should.

Yes, looking at the new code, it looks like this patch will not be
needed. So we can drop it. We'll test it to make sure.

I believe the other two patches in this series are still needed though.

Thanks,

Logan



_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2019-10-09 16:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 22:18 [PATCH 0/3] AMD IOMMU Changes for NTB Logan Gunthorpe
2019-10-08 22:18 ` [PATCH 1/3] iommu/amd: Implement dma_[un]map_resource() Logan Gunthorpe
2019-10-09  6:57   ` Christoph Hellwig
2019-10-09 16:17     ` Logan Gunthorpe [this message]
2019-10-09 16:17       ` Logan Gunthorpe
2019-10-08 22:18 ` [PATCH 2/3] iommu/amd: Support multiple PCI DMA aliases in device table Logan Gunthorpe
2019-10-08 22:18 ` [PATCH 3/3] iommu/amd: Support multiple PCI DMA aliases in IRQ Remapping Logan Gunthorpe
2019-10-15 13:37   ` Joerg Roedel
2019-10-15 16:16     ` Logan Gunthorpe

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=c5f6750f-b415-3562-9abe-0937bae94f75@deltatee.com \
    --to=logang@deltatee.com \
    --cc=hch@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kchow@gigaio.com \
    --cc=linux-kernel@vger.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).