dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the hmm tree
@ 2020-10-06  9:35 Stephen Rothwell
  2020-10-06 16:41 ` Jason Gunthorpe
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2020-10-06  9:35 UTC (permalink / raw)
  To: Jason Gunthorpe, Dave Airlie, DRI
  Cc: Maor Gottlieb, Linux Next Mailing List, Leon Romanovsky,
	Gerd Hoffmann, Linux Kernel Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 1826 bytes --]

Hi all,

After merging the hmm tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:


Caused by commit

  07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of SG table from pages")

interacting with commit

  707d561f77b5 ("drm: allow limiting the scatter list size.")

from the drm tree.

I have added the following merge fix patch

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 6 Oct 2020 20:22:51 +1100
Subject: [PATCH] lib/scatterlist: merge fix for "drm: allow limiting the
 scatter list size."

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/gpu/drm/drm_prime.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 11fe9ff76fd5..83ac901b65a2 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -807,6 +807,7 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
 				       struct page **pages, unsigned int nr_pages)
 {
 	struct sg_table *sg = NULL;
+	struct scatterlist *sl;
 	size_t max_segment = 0;
 	int ret;
 
@@ -820,11 +821,13 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
 		max_segment = dma_max_mapping_size(dev->dev);
 	if (max_segment == 0 || max_segment > SCATTERLIST_MAX_SEGMENT)
 		max_segment = SCATTERLIST_MAX_SEGMENT;
-	ret = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
+	sl = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
 					  nr_pages << PAGE_SHIFT,
-					  max_segment, GFP_KERNEL);
-	if (ret)
+					  max_segment, NULL, 0, GFP_KERNEL);
+	if (IS_ERR(sl)) {
+		ret = PTR_ERR(sl);
 		goto out;
+	}
 
 	return sg;
 out:
-- 
2.28.0


I assume that there may be more needed.

-- 
Cheers,
Stephen Rothwell

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

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: linux-next: build failure after merge of the hmm tree
  2020-10-06  9:35 linux-next: build failure after merge of the hmm tree Stephen Rothwell
@ 2020-10-06 16:41 ` Jason Gunthorpe
  2020-10-12  4:19   ` Stephen Rothwell
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Gunthorpe @ 2020-10-06 16:41 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Dave Airlie, Leon Romanovsky, Linux Kernel Mailing List, DRI,
	Linux Next Mailing List, Gerd Hoffmann, Maor Gottlieb

On Tue, Oct 06, 2020 at 08:35:08PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the hmm tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
> 
> 
> Caused by commit
> 
>   07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of SG table from pages")
> 
> interacting with commit
> 
>   707d561f77b5 ("drm: allow limiting the scatter list size.")
> 
> from the drm tree.
> 
> I have added the following merge fix patch
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 6 Oct 2020 20:22:51 +1100
> Subject: [PATCH] lib/scatterlist: merge fix for "drm: allow limiting the
>  scatter list size."
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
>  drivers/gpu/drm/drm_prime.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> index 11fe9ff76fd5..83ac901b65a2 100644
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -807,6 +807,7 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
>  				       struct page **pages, unsigned int nr_pages)
>  {
>  	struct sg_table *sg = NULL;
> +	struct scatterlist *sl;
>  	size_t max_segment = 0;
>  	int ret;
>  
> @@ -820,11 +821,13 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
>  		max_segment = dma_max_mapping_size(dev->dev);
>  	if (max_segment == 0 || max_segment > SCATTERLIST_MAX_SEGMENT)
>  		max_segment = SCATTERLIST_MAX_SEGMENT;
> -	ret = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
> +	sl = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
>  					  nr_pages << PAGE_SHIFT,
> -					  max_segment, GFP_KERNEL);
> -	if (ret)
> +					  max_segment, NULL, 0, GFP_KERNEL);
> +	if (IS_ERR(sl)) {
> +		ret = PTR_ERR(sl);
>  		goto out;
> +	}
>  
>  	return sg;
>  out:

This looks OK to me, thanks

Jason
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: linux-next: build failure after merge of the hmm tree
  2020-10-06 16:41 ` Jason Gunthorpe
@ 2020-10-12  4:19   ` Stephen Rothwell
  2020-10-15 21:11     ` Stephen Rothwell
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2020-10-12  4:19 UTC (permalink / raw)
  To: Jason Gunthorpe, Dave Airlie, Doug Ledford
  Cc: Leon Romanovsky, Linux Kernel Mailing List, DRI,
	Linux Next Mailing List, Gerd Hoffmann, Maor Gottlieb


[-- Attachment #1.1: Type: text/plain, Size: 2301 bytes --]

Hi all,

On Tue, 6 Oct 2020 13:41:20 -0300 Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> On Tue, Oct 06, 2020 at 08:35:08PM +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the hmm tree, today's linux-next build (arm
> > multi_v7_defconfig) failed like this:
> > 
> > 
> > Caused by commit
> > 
> >   07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of SG table from pages")
> > 
> > interacting with commit
> > 
> >   707d561f77b5 ("drm: allow limiting the scatter list size.")
> > 
> > from the drm tree.
> > 
> > I have added the following merge fix patch
> > 
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Tue, 6 Oct 2020 20:22:51 +1100
> > Subject: [PATCH] lib/scatterlist: merge fix for "drm: allow limiting the
> >  scatter list size."
> > 
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> >  drivers/gpu/drm/drm_prime.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> > index 11fe9ff76fd5..83ac901b65a2 100644
> > +++ b/drivers/gpu/drm/drm_prime.c
> > @@ -807,6 +807,7 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> >  				       struct page **pages, unsigned int nr_pages)
> >  {
> >  	struct sg_table *sg = NULL;
> > +	struct scatterlist *sl;
> >  	size_t max_segment = 0;
> >  	int ret;
> >  
> > @@ -820,11 +821,13 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> >  		max_segment = dma_max_mapping_size(dev->dev);
> >  	if (max_segment == 0 || max_segment > SCATTERLIST_MAX_SEGMENT)
> >  		max_segment = SCATTERLIST_MAX_SEGMENT;
> > -	ret = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
> > +	sl = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
> >  					  nr_pages << PAGE_SHIFT,
> > -					  max_segment, GFP_KERNEL);
> > -	if (ret)
> > +					  max_segment, NULL, 0, GFP_KERNEL);
> > +	if (IS_ERR(sl)) {
> > +		ret = PTR_ERR(sl);
> >  		goto out;
> > +	}
> >  
> >  	return sg;
> >  out:  
> 
> This looks OK to me, thanks

This merge fix patch is now being applied to the merge of the drm tree
since the rdma tree (that is merged before the drm tree) has merged the
hmm tree.

-- 
Cheers,
Stephen Rothwell

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

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: linux-next: build failure after merge of the hmm tree
  2020-10-12  4:19   ` Stephen Rothwell
@ 2020-10-15 21:11     ` Stephen Rothwell
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2020-10-15 21:11 UTC (permalink / raw)
  To: Jason Gunthorpe, Doug Ledford
  Cc: Dave Airlie, Leon Romanovsky, Linux Kernel Mailing List, DRI,
	Linux Next Mailing List, Gerd Hoffmann, Maor Gottlieb


[-- Attachment #1.1: Type: text/plain, Size: 2638 bytes --]

Hi all,

On Mon, 12 Oct 2020 15:19:48 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Tue, 6 Oct 2020 13:41:20 -0300 Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Tue, Oct 06, 2020 at 08:35:08PM +1100, Stephen Rothwell wrote:  
> > > Hi all,
> > > 
> > > After merging the hmm tree, today's linux-next build (arm
> > > multi_v7_defconfig) failed like this:
> > > 
> > > 
> > > Caused by commit
> > > 
> > >   07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of SG table from pages")
> > > 
> > > interacting with commit
> > > 
> > >   707d561f77b5 ("drm: allow limiting the scatter list size.")
> > > 
> > > from the drm tree.
> > > 
> > > I have added the following merge fix patch
> > > 
> > > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Date: Tue, 6 Oct 2020 20:22:51 +1100
> > > Subject: [PATCH] lib/scatterlist: merge fix for "drm: allow limiting the
> > >  scatter list size."
> > > 
> > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > >  drivers/gpu/drm/drm_prime.c | 9 ++++++---
> > >  1 file changed, 6 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> > > index 11fe9ff76fd5..83ac901b65a2 100644
> > > +++ b/drivers/gpu/drm/drm_prime.c
> > > @@ -807,6 +807,7 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> > >  				       struct page **pages, unsigned int nr_pages)
> > >  {
> > >  	struct sg_table *sg = NULL;
> > > +	struct scatterlist *sl;
> > >  	size_t max_segment = 0;
> > >  	int ret;
> > >  
> > > @@ -820,11 +821,13 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> > >  		max_segment = dma_max_mapping_size(dev->dev);
> > >  	if (max_segment == 0 || max_segment > SCATTERLIST_MAX_SEGMENT)
> > >  		max_segment = SCATTERLIST_MAX_SEGMENT;
> > > -	ret = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
> > > +	sl = __sg_alloc_table_from_pages(sg, pages, nr_pages, 0,
> > >  					  nr_pages << PAGE_SHIFT,
> > > -					  max_segment, GFP_KERNEL);
> > > -	if (ret)
> > > +					  max_segment, NULL, 0, GFP_KERNEL);
> > > +	if (IS_ERR(sl)) {
> > > +		ret = PTR_ERR(sl);
> > >  		goto out;
> > > +	}
> > >  
> > >  	return sg;
> > >  out:    
> > 
> > This looks OK to me, thanks  
> 
> This merge fix patch is now being applied to the merge of the drm tree
> since the rdma tree (that is merged before the drm tree) has merged the
> hmm tree.

This merge fix patch is now being applied to the merge of the rdma tree
since the Linus has merged the drm tree.

-- 
Cheers,
Stephen Rothwell

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

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: linux-next: build failure after merge of the hmm tree
  2021-08-23  7:50 Stephen Rothwell
  2021-08-23 17:33 ` Jason Gunthorpe
@ 2021-09-01 22:01 ` Stephen Rothwell
  1 sibling, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2021-09-01 22:01 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Dave Airlie, DRI, Jason Gunthorpe, Jason Gunthorpe,
	Leon Romanovsky, Maor Gottlieb, Maarten Lankhorst,
	Thomas Hellström, Linux Kernel Mailing List,
	Linux Next Mailing List, Doug Ledford

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

Hi ,

On Mon, 23 Aug 2021 17:50:27 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
> 
> After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
> 
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c: In function 'i915_ttm_tt_get_st':
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:396:7: error: implicit declaration of function '__sg_alloc_table_from_pages'; did you mean 'sg_alloc_table_from_pages'? [-Werror=implicit-function-declaration]
>   396 |  sg = __sg_alloc_table_from_pages
>       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |       sg_alloc_table_from_pages
> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:396:5: warning: assignment to 'struct scatterlist *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>   396 |  sg = __sg_alloc_table_from_pages
>       |     ^
> 
> Caused by commit
> 
>   fcbfe956561b ("lib/scatterlist: Provide a dedicated function to support table append")
> 
> interacting with commit
> 
>   213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend")
> 
> from the drm tree.
> 
> I have applied the following merge resolution patch.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 23 Aug 2021 17:46:27 +1000
> Subject: [PATCH] drm/i915/ttm: fix up for "lib/scatterlist: Provide a
>  dedicated function to support tableappend"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index 771eb2963123..d3d95934a047 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -382,7 +382,6 @@ i915_ttm_region(struct ttm_device *bdev, int ttm_mem_type)
>  static struct sg_table *i915_ttm_tt_get_st(struct ttm_tt *ttm)
>  {
>  	struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm);
> -	struct scatterlist *sg;
>  	struct sg_table *st;
>  	int ret;
>  
> @@ -393,13 +392,13 @@ static struct sg_table *i915_ttm_tt_get_st(struct ttm_tt *ttm)
>  	if (!st)
>  		return ERR_PTR(-ENOMEM);
>  
> -	sg = __sg_alloc_table_from_pages
> +	ret = sg_alloc_table_from_pages_segment
>  		(st, ttm->pages, ttm->num_pages, 0,
>  		 (unsigned long)ttm->num_pages << PAGE_SHIFT,
> -		 i915_sg_segment_size(), NULL, 0, GFP_KERNEL);
> -	if (IS_ERR(sg)) {
> +		 i915_sg_segment_size(), GFP_KERNEL);
> +	if (ret) {
>  		kfree(st);
> -		return ERR_CAST(sg);
> +		return ERR_PTR(ret);
>  	}
>  
>  	ret = dma_map_sgtable(i915_tt->dev, st, DMA_BIDIRECTIONAL, 0);

I am now applying this merge fix patch to the merge of the rdma tree
(since that has merged the hmm tree and the drm tree has been merged
upstream).

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the hmm tree
  2021-08-23  7:50 Stephen Rothwell
@ 2021-08-23 17:33 ` Jason Gunthorpe
  2021-09-01 22:01 ` Stephen Rothwell
  1 sibling, 0 replies; 10+ messages in thread
From: Jason Gunthorpe @ 2021-08-23 17:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Dave Airlie, DRI, Leon Romanovsky, Maor Gottlieb,
	Maarten Lankhorst, Thomas Hellström,
	Linux Kernel Mailing List, Linux Next Mailing List

On Mon, Aug 23, 2021 at 05:50:27PM +1000, Stephen Rothwell wrote:
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 23 Aug 2021 17:46:27 +1000
> Subject: [PATCH] drm/i915/ttm: fix up for "lib/scatterlist: Provide a
>  dedicated function to support tableappend"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
>  drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index 771eb2963123..d3d95934a047 100644
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -382,7 +382,6 @@ i915_ttm_region(struct ttm_device *bdev, int ttm_mem_type)
>  static struct sg_table *i915_ttm_tt_get_st(struct ttm_tt *ttm)
>  {
>  	struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm);
> -	struct scatterlist *sg;
>  	struct sg_table *st;
>  	int ret;
>  
> @@ -393,13 +392,13 @@ static struct sg_table *i915_ttm_tt_get_st(struct ttm_tt *ttm)
>  	if (!st)
>  		return ERR_PTR(-ENOMEM);
>  
> -	sg = __sg_alloc_table_from_pages
> +	ret = sg_alloc_table_from_pages_segment
>  		(st, ttm->pages, ttm->num_pages, 0,
>  		 (unsigned long)ttm->num_pages << PAGE_SHIFT,
> -		 i915_sg_segment_size(), NULL, 0, GFP_KERNEL);
> -	if (IS_ERR(sg)) {
> +		 i915_sg_segment_size(), GFP_KERNEL);
> +	if (ret) {
>  		kfree(st);
> -		return ERR_CAST(sg);
> +		return ERR_PTR(ret);
>  	}

Looks right, thanks

Jason

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

* linux-next: build failure after merge of the hmm tree
@ 2021-08-23  7:50 Stephen Rothwell
  2021-08-23 17:33 ` Jason Gunthorpe
  2021-09-01 22:01 ` Stephen Rothwell
  0 siblings, 2 replies; 10+ messages in thread
From: Stephen Rothwell @ 2021-08-23  7:50 UTC (permalink / raw)
  To: Jason Gunthorpe, Dave Airlie, DRI
  Cc: Jason Gunthorpe, Jason Gunthorpe, Leon Romanovsky, Maor Gottlieb,
	Maarten Lankhorst, Thomas Hellström,
	Linux Kernel Mailing List, Linux Next Mailing List

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

Hi all,

After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/gpu/drm/i915/gem/i915_gem_ttm.c: In function 'i915_ttm_tt_get_st':
drivers/gpu/drm/i915/gem/i915_gem_ttm.c:396:7: error: implicit declaration of function '__sg_alloc_table_from_pages'; did you mean 'sg_alloc_table_from_pages'? [-Werror=implicit-function-declaration]
  396 |  sg = __sg_alloc_table_from_pages
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |       sg_alloc_table_from_pages
drivers/gpu/drm/i915/gem/i915_gem_ttm.c:396:5: warning: assignment to 'struct scatterlist *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  396 |  sg = __sg_alloc_table_from_pages
      |     ^

Caused by commit

  fcbfe956561b ("lib/scatterlist: Provide a dedicated function to support table append")

interacting with commit

  213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend")

from the drm tree.

I have applied the following merge resolution patch.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 23 Aug 2021 17:46:27 +1000
Subject: [PATCH] drm/i915/ttm: fix up for "lib/scatterlist: Provide a
 dedicated function to support tableappend"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
index 771eb2963123..d3d95934a047 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
@@ -382,7 +382,6 @@ i915_ttm_region(struct ttm_device *bdev, int ttm_mem_type)
 static struct sg_table *i915_ttm_tt_get_st(struct ttm_tt *ttm)
 {
 	struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm);
-	struct scatterlist *sg;
 	struct sg_table *st;
 	int ret;
 
@@ -393,13 +392,13 @@ static struct sg_table *i915_ttm_tt_get_st(struct ttm_tt *ttm)
 	if (!st)
 		return ERR_PTR(-ENOMEM);
 
-	sg = __sg_alloc_table_from_pages
+	ret = sg_alloc_table_from_pages_segment
 		(st, ttm->pages, ttm->num_pages, 0,
 		 (unsigned long)ttm->num_pages << PAGE_SHIFT,
-		 i915_sg_segment_size(), NULL, 0, GFP_KERNEL);
-	if (IS_ERR(sg)) {
+		 i915_sg_segment_size(), GFP_KERNEL);
+	if (ret) {
 		kfree(st);
-		return ERR_CAST(sg);
+		return ERR_PTR(ret);
 	}
 
 	ret = dma_map_sgtable(i915_tt->dev, st, DMA_BIDIRECTIONAL, 0);
-- 
2.32.0

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the hmm tree
  2019-07-01 23:10 ` Jason Gunthorpe
@ 2019-07-03  1:28   ` Alex Deucher
  0 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2019-07-03  1:28 UTC (permalink / raw)
  To: Jason Gunthorpe, Kuehling, Felix, Yang, Philip
  Cc: Stephen Rothwell, Dave Airlie, Linux Kernel Mailing List, DRI,
	Linux Next Mailing List, Alex Deucher

On Tue, Jul 2, 2019 at 3:24 AM Jason Gunthorpe <jgg@mellanox.com> wrote:
>
> On Mon, Jul 01, 2019 at 09:33:04PM +1000, Stephen Rothwell wrote:
> > Hi all,
> >
> > After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
> > failed like this:
> >
> > mm/hmm.c: In function 'hmm_get_or_create':
> > mm/hmm.c:50:2: error: implicit declaration of function 'lockdep_assert_held_exclusive'; did you mean 'lockdep_assert_held_once'? [-Werror=implicit-function-declaration]
> >   lockdep_assert_held_exclusive(&mm->mmap_sem);
> >   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >   lockdep_assert_held_once
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_get_user_pages':
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:778:28: error: passing argument 2 of 'hmm_range_register' from incompatible pointer type [-Werror=incompatible-pointer-types]
> >   hmm_range_register(range, mm, start,
> >                             ^~
> > In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:35:
> > include/linux/hmm.h:464:29: note: expected 'struct hmm_mirror *' but argument is of type 'struct mm_struct *'
> >           struct hmm_mirror *mirror,
> >           ~~~~~~~~~~~~~~~~~~~^~~~~~
> >
> > Caused by commit
> >
> >   e36acfe6c86d ("mm/hmm: Use hmm_mirror not mm as an argument for hmm_range_register")
> >
> > interacting with commit
> >
> >   66c45500bfdc ("drm/amdgpu: use new HMM APIs and helpers")
> >
> > from the drm tree.
> >
> > All I could do for now was to mark the AMDGPU driver broken.  Please
> > submit a merge for for me (and later Linus) to use.
>
> This is expected, the AMD guys have the resolution for this from when
> they tested hmm.git..
>
> I think we are going to have to merge hmm.git into the amdgpu tree and
> push the resolution forward, as it looks kind of complicated to shift
> onto Linus or DRM.
>
> Probably amdgpu needs to gain a few patches making the hmm_mirror
> visible to amdgpu_ttm.c and then the merge resolution will be simple?
>
> AMD/DRM we have a few days left to decide on how best to handle the
> conflict, thanks.

Philip and Felix have been working on a branch with hmm merged into
drm-next with all the conflicts fixes up.  I'll post it out tomorrow
once I get Felix's latest revisions.

Alex

>
> Regards,
> Jason
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: linux-next: build failure after merge of the hmm tree
  2019-07-01 11:33 Stephen Rothwell
@ 2019-07-01 23:10 ` Jason Gunthorpe
  2019-07-03  1:28   ` Alex Deucher
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Gunthorpe @ 2019-07-01 23:10 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Dave Airlie, DRI, Linux Next Mailing List,
	Linux Kernel Mailing List, Philip Yang, Alex Deucher

On Mon, Jul 01, 2019 at 09:33:04PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
> 
> mm/hmm.c: In function 'hmm_get_or_create':
> mm/hmm.c:50:2: error: implicit declaration of function 'lockdep_assert_held_exclusive'; did you mean 'lockdep_assert_held_once'? [-Werror=implicit-function-declaration]
>   lockdep_assert_held_exclusive(&mm->mmap_sem);
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   lockdep_assert_held_once
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_get_user_pages':
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:778:28: error: passing argument 2 of 'hmm_range_register' from incompatible pointer type [-Werror=incompatible-pointer-types]
>   hmm_range_register(range, mm, start,
>                             ^~
> In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:35:
> include/linux/hmm.h:464:29: note: expected 'struct hmm_mirror *' but argument is of type 'struct mm_struct *'
>           struct hmm_mirror *mirror,
>           ~~~~~~~~~~~~~~~~~~~^~~~~~
> 
> Caused by commit
> 
>   e36acfe6c86d ("mm/hmm: Use hmm_mirror not mm as an argument for hmm_range_register")
> 
> interacting with commit
> 
>   66c45500bfdc ("drm/amdgpu: use new HMM APIs and helpers")
> 
> from the drm tree.
> 
> All I could do for now was to mark the AMDGPU driver broken.  Please
> submit a merge for for me (and later Linus) to use.

This is expected, the AMD guys have the resolution for this from when
they tested hmm.git..

I think we are going to have to merge hmm.git into the amdgpu tree and
push the resolution forward, as it looks kind of complicated to shift
onto Linus or DRM.

Probably amdgpu needs to gain a few patches making the hmm_mirror
visible to amdgpu_ttm.c and then the merge resolution will be simple?

AMD/DRM we have a few days left to decide on how best to handle the
conflict, thanks.

Regards,
Jason

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

* linux-next: build failure after merge of the hmm tree
@ 2019-07-01 11:33 Stephen Rothwell
  2019-07-01 23:10 ` Jason Gunthorpe
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2019-07-01 11:33 UTC (permalink / raw)
  To: Jason Gunthorpe, Dave Airlie, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Philip Yang,
	Alex Deucher

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

Hi all,

After merging the hmm tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

mm/hmm.c: In function 'hmm_get_or_create':
mm/hmm.c:50:2: error: implicit declaration of function 'lockdep_assert_held_exclusive'; did you mean 'lockdep_assert_held_once'? [-Werror=implicit-function-declaration]
  lockdep_assert_held_exclusive(&mm->mmap_sem);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  lockdep_assert_held_once
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_get_user_pages':
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:778:28: error: passing argument 2 of 'hmm_range_register' from incompatible pointer type [-Werror=incompatible-pointer-types]
  hmm_range_register(range, mm, start,
                            ^~
In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:35:
include/linux/hmm.h:464:29: note: expected 'struct hmm_mirror *' but argument is of type 'struct mm_struct *'
          struct hmm_mirror *mirror,
          ~~~~~~~~~~~~~~~~~~~^~~~~~

Caused by commit

  e36acfe6c86d ("mm/hmm: Use hmm_mirror not mm as an argument for hmm_range_register")

interacting with commit

  66c45500bfdc ("drm/amdgpu: use new HMM APIs and helpers")

from the drm tree.

All I could do for now was to mark the AMDGPU driver broken.  Please
submit a merge for for me (and later Linus) to use.

-- 
Cheers,
Stephen Rothwell

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

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

end of thread, other threads:[~2021-09-01 22:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06  9:35 linux-next: build failure after merge of the hmm tree Stephen Rothwell
2020-10-06 16:41 ` Jason Gunthorpe
2020-10-12  4:19   ` Stephen Rothwell
2020-10-15 21:11     ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2021-08-23  7:50 Stephen Rothwell
2021-08-23 17:33 ` Jason Gunthorpe
2021-09-01 22:01 ` Stephen Rothwell
2019-07-01 11:33 Stephen Rothwell
2019-07-01 23:10 ` Jason Gunthorpe
2019-07-03  1:28   ` Alex Deucher

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