public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Add __rcu to radix tree slot pointer
@ 2017-09-01 17:12 ville.syrjala
  2017-09-01 17:12 ` [PATCH 2/2] drm/i915: io unmap functions want __iomem ville.syrjala
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: ville.syrjala @ 2017-09-01 17:12 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

radix_tree_for_each_slot() wants an __rcu annotated pointer for the
slot. So let's add the annotation.

Fixes the following sparse warnings:
i915_gem.c:2217:9: warning: incorrect type in assignment (different address spaces)
i915_gem.c:2217:9:    expected void **slot
i915_gem.c:2217:9:    got void [noderef] <asn:4>**
i915_gem.c:2217:9: warning: incorrect type in assignment (different address spaces)
i915_gem.c:2217:9:    expected void **slot
i915_gem.c:2217:9:    got void [noderef] <asn:4>**
i915_gem.c:2217:9: warning: incorrect type in argument 1 (different address spaces)
i915_gem.c:2217:9:    expected void [noderef] <asn:4>**slot
i915_gem.c:2217:9:    got void **slot
i915_gem.c:2217:9: warning: incorrect type in assignment (different address spaces)
i915_gem.c:2217:9:    expected void **slot
i915_gem.c:2217:9:    got void [noderef] <asn:4>**

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Fixes: 96d776345277 ("drm/i915: Use a radixtree for random access to the object's backing storage")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e4cc08bc518c..945c4650c249 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2212,7 +2212,7 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj,
 static void __i915_gem_object_reset_page_iter(struct drm_i915_gem_object *obj)
 {
 	struct radix_tree_iter iter;
-	void **slot;
+	void __rcu **slot;
 
 	radix_tree_for_each_slot(slot, &obj->mm.get_page.radix, &iter, 0)
 		radix_tree_delete(&obj->mm.get_page.radix, iter.index);
-- 
2.13.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 2/2] drm/i915: io unmap functions want __iomem
  2017-09-01 17:12 [PATCH 1/2] drm/i915: Add __rcu to radix tree slot pointer ville.syrjala
@ 2017-09-01 17:12 ` ville.syrjala
  2017-09-01 18:53   ` Chris Wilson
  2017-09-01 18:39 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: ville.syrjala @ 2017-09-01 17:12 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Don't cast away the __iomem from the io_mapping functions so that
sparse won't be so unhappy when we pass the pointer to the unmap
functions. Instead let's move the cast to where we actually use the
pointer.

Fixes the following sparse warnings:
i915_gem.c:1022:33: warning: incorrect type in argument 1 (different address spaces)
i915_gem.c:1022:33:    expected void [noderef] <asn:2>*vaddr
i915_gem.c:1022:33:    got void *[assigned] vaddr
i915_gem.c:1027:34: warning: incorrect type in argument 1 (different address spaces)
i915_gem.c:1027:34:    expected void [noderef] <asn:2>*vaddr
i915_gem.c:1027:34:    got void *[assigned] vaddr
i915_gem.c:1199:33: warning: incorrect type in argument 1 (different address spaces)
i915_gem.c:1199:33:    expected void [noderef] <asn:2>*vaddr
i915_gem.c:1199:33:    got void *[assigned] vaddr
i915_gem.c:1204:34: warning: incorrect type in argument 1 (different address spaces)
i915_gem.c:1204:34:    expected void [noderef] <asn:2>*vaddr
i915_gem.c:1204:34:    got void *[assigned] vaddr

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 945c4650c249..72008e4c8c8f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1013,17 +1013,20 @@ gtt_user_read(struct io_mapping *mapping,
 	      loff_t base, int offset,
 	      char __user *user_data, int length)
 {
-	void *vaddr;
+	void __iomem *vaddr;
 	unsigned long unwritten;
 
 	/* We can use the cpu mem copy function because this is X86. */
-	vaddr = (void __force *)io_mapping_map_atomic_wc(mapping, base);
-	unwritten = __copy_to_user_inatomic(user_data, vaddr + offset, length);
+	vaddr = io_mapping_map_atomic_wc(mapping, base);
+	unwritten = __copy_to_user_inatomic(user_data,
+					    (void __force *)vaddr + offset,
+					    length);
 	io_mapping_unmap_atomic(vaddr);
 	if (unwritten) {
-		vaddr = (void __force *)
-			io_mapping_map_wc(mapping, base, PAGE_SIZE);
-		unwritten = copy_to_user(user_data, vaddr + offset, length);
+		vaddr = io_mapping_map_wc(mapping, base, PAGE_SIZE);
+		unwritten = copy_to_user(user_data,
+					 (void __force *)vaddr + offset,
+					 length);
 		io_mapping_unmap(vaddr);
 	}
 	return unwritten;
@@ -1189,18 +1192,18 @@ ggtt_write(struct io_mapping *mapping,
 	   loff_t base, int offset,
 	   char __user *user_data, int length)
 {
-	void *vaddr;
+	void __iomem *vaddr;
 	unsigned long unwritten;
 
 	/* We can use the cpu mem copy function because this is X86. */
-	vaddr = (void __force *)io_mapping_map_atomic_wc(mapping, base);
-	unwritten = __copy_from_user_inatomic_nocache(vaddr + offset,
+	vaddr = io_mapping_map_atomic_wc(mapping, base);
+	unwritten = __copy_from_user_inatomic_nocache((void __force *)vaddr + offset,
 						      user_data, length);
 	io_mapping_unmap_atomic(vaddr);
 	if (unwritten) {
-		vaddr = (void __force *)
-			io_mapping_map_wc(mapping, base, PAGE_SIZE);
-		unwritten = copy_from_user(vaddr + offset, user_data, length);
+		vaddr = io_mapping_map_wc(mapping, base, PAGE_SIZE);
+		unwritten = copy_from_user((void __force *)vaddr + offset,
+					   user_data, length);
 		io_mapping_unmap(vaddr);
 	}
 
-- 
2.13.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer
  2017-09-01 17:12 [PATCH 1/2] drm/i915: Add __rcu to radix tree slot pointer ville.syrjala
  2017-09-01 17:12 ` [PATCH 2/2] drm/i915: io unmap functions want __iomem ville.syrjala
@ 2017-09-01 18:39 ` Patchwork
  2017-09-01 18:51 ` [PATCH 1/2] " Chris Wilson
  2017-09-02  0:46 ` ✓ Fi.CI.IGT: success for series starting with [1/2] " Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2017-09-01 18:39 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer
URL   : https://patchwork.freedesktop.org/series/29716/
State : success

== Summary ==

Series 29716v1 series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer
https://patchwork.freedesktop.org/api/1.0/series/29716/revisions/1/mbox/

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                fail       -> PASS       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                skip       -> PASS       (fi-skl-x1585l) fdo#101781

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:454s
fi-blb-e6850     total:288  pass:224  dwarn:1   dfail:0   fail:0   skip:63  time:357s
fi-bsw-n3050     total:288  pass:243  dwarn:0   dfail:0   fail:0   skip:45  time:554s
fi-bwr-2160      total:288  pass:184  dwarn:0   dfail:0   fail:0   skip:104 time:254s
fi-bxt-j4205     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:521s
fi-byt-j1900     total:288  pass:254  dwarn:1   dfail:0   fail:0   skip:33  time:529s
fi-byt-n2820     total:288  pass:250  dwarn:1   dfail:0   fail:0   skip:37  time:516s
fi-elk-e7500     total:288  pass:230  dwarn:0   dfail:0   fail:0   skip:58  time:439s
fi-glk-2a        total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:611s
fi-hsw-4770      total:288  pass:263  dwarn:0   dfail:0   fail:0   skip:25  time:445s
fi-hsw-4770r     total:288  pass:263  dwarn:0   dfail:0   fail:0   skip:25  time:425s
fi-ilk-650       total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:427s
fi-ivb-3520m     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:509s
fi-ivb-3770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:477s
fi-kbl-7500u     total:288  pass:264  dwarn:1   dfail:0   fail:0   skip:23  time:519s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:595s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:601s
fi-pnv-d510      total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:520s
fi-skl-6260u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:470s
fi-skl-6700k     total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:535s
fi-skl-6770hq    total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:495s
fi-skl-gvtdvm    total:288  pass:266  dwarn:0   dfail:0   fail:0   skip:22  time:443s
fi-skl-x1585l    total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:510s
fi-snb-2520m     total:288  pass:251  dwarn:0   dfail:0   fail:0   skip:37  time:549s
fi-snb-2600      total:288  pass:249  dwarn:0   dfail:0   fail:1   skip:38  time:413s
fi-bdw-gvtdvm failed to connect after reboot

de9e73663a51fb7f849ef13ddb3338a20d91970c drm-tip: 2017y-09m-01d-17h-32m-40s UTC integration manifest
aafa46dd9ffa drm/i915: io unmap functions want __iomem
388ec38e1b57 drm/i915: Add __rcu to radix tree slot pointer

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5570/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915: Add __rcu to radix tree slot pointer
  2017-09-01 17:12 [PATCH 1/2] drm/i915: Add __rcu to radix tree slot pointer ville.syrjala
  2017-09-01 17:12 ` [PATCH 2/2] drm/i915: io unmap functions want __iomem ville.syrjala
  2017-09-01 18:39 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer Patchwork
@ 2017-09-01 18:51 ` Chris Wilson
  2017-09-02  0:46 ` ✓ Fi.CI.IGT: success for series starting with [1/2] " Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2017-09-01 18:51 UTC (permalink / raw)
  To: ville.syrjala, intel-gfx

Quoting ville.syrjala@linux.intel.com (2017-09-01 18:12:51)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> radix_tree_for_each_slot() wants an __rcu annotated pointer for the
> slot. So let's add the annotation.
> 
> Fixes the following sparse warnings:
> i915_gem.c:2217:9: warning: incorrect type in assignment (different address spaces)
> i915_gem.c:2217:9:    expected void **slot
> i915_gem.c:2217:9:    got void [noderef] <asn:4>**
> i915_gem.c:2217:9: warning: incorrect type in assignment (different address spaces)
> i915_gem.c:2217:9:    expected void **slot
> i915_gem.c:2217:9:    got void [noderef] <asn:4>**
> i915_gem.c:2217:9: warning: incorrect type in argument 1 (different address spaces)
> i915_gem.c:2217:9:    expected void [noderef] <asn:4>**slot
> i915_gem.c:2217:9:    got void **slot
> i915_gem.c:2217:9: warning: incorrect type in assignment (different address spaces)
> i915_gem.c:2217:9:    expected void **slot
> i915_gem.c:2217:9:    got void [noderef] <asn:4>**
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Fixes: 96d776345277 ("drm/i915: Use a radixtree for random access to the object's backing storage")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Looks ok,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: io unmap functions want __iomem
  2017-09-01 17:12 ` [PATCH 2/2] drm/i915: io unmap functions want __iomem ville.syrjala
@ 2017-09-01 18:53   ` Chris Wilson
  2017-09-04 17:00     ` Ville Syrjälä
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2017-09-01 18:53 UTC (permalink / raw)
  To: ville.syrjala, intel-gfx

Quoting ville.syrjala@linux.intel.com (2017-09-01 18:12:52)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Don't cast away the __iomem from the io_mapping functions so that
> sparse won't be so unhappy when we pass the pointer to the unmap
> functions. Instead let's move the cast to where we actually use the
> pointer.
> 
> Fixes the following sparse warnings:
> i915_gem.c:1022:33: warning: incorrect type in argument 1 (different address spaces)
> i915_gem.c:1022:33:    expected void [noderef] <asn:2>*vaddr
> i915_gem.c:1022:33:    got void *[assigned] vaddr
> i915_gem.c:1027:34: warning: incorrect type in argument 1 (different address spaces)
> i915_gem.c:1027:34:    expected void [noderef] <asn:2>*vaddr
> i915_gem.c:1027:34:    got void *[assigned] vaddr
> i915_gem.c:1199:33: warning: incorrect type in argument 1 (different address spaces)
> i915_gem.c:1199:33:    expected void [noderef] <asn:2>*vaddr
> i915_gem.c:1199:33:    got void *[assigned] vaddr
> i915_gem.c:1204:34: warning: incorrect type in argument 1 (different address spaces)
> i915_gem.c:1204:34:    expected void [noderef] <asn:2>*vaddr
> i915_gem.c:1204:34:    got void *[assigned] vaddr
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

6 of one, half a dozen of the other. We need to do the __force cast
somewhere, so whichever is more convenient.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer
  2017-09-01 17:12 [PATCH 1/2] drm/i915: Add __rcu to radix tree slot pointer ville.syrjala
                   ` (2 preceding siblings ...)
  2017-09-01 18:51 ` [PATCH 1/2] " Chris Wilson
@ 2017-09-02  0:46 ` Patchwork
  3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2017-09-02  0:46 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer
URL   : https://patchwork.freedesktop.org/series/29716/
State : success

== Summary ==

shard-hsw        total:2263 pass:1232 dwarn:0   dfail:0   fail:15  skip:1015 time:9492s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5570/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 2/2] drm/i915: io unmap functions want __iomem
  2017-09-01 18:53   ` Chris Wilson
@ 2017-09-04 17:00     ` Ville Syrjälä
  0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2017-09-04 17:00 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Fri, Sep 01, 2017 at 07:53:05PM +0100, Chris Wilson wrote:
> Quoting ville.syrjala@linux.intel.com (2017-09-01 18:12:52)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Don't cast away the __iomem from the io_mapping functions so that
> > sparse won't be so unhappy when we pass the pointer to the unmap
> > functions. Instead let's move the cast to where we actually use the
> > pointer.
> > 
> > Fixes the following sparse warnings:
> > i915_gem.c:1022:33: warning: incorrect type in argument 1 (different address spaces)
> > i915_gem.c:1022:33:    expected void [noderef] <asn:2>*vaddr
> > i915_gem.c:1022:33:    got void *[assigned] vaddr
> > i915_gem.c:1027:34: warning: incorrect type in argument 1 (different address spaces)
> > i915_gem.c:1027:34:    expected void [noderef] <asn:2>*vaddr
> > i915_gem.c:1027:34:    got void *[assigned] vaddr
> > i915_gem.c:1199:33: warning: incorrect type in argument 1 (different address spaces)
> > i915_gem.c:1199:33:    expected void [noderef] <asn:2>*vaddr
> > i915_gem.c:1199:33:    got void *[assigned] vaddr
> > i915_gem.c:1204:34: warning: incorrect type in argument 1 (different address spaces)
> > i915_gem.c:1204:34:    expected void [noderef] <asn:2>*vaddr
> > i915_gem.c:1204:34:    got void *[assigned] vaddr
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 6 of one, half a dozen of the other. We need to do the __force cast
> somewhere, so whichever is more convenient.
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks. Series pushed to dinq.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-09-04 17:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-01 17:12 [PATCH 1/2] drm/i915: Add __rcu to radix tree slot pointer ville.syrjala
2017-09-01 17:12 ` [PATCH 2/2] drm/i915: io unmap functions want __iomem ville.syrjala
2017-09-01 18:53   ` Chris Wilson
2017-09-04 17:00     ` Ville Syrjälä
2017-09-01 18:39 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add __rcu to radix tree slot pointer Patchwork
2017-09-01 18:51 ` [PATCH 1/2] " Chris Wilson
2017-09-02  0:46 ` ✓ Fi.CI.IGT: success for series starting with [1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox