* linux-next: manual merge of the mm tree with the rdma tree
@ 2023-01-27 5:21 Stephen Rothwell
2023-01-27 5:39 ` Suren Baghdasaryan
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2023-01-27 5:21 UTC (permalink / raw)
To: Andrew Morton, Doug Ledford, Jason Gunthorpe
Cc: Dean Luick, Dennis Dalessandro, Leon Romanovsky,
Linux Kernel Mailing List, Linux Next Mailing List,
Suren Baghdasaryan
[-- Attachment #1: Type: text/plain, Size: 2263 bytes --]
Hi all,
Today's linux-next merge of the mm tree got a conflict in:
drivers/infiniband/hw/hfi1/file_ops.c
between commit:
1ec82317a1da ("IB/hfi1: Use dma_mmap_coherent for matching buffers")
from the rdma tree and commit:
6fe0afd07701 ("mm: replace vma->vm_flags direct modifications with modifier calls")
from the mm 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/infiniband/hw/hfi1/file_ops.c
index e03b0207856e,c6e59bc480f9..000000000000
--- a/drivers/infiniband/hw/hfi1/file_ops.c
+++ b/drivers/infiniband/hw/hfi1/file_ops.c
@@@ -424,17 -403,8 +424,17 @@@ static int hfi1_file_mmap(struct file *
ret = -EPERM;
goto done;
}
- vma->vm_flags &= ~VM_MAYWRITE;
+ vm_flags_clear(vma, VM_MAYWRITE);
- addr = vma->vm_start;
+ /*
+ * Mmap multiple separate allocations into a single vma. From
+ * here, dma_mmap_coherent() calls dma_direct_mmap(), which
+ * requires the mmap to exactly fill the vma starting at
+ * vma_start. Adjust the vma start and end for each eager
+ * buffer segment mapped. Restore the originals when done.
+ */
+ vm_start_save = vma->vm_start;
+ vm_end_save = vma->vm_end;
+ vma->vm_end = vma->vm_start;
for (i = 0 ; i < uctxt->egrbufs.numbufs; i++) {
memlen = uctxt->egrbufs.buffers[i].len;
memvirt = uctxt->egrbufs.buffers[i].addr;
@@@ -560,9 -528,11 +560,9 @@@
goto done;
}
- vma->vm_flags = flags;
+ vm_flags_reset(vma, flags);
- hfi1_cdbg(PROC,
- "%u:%u type:%u io/vf:%d/%d, addr:0x%llx, len:%lu(%lu), flags:0x%lx\n",
- ctxt, subctxt, type, mapio, vmf, memaddr, memlen,
- vma->vm_end - vma->vm_start, vma->vm_flags);
+ mmap_cdbg(ctxt, subctxt, type, mapio, vmf, memaddr, memvirt, memdma,
+ memlen, vma);
if (vmf) {
vma->vm_pgoff = PFN_DOWN(memaddr);
vma->vm_ops = &vm_ops;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: linux-next: manual merge of the mm tree with the rdma tree
2023-01-27 5:21 linux-next: manual merge of the mm tree with the rdma tree Stephen Rothwell
@ 2023-01-27 5:39 ` Suren Baghdasaryan
0 siblings, 0 replies; 2+ messages in thread
From: Suren Baghdasaryan @ 2023-01-27 5:39 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Andrew Morton, Doug Ledford, Jason Gunthorpe, Dean Luick,
Dennis Dalessandro, Leon Romanovsky, Linux Kernel Mailing List,
Linux Next Mailing List
On Thu, Jan 26, 2023 at 9:21 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the mm tree got a conflict in:
>
> drivers/infiniband/hw/hfi1/file_ops.c
>
> between commit:
>
> 1ec82317a1da ("IB/hfi1: Use dma_mmap_coherent for matching buffers")
>
> from the rdma tree and commit:
>
> 6fe0afd07701 ("mm: replace vma->vm_flags direct modifications with modifier calls")
>
> from the mm 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.
Hi Stephen,
Conflict resolution for 6fe0afd07701 looks good to me.
Thanks,
Suren.
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc drivers/infiniband/hw/hfi1/file_ops.c
> index e03b0207856e,c6e59bc480f9..000000000000
> --- a/drivers/infiniband/hw/hfi1/file_ops.c
> +++ b/drivers/infiniband/hw/hfi1/file_ops.c
> @@@ -424,17 -403,8 +424,17 @@@ static int hfi1_file_mmap(struct file *
> ret = -EPERM;
> goto done;
> }
> - vma->vm_flags &= ~VM_MAYWRITE;
> + vm_flags_clear(vma, VM_MAYWRITE);
> - addr = vma->vm_start;
> + /*
> + * Mmap multiple separate allocations into a single vma. From
> + * here, dma_mmap_coherent() calls dma_direct_mmap(), which
> + * requires the mmap to exactly fill the vma starting at
> + * vma_start. Adjust the vma start and end for each eager
> + * buffer segment mapped. Restore the originals when done.
> + */
> + vm_start_save = vma->vm_start;
> + vm_end_save = vma->vm_end;
> + vma->vm_end = vma->vm_start;
> for (i = 0 ; i < uctxt->egrbufs.numbufs; i++) {
> memlen = uctxt->egrbufs.buffers[i].len;
> memvirt = uctxt->egrbufs.buffers[i].addr;
> @@@ -560,9 -528,11 +560,9 @@@
> goto done;
> }
>
> - vma->vm_flags = flags;
> + vm_flags_reset(vma, flags);
> - hfi1_cdbg(PROC,
> - "%u:%u type:%u io/vf:%d/%d, addr:0x%llx, len:%lu(%lu), flags:0x%lx\n",
> - ctxt, subctxt, type, mapio, vmf, memaddr, memlen,
> - vma->vm_end - vma->vm_start, vma->vm_flags);
> + mmap_cdbg(ctxt, subctxt, type, mapio, vmf, memaddr, memvirt, memdma,
> + memlen, vma);
> if (vmf) {
> vma->vm_pgoff = PFN_DOWN(memaddr);
> vma->vm_ops = &vm_ops;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-27 5:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-27 5:21 linux-next: manual merge of the mm tree with the rdma tree Stephen Rothwell
2023-01-27 5:39 ` Suren Baghdasaryan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox