From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Jason Gunthorpe <jgg@nvidia•com>, Joerg Roedel <joro@8bytes•org>
Cc: Joerg Roedel <jroedel@suse•de>,
Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
Linux Next Mailing List <linux-next@vger•kernel.org>,
Nicolin Chen <nicolinc@nvidia•com>,
Robin Murphy <robin.murphy@arm•com>
Subject: linux-next: manual merge of the iommufd tree with the iommu tree
Date: Fri, 21 Mar 2025 19:09:12 +1100 [thread overview]
Message-ID: <20250321190912.0495cc78@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 3465 bytes --]
Hi all,
Today's linux-next merge of the iommufd tree got a conflict in:
drivers/iommu/dma-iommu.c
between commit:
032d7e435cbd ("iommu/dma: Remove redundant locking")
from the iommu tree and commits:
f3f47b821931 ("iommu: Sort out domain user data")
e009e088d88e ("iommu: Drop sw_msi from iommu_domain")
from the iommufd tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/iommu/dma-iommu.c
index 0832998eca38,2bd9f80a83fe..000000000000
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@@ -59,34 -54,31 +54,30 @@@ struct iommu_dma_options
};
struct iommu_dma_cookie {
- enum iommu_dma_cookie_type type;
+ struct iova_domain iovad;
+ struct list_head msi_page_list;
+ /* Flush queue */
union {
- /* Full allocator for IOMMU_DMA_IOVA_COOKIE */
- struct {
- struct iova_domain iovad;
- /* Flush queue */
- union {
- struct iova_fq *single_fq;
- struct iova_fq __percpu *percpu_fq;
- };
- /* Number of TLB flushes that have been started */
- atomic64_t fq_flush_start_cnt;
- /* Number of TLB flushes that have been finished */
- atomic64_t fq_flush_finish_cnt;
- /* Timer to regularily empty the flush queues */
- struct timer_list fq_timer;
- /* 1 when timer is active, 0 when not */
- atomic_t fq_timer_on;
- };
- /* Trivial linear page allocator for IOMMU_DMA_MSI_COOKIE */
- dma_addr_t msi_iova;
+ struct iova_fq *single_fq;
+ struct iova_fq __percpu *percpu_fq;
};
- struct list_head msi_page_list;
-
+ /* Number of TLB flushes that have been started */
+ atomic64_t fq_flush_start_cnt;
+ /* Number of TLB flushes that have been finished */
+ atomic64_t fq_flush_finish_cnt;
+ /* Timer to regularily empty the flush queues */
+ struct timer_list fq_timer;
+ /* 1 when timer is active, 0 when not */
+ atomic_t fq_timer_on;
/* Domain for flush queue callback; NULL if flush queue not in use */
- struct iommu_domain *fq_domain;
+ struct iommu_domain *fq_domain;
/* Options for dma-iommu use */
- struct iommu_dma_options options;
+ struct iommu_dma_options options;
- struct mutex mutex;
+ };
+
+ struct iommu_dma_msi_cookie {
+ dma_addr_t msi_iova;
+ struct list_head msi_page_list;
};
static DEFINE_STATIC_KEY_FALSE(iommu_deferred_attach_enabled);
@@@ -393,14 -363,19 +362,18 @@@ int iommu_dma_init_fq(struct iommu_doma
*/
int iommu_get_dma_cookie(struct iommu_domain *domain)
{
- if (domain->iova_cookie)
+ struct iommu_dma_cookie *cookie;
+
+ if (domain->cookie_type != IOMMU_COOKIE_NONE)
return -EEXIST;
- domain->iova_cookie = cookie_alloc(IOMMU_DMA_IOVA_COOKIE);
- if (!domain->iova_cookie)
+ cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
+ if (!cookie)
return -ENOMEM;
- iommu_domain_set_sw_msi(domain, iommu_dma_sw_msi);
- mutex_init(&cookie->mutex);
+ INIT_LIST_HEAD(&cookie->msi_page_list);
+ domain->cookie_type = IOMMU_COOKIE_DMA_IOVA;
+ domain->iova_cookie = cookie;
return 0;
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2025-03-21 8:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 8:09 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-06-30 6:00 linux-next: manual merge of the iommufd tree with the iommu tree Stephen Rothwell
2025-06-30 13:02 ` Jason Gunthorpe
2023-10-27 4:55 Stephen Rothwell
2023-10-27 6:15 ` Stephen Rothwell
2023-10-30 18:26 ` Jason Gunthorpe
2023-10-31 5:12 ` Stephen Rothwell
2023-10-31 11:31 ` Jason Gunthorpe
2023-11-02 23:53 ` Stephen Rothwell
2023-11-03 0:33 ` Jason Gunthorpe
2023-10-26 3:27 Stephen Rothwell
2023-10-25 4:44 Stephen Rothwell
2023-10-25 12:17 ` Jason Gunthorpe
2023-11-02 23:53 ` Stephen Rothwell
2023-10-25 4:34 Stephen Rothwell
2023-10-25 12:12 ` Jason Gunthorpe
2023-10-25 12:16 ` Baolu Lu
2023-10-25 12:17 ` Jason Gunthorpe
2023-10-25 12:25 ` Baolu Lu
2023-10-23 4:56 Stephen Rothwell
2023-10-11 5:03 Stephen Rothwell
2023-10-11 13:58 ` Jason Gunthorpe
2023-08-16 6:21 Stephen Rothwell
2022-11-04 4:24 Stephen Rothwell
2022-11-04 12:33 ` Jason Gunthorpe
2022-11-04 19:21 ` Jason 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=20250321190912.0495cc78@canb.auug.org.au \
--to=sfr@canb$(echo .)auug.org.au \
--cc=jgg@nvidia$(echo .)com \
--cc=joro@8bytes$(echo .)org \
--cc=jroedel@suse$(echo .)de \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=nicolinc@nvidia$(echo .)com \
--cc=robin.murphy@arm$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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