linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2016-01-04  7:45 Stephen Rothwell
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Rothwell @ 2016-01-04  7:45 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie
  Cc: linux-next, linux-kernel, Dan Williams, Laurent Pinchart, Tomi Valkeinen

Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in:

  drivers/gpu/drm/omapdrm/omap_gem.c

between commit:

  f4302747af02 ("drm: omapdrm: gem: Move global usergart variable to omap_drm_private")

from the drm tree and commit:

  0cf445f1b0c1 ("mm, dax, gpu: convert vm_insert_mixed to pfn_t")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/gpu/drm/omapdrm/omap_gem.c
index 984462622291,ceba5459ceb7..000000000000
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@@ -496,8 -480,9 +498,9 @@@ static int fault_2d(struct drm_gem_obje
  			pfn, pfn << PAGE_SHIFT);
  
  	for (i = n; i > 0; i--) {
- 		vm_insert_mixed(vma, (unsigned long)vaddr, pfn);
+ 		vm_insert_mixed(vma, (unsigned long)vaddr,
+ 				__pfn_to_pfn_t(pfn, PFN_DEV));
 -		pfn += usergart[fmt].stride_pfn;
 +		pfn += priv->usergart[fmt].stride_pfn;
  		vaddr += PAGE_SIZE * m;
  	}
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2020-04-03  3:58 Stephen Rothwell
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Rothwell @ 2020-04-03  3:58 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Thomas Hellstrom (VMware),
	Peter Xu

[-- Attachment #1: Type: text/plain, Size: 2710 bytes --]

Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  include/linux/huge_mm.h

between commit:

  9a9731b18c9b ("mm: Add vmf_insert_pfn_xxx_prot() for huge page-table entries")

from the drm tree and commit:

  7b6b88969e9d ("mm: merge parameters for change_protection()")

from the akpm-current 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 include/linux/huge_mm.h
index f63b0882c1b3,e60c923e68c4..000000000000
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@@ -46,46 -46,9 +46,46 @@@ extern bool move_huge_pmd(struct vm_are
  			 pmd_t *old_pmd, pmd_t *new_pmd);
  extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
  			unsigned long addr, pgprot_t newprot,
- 			int prot_numa);
+ 			unsigned long cp_flags);
 -vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn, bool write);
 -vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write);
 +vm_fault_t vmf_insert_pfn_pmd_prot(struct vm_fault *vmf, pfn_t pfn,
 +				   pgprot_t pgprot, bool write);
 +
 +/**
 + * vmf_insert_pfn_pmd - insert a pmd size pfn
 + * @vmf: Structure describing the fault
 + * @pfn: pfn to insert
 + * @pgprot: page protection to use
 + * @write: whether it's a write fault
 + *
 + * Insert a pmd size pfn. See vmf_insert_pfn() for additional info.
 + *
 + * Return: vm_fault_t value.
 + */
 +static inline vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn,
 +					    bool write)
 +{
 +	return vmf_insert_pfn_pmd_prot(vmf, pfn, vmf->vma->vm_page_prot, write);
 +}
 +vm_fault_t vmf_insert_pfn_pud_prot(struct vm_fault *vmf, pfn_t pfn,
 +				   pgprot_t pgprot, bool write);
 +
 +/**
 + * vmf_insert_pfn_pud - insert a pud size pfn
 + * @vmf: Structure describing the fault
 + * @pfn: pfn to insert
 + * @pgprot: page protection to use
 + * @write: whether it's a write fault
 + *
 + * Insert a pud size pfn. See vmf_insert_pfn() for additional info.
 + *
 + * Return: vm_fault_t value.
 + */
 +static inline vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn,
 +					    bool write)
 +{
 +	return vmf_insert_pfn_pud_prot(vmf, pfn, vmf->vma->vm_page_prot, write);
 +}
 +
  enum transparent_hugepage_flag {
  	TRANSPARENT_HUGEPAGE_FLAG,
  	TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: linux-next: manual merge of the akpm-current tree with the drm tree
  2019-07-09  0:06   ` Stephen Rothwell
@ 2019-07-15  1:11     ` Stephen Rothwell
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Rothwell @ 2019-07-15  1:11 UTC (permalink / raw)
  To: Dave Airlie, DRI
  Cc: Andrew Morton, Linux Next Mailing List,
	Linux Kernel Mailing List, Thomas Hellstrom, Anshuman Khandual

[-- Attachment #1: Type: text/plain, Size: 6498 bytes --]

Hi all,

On Tue, 9 Jul 2019 10:06:45 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Mon, 24 Jun 2019 21:06:59 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > On Mon, 24 Jun 2019 20:49:08 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> > >
> > > Today's linux-next merge of the akpm-current tree got a conflict in:
> > > 
> > >   mm/memory.c
> > > 
> > > between commit:
> > > 
> > >   29875a52915e ("mm: Add an apply_to_pfn_range interface")
> > > 
> > > from the drm tree and commit:
> > > 
> > >   e972cea08fb3 ("mm/pgtable: drop pgtable_t variable from pte_fn_t functions")
> > > 
> > > from the akpm-current tree.
> > > 
> > > I fixed it up (see below my signature, then added the following merge
> > > resolution patch as well) 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.
> > > 
> > > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Date: Mon, 24 Jun 2019 20:40:46 +1000
> > > Subject: [PATCH] merge fixup for "mm: Add an apply_to_pfn_range interface"
> > > 
> > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > ---
> > >  include/linux/mm.h    | 2 +-
> > >  mm/as_dirty_helpers.c | 8 ++------
> > >  2 files changed, 3 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > > index 87d53de3dee4..4404e18443ef 100644
> > > --- a/include/linux/mm.h
> > > +++ b/include/linux/mm.h
> > > @@ -2673,7 +2673,7 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
> > >  			       unsigned long size, pte_fn_t fn, void *data);
> > >  
> > >  struct pfn_range_apply;
> > > -typedef int (*pter_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
> > > +typedef int (*pter_fn_t)(pte_t *pte, unsigned long addr,
> > >  			 struct pfn_range_apply *closure);
> > >  struct pfn_range_apply {
> > >  	struct mm_struct *mm;
> > > diff --git a/mm/as_dirty_helpers.c b/mm/as_dirty_helpers.c
> > > index f600e31534fb..7c863626c2a4 100644
> > > --- a/mm/as_dirty_helpers.c
> > > +++ b/mm/as_dirty_helpers.c
> > > @@ -26,7 +26,6 @@ struct apply_as {
> > >  /**
> > >   * apply_pt_wrprotect - Leaf pte callback to write-protect a pte
> > >   * @pte: Pointer to the pte
> > > - * @token: Page table token, see apply_to_pfn_range()
> > >   * @addr: The virtual page address
> > >   * @closure: Pointer to a struct pfn_range_apply embedded in a
> > >   * struct apply_as
> > > @@ -36,8 +35,7 @@ struct apply_as {
> > >   *
> > >   * Return: Always zero.
> > >   */
> > > -static int apply_pt_wrprotect(pte_t *pte, pgtable_t token,
> > > -			      unsigned long addr,
> > > +static int apply_pt_wrprotect(pte_t *pte, unsigned long addr,
> > >  			      struct pfn_range_apply *closure)
> > >  {
> > >  	struct apply_as *aas = container_of(closure, typeof(*aas), base);
> > > @@ -78,7 +76,6 @@ struct apply_as_clean {
> > >  /**
> > >   * apply_pt_clean - Leaf pte callback to clean a pte
> > >   * @pte: Pointer to the pte
> > > - * @token: Page table token, see apply_to_pfn_range()
> > >   * @addr: The virtual page address
> > >   * @closure: Pointer to a struct pfn_range_apply embedded in a
> > >   * struct apply_as_clean
> > > @@ -91,8 +88,7 @@ struct apply_as_clean {
> > >   *
> > >   * Return: Always zero.
> > >   */
> > > -static int apply_pt_clean(pte_t *pte, pgtable_t token,
> > > -			  unsigned long addr,
> > > +static int apply_pt_clean(pte_t *pte, unsigned long addr,
> > >  			  struct pfn_range_apply *closure)
> > >  {
> > >  	struct apply_as *aas = container_of(closure, typeof(*aas), base);
> > > -- 
> > > 2.20.1
> > > 
> > > -- 
> > > Cheers,
> > > Stephen Rothwell
> > > 
> > > diff --cc mm/memory.c
> > > index 462aa47f8878,f8a75528658a..e7e37fcbd687
> > > --- a/mm/memory.c
> > > +++ b/mm/memory.c
> > > @@@ -2037,12 -2036,11 +2035,11 @@@ static int apply_to_pte_range(struct pf
> > >   {
> > >   	pte_t *pte;
> > >   	int err;
> > > - 	pgtable_t token;
> > >   	spinlock_t *uninitialized_var(ptl);
> > >   
> > >  -	pte = (mm == &init_mm) ?
> > >  +	pte = (closure->mm == &init_mm) ?
> > >   		pte_alloc_kernel(pmd, addr) :
> > >  -		pte_alloc_map_lock(mm, pmd, addr, &ptl);
> > >  +		pte_alloc_map_lock(closure->mm, pmd, addr, &ptl);
> > >   	if (!pte)
> > >   		return -ENOMEM;
> > >   
> > > @@@ -2050,10 -2048,8 +2047,8 @@@
> > >   
> > >   	arch_enter_lazy_mmu_mode();
> > >   
> > > - 	token = pmd_pgtable(*pmd);
> > > - 
> > >   	do {
> > > - 		err = closure->ptefn(pte++, token, addr, closure);
> > >  -		err = fn(pte++, addr, data);
> > > ++		err = closure->ptefn(pte++, addr, closure);
> > >   		if (err)
> > >   			break;
> > >   	} while (addr += PAGE_SIZE, addr != end);    
> > 
> > I also needed this:
> > 
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Mon, 24 Jun 2019 21:04:14 +1000
> > Subject: [PATCH] another fixup for "mm: Add an apply_to_pfn_range interface"
> > 
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
> >  mm/memory.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/mm/memory.c b/mm/memory.c
> > index e7e37fcbd687..81d71fbfca5a 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -2189,14 +2189,13 @@ struct page_range_apply {
> >   * Callback wrapper to enable use of apply_to_pfn_range for
> >   * the apply_to_page_range interface
> >   */
> > -static int apply_to_page_range_wrapper(pte_t *pte, pgtable_t token,
> > -				       unsigned long addr,
> > +static int apply_to_page_range_wrapper(pte_t *pte, unsigned long addr,
> >  				       struct pfn_range_apply *pter)
> >  {
> >  	struct page_range_apply *pra =
> >  		container_of(pter, typeof(*pra), pter);
> >  
> > -	return pra->fn(pte, token, addr, pra->data);
> > +	return pra->fn(pte, addr, pra->data);
> >  }
> >  
> >  /*
> > -- 
> > 2.20.1  
> 
> I am still getting this conflict (the commit ids may have changed).
> Just a reminder in case you think Linus may need to know.
> 

These fix ups are now needed when merging the drm tree into Linus' tree.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: linux-next: manual merge of the akpm-current tree with the drm tree
  2019-06-24 11:06 ` Stephen Rothwell
@ 2019-07-09  0:06   ` Stephen Rothwell
  2019-07-15  1:11     ` Stephen Rothwell
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Rothwell @ 2019-07-09  0:06 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Thomas Hellstrom, Anshuman Khandual

[-- Attachment #1: Type: text/plain, Size: 5997 bytes --]

Hi all,

On Mon, 24 Jun 2019 21:06:59 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Mon, 24 Jun 2019 20:49:08 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the akpm-current tree got a conflict in:
> > 
> >   mm/memory.c
> > 
> > between commit:
> > 
> >   29875a52915e ("mm: Add an apply_to_pfn_range interface")
> > 
> > from the drm tree and commit:
> > 
> >   e972cea08fb3 ("mm/pgtable: drop pgtable_t variable from pte_fn_t functions")
> > 
> > from the akpm-current tree.
> > 
> > I fixed it up (see below my signature, then added the following merge
> > resolution patch as well) 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.
> > 
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Mon, 24 Jun 2019 20:40:46 +1000
> > Subject: [PATCH] merge fixup for "mm: Add an apply_to_pfn_range interface"
> > 
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
> >  include/linux/mm.h    | 2 +-
> >  mm/as_dirty_helpers.c | 8 ++------
> >  2 files changed, 3 insertions(+), 7 deletions(-)
> > 
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index 87d53de3dee4..4404e18443ef 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -2673,7 +2673,7 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
> >  			       unsigned long size, pte_fn_t fn, void *data);
> >  
> >  struct pfn_range_apply;
> > -typedef int (*pter_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
> > +typedef int (*pter_fn_t)(pte_t *pte, unsigned long addr,
> >  			 struct pfn_range_apply *closure);
> >  struct pfn_range_apply {
> >  	struct mm_struct *mm;
> > diff --git a/mm/as_dirty_helpers.c b/mm/as_dirty_helpers.c
> > index f600e31534fb..7c863626c2a4 100644
> > --- a/mm/as_dirty_helpers.c
> > +++ b/mm/as_dirty_helpers.c
> > @@ -26,7 +26,6 @@ struct apply_as {
> >  /**
> >   * apply_pt_wrprotect - Leaf pte callback to write-protect a pte
> >   * @pte: Pointer to the pte
> > - * @token: Page table token, see apply_to_pfn_range()
> >   * @addr: The virtual page address
> >   * @closure: Pointer to a struct pfn_range_apply embedded in a
> >   * struct apply_as
> > @@ -36,8 +35,7 @@ struct apply_as {
> >   *
> >   * Return: Always zero.
> >   */
> > -static int apply_pt_wrprotect(pte_t *pte, pgtable_t token,
> > -			      unsigned long addr,
> > +static int apply_pt_wrprotect(pte_t *pte, unsigned long addr,
> >  			      struct pfn_range_apply *closure)
> >  {
> >  	struct apply_as *aas = container_of(closure, typeof(*aas), base);
> > @@ -78,7 +76,6 @@ struct apply_as_clean {
> >  /**
> >   * apply_pt_clean - Leaf pte callback to clean a pte
> >   * @pte: Pointer to the pte
> > - * @token: Page table token, see apply_to_pfn_range()
> >   * @addr: The virtual page address
> >   * @closure: Pointer to a struct pfn_range_apply embedded in a
> >   * struct apply_as_clean
> > @@ -91,8 +88,7 @@ struct apply_as_clean {
> >   *
> >   * Return: Always zero.
> >   */
> > -static int apply_pt_clean(pte_t *pte, pgtable_t token,
> > -			  unsigned long addr,
> > +static int apply_pt_clean(pte_t *pte, unsigned long addr,
> >  			  struct pfn_range_apply *closure)
> >  {
> >  	struct apply_as *aas = container_of(closure, typeof(*aas), base);
> > -- 
> > 2.20.1
> > 
> > -- 
> > Cheers,
> > Stephen Rothwell
> > 
> > diff --cc mm/memory.c
> > index 462aa47f8878,f8a75528658a..e7e37fcbd687
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@@ -2037,12 -2036,11 +2035,11 @@@ static int apply_to_pte_range(struct pf
> >   {
> >   	pte_t *pte;
> >   	int err;
> > - 	pgtable_t token;
> >   	spinlock_t *uninitialized_var(ptl);
> >   
> >  -	pte = (mm == &init_mm) ?
> >  +	pte = (closure->mm == &init_mm) ?
> >   		pte_alloc_kernel(pmd, addr) :
> >  -		pte_alloc_map_lock(mm, pmd, addr, &ptl);
> >  +		pte_alloc_map_lock(closure->mm, pmd, addr, &ptl);
> >   	if (!pte)
> >   		return -ENOMEM;
> >   
> > @@@ -2050,10 -2048,8 +2047,8 @@@
> >   
> >   	arch_enter_lazy_mmu_mode();
> >   
> > - 	token = pmd_pgtable(*pmd);
> > - 
> >   	do {
> > - 		err = closure->ptefn(pte++, token, addr, closure);
> >  -		err = fn(pte++, addr, data);
> > ++		err = closure->ptefn(pte++, addr, closure);
> >   		if (err)
> >   			break;
> >   	} while (addr += PAGE_SIZE, addr != end);  
> 
> I also needed this:
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 24 Jun 2019 21:04:14 +1000
> Subject: [PATCH] another fixup for "mm: Add an apply_to_pfn_range interface"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  mm/memory.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index e7e37fcbd687..81d71fbfca5a 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -2189,14 +2189,13 @@ struct page_range_apply {
>   * Callback wrapper to enable use of apply_to_pfn_range for
>   * the apply_to_page_range interface
>   */
> -static int apply_to_page_range_wrapper(pte_t *pte, pgtable_t token,
> -				       unsigned long addr,
> +static int apply_to_page_range_wrapper(pte_t *pte, unsigned long addr,
>  				       struct pfn_range_apply *pter)
>  {
>  	struct page_range_apply *pra =
>  		container_of(pter, typeof(*pra), pter);
>  
> -	return pra->fn(pte, token, addr, pra->data);
> +	return pra->fn(pte, addr, pra->data);
>  }
>  
>  /*
> -- 
> 2.20.1

I am still getting this conflict (the commit ids may have changed).
Just a reminder in case you think Linus may need to know.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: linux-next: manual merge of the akpm-current tree with the drm tree
  2019-06-24 10:49 Stephen Rothwell
@ 2019-06-24 11:06 ` Stephen Rothwell
  2019-07-09  0:06   ` Stephen Rothwell
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Rothwell @ 2019-06-24 11:06 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Thomas Hellstrom, Anshuman Khandual

[-- Attachment #1: Type: text/plain, Size: 5457 bytes --]

Hi all,

On Mon, 24 Jun 2019 20:49:08 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the akpm-current tree got a conflict in:
> 
>   mm/memory.c
> 
> between commit:
> 
>   29875a52915e ("mm: Add an apply_to_pfn_range interface")
> 
> from the drm tree and commit:
> 
>   e972cea08fb3 ("mm/pgtable: drop pgtable_t variable from pte_fn_t functions")
> 
> from the akpm-current tree.
> 
> I fixed it up (see below my signature, then added the following merge
> resolution patch as well) 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.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 24 Jun 2019 20:40:46 +1000
> Subject: [PATCH] merge fixup for "mm: Add an apply_to_pfn_range interface"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  include/linux/mm.h    | 2 +-
>  mm/as_dirty_helpers.c | 8 ++------
>  2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 87d53de3dee4..4404e18443ef 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2673,7 +2673,7 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
>  			       unsigned long size, pte_fn_t fn, void *data);
>  
>  struct pfn_range_apply;
> -typedef int (*pter_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
> +typedef int (*pter_fn_t)(pte_t *pte, unsigned long addr,
>  			 struct pfn_range_apply *closure);
>  struct pfn_range_apply {
>  	struct mm_struct *mm;
> diff --git a/mm/as_dirty_helpers.c b/mm/as_dirty_helpers.c
> index f600e31534fb..7c863626c2a4 100644
> --- a/mm/as_dirty_helpers.c
> +++ b/mm/as_dirty_helpers.c
> @@ -26,7 +26,6 @@ struct apply_as {
>  /**
>   * apply_pt_wrprotect - Leaf pte callback to write-protect a pte
>   * @pte: Pointer to the pte
> - * @token: Page table token, see apply_to_pfn_range()
>   * @addr: The virtual page address
>   * @closure: Pointer to a struct pfn_range_apply embedded in a
>   * struct apply_as
> @@ -36,8 +35,7 @@ struct apply_as {
>   *
>   * Return: Always zero.
>   */
> -static int apply_pt_wrprotect(pte_t *pte, pgtable_t token,
> -			      unsigned long addr,
> +static int apply_pt_wrprotect(pte_t *pte, unsigned long addr,
>  			      struct pfn_range_apply *closure)
>  {
>  	struct apply_as *aas = container_of(closure, typeof(*aas), base);
> @@ -78,7 +76,6 @@ struct apply_as_clean {
>  /**
>   * apply_pt_clean - Leaf pte callback to clean a pte
>   * @pte: Pointer to the pte
> - * @token: Page table token, see apply_to_pfn_range()
>   * @addr: The virtual page address
>   * @closure: Pointer to a struct pfn_range_apply embedded in a
>   * struct apply_as_clean
> @@ -91,8 +88,7 @@ struct apply_as_clean {
>   *
>   * Return: Always zero.
>   */
> -static int apply_pt_clean(pte_t *pte, pgtable_t token,
> -			  unsigned long addr,
> +static int apply_pt_clean(pte_t *pte, unsigned long addr,
>  			  struct pfn_range_apply *closure)
>  {
>  	struct apply_as *aas = container_of(closure, typeof(*aas), base);
> -- 
> 2.20.1
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc mm/memory.c
> index 462aa47f8878,f8a75528658a..e7e37fcbd687
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@@ -2037,12 -2036,11 +2035,11 @@@ static int apply_to_pte_range(struct pf
>   {
>   	pte_t *pte;
>   	int err;
> - 	pgtable_t token;
>   	spinlock_t *uninitialized_var(ptl);
>   
>  -	pte = (mm == &init_mm) ?
>  +	pte = (closure->mm == &init_mm) ?
>   		pte_alloc_kernel(pmd, addr) :
>  -		pte_alloc_map_lock(mm, pmd, addr, &ptl);
>  +		pte_alloc_map_lock(closure->mm, pmd, addr, &ptl);
>   	if (!pte)
>   		return -ENOMEM;
>   
> @@@ -2050,10 -2048,8 +2047,8 @@@
>   
>   	arch_enter_lazy_mmu_mode();
>   
> - 	token = pmd_pgtable(*pmd);
> - 
>   	do {
> - 		err = closure->ptefn(pte++, token, addr, closure);
>  -		err = fn(pte++, addr, data);
> ++		err = closure->ptefn(pte++, addr, closure);
>   		if (err)
>   			break;
>   	} while (addr += PAGE_SIZE, addr != end);

I also needed this:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 24 Jun 2019 21:04:14 +1000
Subject: [PATCH] another fixup for "mm: Add an apply_to_pfn_range interface"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 mm/memory.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index e7e37fcbd687..81d71fbfca5a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2189,14 +2189,13 @@ struct page_range_apply {
  * Callback wrapper to enable use of apply_to_pfn_range for
  * the apply_to_page_range interface
  */
-static int apply_to_page_range_wrapper(pte_t *pte, pgtable_t token,
-				       unsigned long addr,
+static int apply_to_page_range_wrapper(pte_t *pte, unsigned long addr,
 				       struct pfn_range_apply *pter)
 {
 	struct page_range_apply *pra =
 		container_of(pter, typeof(*pra), pter);
 
-	return pra->fn(pte, token, addr, pra->data);
+	return pra->fn(pte, addr, pra->data);
 }
 
 /*
-- 
2.20.1

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2019-06-24 10:49 Stephen Rothwell
  2019-06-24 11:06 ` Stephen Rothwell
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Rothwell @ 2019-06-24 10:49 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Thomas Hellstrom, Anshuman Khandual

[-- Attachment #1: Type: text/plain, Size: 4066 bytes --]

Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  mm/memory.c

between commit:

  29875a52915e ("mm: Add an apply_to_pfn_range interface")

from the drm tree and commit:

  e972cea08fb3 ("mm/pgtable: drop pgtable_t variable from pte_fn_t functions")

from the akpm-current tree.

I fixed it up (see below my signature, then added the following merge
resolution patch as well) 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.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 24 Jun 2019 20:40:46 +1000
Subject: [PATCH] merge fixup for "mm: Add an apply_to_pfn_range interface"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/linux/mm.h    | 2 +-
 mm/as_dirty_helpers.c | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 87d53de3dee4..4404e18443ef 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2673,7 +2673,7 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
 			       unsigned long size, pte_fn_t fn, void *data);
 
 struct pfn_range_apply;
-typedef int (*pter_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
+typedef int (*pter_fn_t)(pte_t *pte, unsigned long addr,
 			 struct pfn_range_apply *closure);
 struct pfn_range_apply {
 	struct mm_struct *mm;
diff --git a/mm/as_dirty_helpers.c b/mm/as_dirty_helpers.c
index f600e31534fb..7c863626c2a4 100644
--- a/mm/as_dirty_helpers.c
+++ b/mm/as_dirty_helpers.c
@@ -26,7 +26,6 @@ struct apply_as {
 /**
  * apply_pt_wrprotect - Leaf pte callback to write-protect a pte
  * @pte: Pointer to the pte
- * @token: Page table token, see apply_to_pfn_range()
  * @addr: The virtual page address
  * @closure: Pointer to a struct pfn_range_apply embedded in a
  * struct apply_as
@@ -36,8 +35,7 @@ struct apply_as {
  *
  * Return: Always zero.
  */
-static int apply_pt_wrprotect(pte_t *pte, pgtable_t token,
-			      unsigned long addr,
+static int apply_pt_wrprotect(pte_t *pte, unsigned long addr,
 			      struct pfn_range_apply *closure)
 {
 	struct apply_as *aas = container_of(closure, typeof(*aas), base);
@@ -78,7 +76,6 @@ struct apply_as_clean {
 /**
  * apply_pt_clean - Leaf pte callback to clean a pte
  * @pte: Pointer to the pte
- * @token: Page table token, see apply_to_pfn_range()
  * @addr: The virtual page address
  * @closure: Pointer to a struct pfn_range_apply embedded in a
  * struct apply_as_clean
@@ -91,8 +88,7 @@ struct apply_as_clean {
  *
  * Return: Always zero.
  */
-static int apply_pt_clean(pte_t *pte, pgtable_t token,
-			  unsigned long addr,
+static int apply_pt_clean(pte_t *pte, unsigned long addr,
 			  struct pfn_range_apply *closure)
 {
 	struct apply_as *aas = container_of(closure, typeof(*aas), base);
-- 
2.20.1

-- 
Cheers,
Stephen Rothwell

diff --cc mm/memory.c
index 462aa47f8878,f8a75528658a..e7e37fcbd687
--- a/mm/memory.c
+++ b/mm/memory.c
@@@ -2037,12 -2036,11 +2035,11 @@@ static int apply_to_pte_range(struct pf
  {
  	pte_t *pte;
  	int err;
- 	pgtable_t token;
  	spinlock_t *uninitialized_var(ptl);
  
 -	pte = (mm == &init_mm) ?
 +	pte = (closure->mm == &init_mm) ?
  		pte_alloc_kernel(pmd, addr) :
 -		pte_alloc_map_lock(mm, pmd, addr, &ptl);
 +		pte_alloc_map_lock(closure->mm, pmd, addr, &ptl);
  	if (!pte)
  		return -ENOMEM;
  
@@@ -2050,10 -2048,8 +2047,8 @@@
  
  	arch_enter_lazy_mmu_mode();
  
- 	token = pmd_pgtable(*pmd);
- 
  	do {
- 		err = closure->ptefn(pte++, token, addr, closure);
 -		err = fn(pte++, addr, data);
++		err = closure->ptefn(pte++, addr, closure);
  		if (err)
  			break;
  	} while (addr += PAGE_SIZE, addr != end);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2017-11-02  7:32 Stephen Rothwell
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Rothwell @ 2017-11-02  7:32 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie, DRI
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Mel Gorman,
	Christian König, Alex Deucher

Hi Andrew,

Today's linux-next merge of the akpm-current tree got conflicts in:

  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

between commits:

  b72cf4fca2bb ("drm/amdgpu: move taking mmap_sem into get_user_pages v2")
  ca666a3c298f ("drm/amdgpu: stop using BO status for user pages")

from the drm tree and commit:

  b7e8af45222b ("mm: remove cold parameter for release_pages")

from the akpm-current 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/gpu/drm/amd/amdgpu/amdgpu_cs.c
index f7fceb63413c,cd664832f9e8..000000000000
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@@ -562,8 -553,7 +562,7 @@@ static int amdgpu_cs_parser_bos(struct 
  				 * invalidated it. Free it and try again
  				 */
  				release_pages(e->user_pages,
- 					      bo->tbo.ttm->num_pages,
- 					      false);
 -					      e->robj->tbo.ttm->num_pages);
++					      bo->tbo.ttm->num_pages);
  				kvfree(e->user_pages);
  				e->user_pages = NULL;
  			}
diff --cc drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 51eacefadea1,d792959fac43..000000000000
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@@ -746,8 -659,7 +746,8 @@@ int amdgpu_ttm_tt_get_user_pages(struc
  	return 0;
  
  release_pages:
- 	release_pages(pages, pinned, 0);
+ 	release_pages(pages, pinned);
 +	up_read(&current->mm->mmap_sem);
  	return r;
  }
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* linux-next: manual merge of the akpm-current tree with the drm tree
@ 2016-03-07  8:14 Stephen Rothwell
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Rothwell @ 2016-03-07  8:14 UTC (permalink / raw)
  To: Andrew Morton, Dave Airlie
  Cc: linux-next, linux-kernel, Luis R. Rodriguez, Laurent Pinchart,
	Tomi Valkeinen

Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in:

  drivers/gpu/drm/omapdrm/omap_gem.c

between commit:

  cdb0381d2f19 ("drm/omap: gem: Clean up GEM objects memory flags")
(and others following)

from the drm tree and commit:

  c45472f906f4 ("dma-mapping: rename dma_*_writecombine() to dma_*_wc()")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/omapdrm/omap_gem.c
index cc36a8dc9bd4,359b0d7e8ef7..000000000000
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@@ -1305,23 -1324,22 +1305,23 @@@ void omap_gem_free_object(struct drm_ge
  	 */
  	WARN_ON(omap_obj->paddr_cnt > 0);
  
 -	/* don't free externally allocated backing memory */
 -	if (!(omap_obj->flags & OMAP_BO_EXT_MEM)) {
 -		if (omap_obj->pages)
 +	if (omap_obj->pages) {
 +		if (omap_obj->flags & OMAP_BO_MEM_DMABUF)
 +			kfree(omap_obj->pages);
 +		else
  			omap_gem_detach_pages(obj);
 +	}
  
 -		if (!is_shmem(obj)) {
 -			dma_free_wc(dev->dev, obj->size, omap_obj->vaddr,
 -				    omap_obj->paddr);
 -		} else if (omap_obj->vaddr) {
 -			vunmap(omap_obj->vaddr);
 -		}
 +	if (omap_obj->flags & OMAP_BO_MEM_DMA_API) {
- 		dma_free_writecombine(dev->dev, obj->size,
++		dma_free_wc(dev->dev, obj->size,
 +				omap_obj->vaddr, omap_obj->paddr);
 +	} else if (omap_obj->vaddr) {
 +		vunmap(omap_obj->vaddr);
 +	} else if (obj->import_attach) {
 +		drm_prime_gem_destroy(obj, omap_obj->sgt);
  	}
  
 -	/* don't free externally allocated syncobj */
 -	if (!(omap_obj->flags & OMAP_BO_EXT_SYNC))
 -		kfree(omap_obj->sync);
 +	kfree(omap_obj->sync);
  
  	drm_gem_object_release(obj);
  
@@@ -1410,25 -1428,10 +1410,25 @@@ struct drm_gem_object *omap_gem_new(str
  		mapping_set_gfp_mask(mapping, GFP_USER | __GFP_DMA32);
  	}
  
 +	/* Allocate memory if needed. */
 +	if (flags & OMAP_BO_MEM_DMA_API) {
- 		omap_obj->vaddr = dma_alloc_writecombine(dev->dev, size,
++		omap_obj->vaddr = dma_alloc_wc(dev->dev, size,
 +							 &omap_obj->paddr,
 +							 GFP_KERNEL);
 +		if (!omap_obj->vaddr)
 +			goto err_release;
 +	}
 +
 +	spin_lock(&priv->list_lock);
 +	list_add(&omap_obj->mm_list, &priv->obj_list);
 +	spin_unlock(&priv->list_lock);
 +
  	return obj;
  
 -fail:
 -	omap_gem_free_object(obj);
 +err_release:
 +	drm_gem_object_release(obj);
 +err_free:
 +	kfree(omap_obj);
  	return NULL;
  }
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-03  3:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-04  7:45 linux-next: manual merge of the akpm-current tree with the drm tree Stephen Rothwell
2016-03-07  8:14 Stephen Rothwell
2017-11-02  7:32 Stephen Rothwell
2019-06-24 10:49 Stephen Rothwell
2019-06-24 11:06 ` Stephen Rothwell
2019-07-09  0:06   ` Stephen Rothwell
2019-07-15  1:11     ` Stephen Rothwell
2020-04-03  3:58 Stephen Rothwell

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).