Thread (37 messages) 37 messages, 11 authors, 2020-09-10

Re: [Intel-gfx] [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api

From: Tvrtko Ursulin <hidden>
Date: 2020-09-08 16:14:10
Also in: dri-devel, intel-gfx, linux-iommu, linux-mediatek, linux-rockchip

On 08/09/2020 16:44, Logan Gunthorpe wrote:
On 2020-09-08 9:28 a.m., Tvrtko Ursulin wrote:
quoted
quoted
diff --git a/drivers/gpu/drm/i915/i915_scatterlist.h
b/drivers/gpu/drm/i915/i915
index b7b59328cb76..9367ac801f0c 100644
--- a/drivers/gpu/drm/i915/i915_scatterlist.h
+++ b/drivers/gpu/drm/i915/i915_scatterlist.h
@@ -27,13 +27,19 @@ static __always_inline struct sgt_iter {
   } __sgt_iter(struct scatterlist *sgl, bool dma) {
          struct sgt_iter s = { .sgp = sgl };

+       if (sgl && !sg_dma_len(s.sgp))
I'd extend the condition to be, just to be safe:
     if (dma && sgl && !sg_dma_len(s.sgp))
Right, good catch, that's definitely necessary.
quoted
quoted
+               s.sgp = NULL;
+
          if (s.sgp) {
                  s.max = s.curr = s.sgp->offset;
-               s.max += s.sgp->length;
-               if (dma)
+
+               if (dma) {
+                       s.max += sg_dma_len(s.sgp);
                          s.dma = sg_dma_address(s.sgp);
-               else
+               } else {
+                       s.max += s.sgp->length;
                          s.pfn = page_to_pfn(sg_page(s.sgp));
+               }
Otherwise has this been tested or alternatively how to test it? (How to
repro the issue.)
It has not been tested. To test it, you need Tom's patch set without the
last "DO NOT MERGE" patch:

https://lkml.kernel.org/lkml/20200907070035.GA25114@infradead.org/T/
Tom, do you have a branch somewhere I could pull from? (Just being lazy 
about downloading a bunch of messages from the archives.)

What GPU is in your Lenovo x1 carbon 5th generation and what 
graphical/desktop setup I need to repro?

Regards,

Tvrtko

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help