Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4057227pxk; Tue, 8 Sep 2020 09:34:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmSKrLTDHOt8mcfSnBL/cj3hRSCB5PvO6xFI+4wENI8r518Gbe1K5Kcvjov838yavzOx0S X-Received: by 2002:a17:906:82d1:: with SMTP id a17mr26280171ejy.385.1599582861544; Tue, 08 Sep 2020 09:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599582861; cv=none; d=google.com; s=arc-20160816; b=Ag4DZ49dsWasRh2gYTJ6sF0lJLh4Ec70iaqh/iS0QCLfL0m6yi7XLnT1he34Sk/Ft2 zfJ41bSY+xoGrqDH2WVbuutqNWVt0SzfqEEUwV57X0krLSoidVcwDxMdn6QCUPUbRpon CAhMOppkHdiZcxgKwmzHe9NlykgNzqtPQ3oL/cb8qC5uoY5ZEsDU6Ka7ypz43Pnzrzas xw0jDlxpgKpagBw0IoJP4VZH5LyHYq426JQkIWbemNUxnCmdYkp+1Edp+BdolJVdtglx 7OkMMxu2d+oymQlI4cUNttbTfr6eFw7vShVdvdMPb8ol9GCRarQjpjgVeaEjv1h3GIO/ 7e7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=DvSiEr2JCy+2h9dy7CIecEenG2gQsa0A5OP2d9PI/p0=; b=acket90q6UAV3Ke7kaI6LOfHsGbBM7uvQ31xxYjJ9i/CiLsLO8ZHkZmuDDINSXFQZy SQfEDrUc8HghMQE60RzSAeBKLncM1TumVrw1SziYbQCe1KEgrW0swJWOEpz6JO7DJJfN I/qgXRZpPwk99/X0CaWukx2tzU+lmNx8PN93xliCL3LPThE8i2XJdQpkvmrPss+WOY1Q gGkuS3oT6Ioj+J6lRaBe5noJPjG2mtGvA56QvdXg+EL57rbaCBzXKnFA3a4REZjd6pJG TJwHuBQ5A9d5YSPC1Lh8TvoHEirgsBR8DcVBq/2e605ck9s+SWlI/nXuwDNUmiCfaHcg WNnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=dbg0PtMP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si5618497eja.484.2020.09.08.09.33.58; Tue, 08 Sep 2020 09:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=dbg0PtMP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731765AbgIHQav (ORCPT + 99 others); Tue, 8 Sep 2020 12:30:51 -0400 Received: from ale.deltatee.com ([204.191.154.188]:52582 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731915AbgIHQ1k (ORCPT ); Tue, 8 Sep 2020 12:27:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DvSiEr2JCy+2h9dy7CIecEenG2gQsa0A5OP2d9PI/p0=; b=dbg0PtMPK+HbvI6GMZzh/J5E8Z Q/TWc7UsDFhg1cOVJt/pysWKo3QQRWraF1mqHM6mdRGQ6y0rj+OXqZUSgbgyS5kW1MF22xpb3bm/M J9Rf7mpjgRlZVOcx1SZJ6EJp7lFy55R6nqk8PsS8AEsD0hf0g4vJC65mDtFEAYzf7cE0mQHAAVUlU S7bbDUQqTHtHsrq5f8RHYZU0yCa5rG3lpeqMLTKlNXStV+C6+vhM0UL/8Wjc5CgLnNZYF3jPybjc/ ulyb1L7dumDVfTJQeMlSwf7IyaVvWKGWBe0b9ikUV9lDLMezAf5m+fY9DJk+AU+8aTTS01s/mCgwR I5zJe2Ew==; Received: from s01060023bee90a7d.cg.shawcable.net ([24.64.145.4] helo=[192.168.0.10]) by ale.deltatee.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kFfnI-0008Go-Gj; Tue, 08 Sep 2020 09:44:29 -0600 To: Tvrtko Ursulin , Tom Murphy Cc: kvm@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, Bjorn Andersson , linux-tegra@vger.kernel.org, Julien Grall , Will Deacon , Marek Szyprowski , Jean-Philippe Brucker , linux-samsung-soc@vger.kernel.org, Marc Zyngier , Krzysztof Kozlowski , Jonathan Hunter , Christoph Hellwig , linux-rockchip@lists.infradead.org, Andy Gross , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Matthias Brugger , Thomas Gleixner , virtualization@lists.linux-foundation.org, Gerald Schaefer , David Woodhouse , Cornelia Huck , Linux Kernel Mailing List , iommu@lists.linux-foundation.org, Kukjin Kim , Robin Murphy References: <20191221150402.13868-1-murphyt7@tcd.ie> <465815ae-9292-f37a-59b9-03949cb68460@deltatee.com> <20200529124523.GA11817@infradead.org> <33137cfb-603c-86e8-1091-f36117ecfaf3@deltatee.com> <766525c3-4da9-6db7-cd90-fb4b82cd8083@deltatee.com> <60a82319-cbee-4cd1-0d5e-3c407cc51330@linux.intel.com> From: Logan Gunthorpe Message-ID: Date: Tue, 8 Sep 2020 09:44:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <60a82319-cbee-4cd1-0d5e-3c407cc51330@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 24.64.145.4 X-SA-Exim-Rcpt-To: robin.murphy@arm.com, kgene@kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, cohuck@redhat.com, dwmw2@infradead.org, gerald.schaefer@de.ibm.com, virtualization@lists.linux-foundation.org, tglx@linutronix.de, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, agross@kernel.org, linux-rockchip@lists.infradead.org, hch@infradead.org, jonathanh@nvidia.com, krzk@kernel.org, maz@kernel.org, linux-samsung-soc@vger.kernel.org, jean-philippe@linaro.org, m.szyprowski@samsung.com, will@kernel.org, julien.grall@arm.com, linux-tegra@vger.kernel.org, bjorn.andersson@linaro.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, kvm@vger.kernel.org, murphyt7@tcd.ie, tvrtko.ursulin@linux.intel.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [Intel-gfx] [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-08 9:28 a.m., Tvrtko Ursulin wrote: >> >> 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. >> +               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/ Thanks, Logan