Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp117636pxk; Wed, 9 Sep 2020 00:09:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhvhZVSq1tZVKS1+w+QjDFE0ru5l8fjGCPkTUznUhV+ZT7xG2FxoBWzZL/kv8dnW94Maap X-Received: by 2002:a17:906:4d4d:: with SMTP id b13mr2182998ejv.221.1599635366010; Wed, 09 Sep 2020 00:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599635366; cv=none; d=google.com; s=arc-20160816; b=OLmcqzcrN9aayC5Q1GwNo4+oqHryjopnP87cvrG5iVZiTTvvjJDfRIdod4aot/mK5L aZUJc4z5zkXNoRlmg9+Gss1Fxb/yfVuaPLkuzUB8eI2Id4vKPbsw89PDo9IinKHqNIS1 RyDX6TgkkgG3x9jAPlpTGgH1218zPlQRoxNsQxBpxRh46H1496CMjWVHXUigBsnbIxeU I8EEQutMlJmO4vE7WaiouPnSb+a57Qy+rH1UnBQNpCYI6+A67iH0f9UPoo+1DWs/t7lS 1hVh0aBxzB+OG7FxwtOOlzFh27JpaDlHiMuqdgtAV+93TqPZRBfeBVVcHjAsaPtdZL7l tVyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hCw8xGdlNdOCLWn3JTGudEyCmE42OPi648sQ0UReuL4=; b=ZEyyZrH4CF7YFAzM6Sh5lIHQovGs4p3KI4jNNY47G3j6TTEsjoHmSDeU/m5P6Z0pKH 5uv/bPK+swNYt6jfWyOkZW+yLA4qTLvVNa64+nVlphZ+UgWrYxmvpybZZzdb2/tTaOxn 2IqVctjVB2Rm0xpPM/Ivg/8tjWIvYDlfAFR9yQ+mPR3sDrblGCpDBPkoiZJt/4+p6/Iz rJcQ2XbeRcylS774yqKYQExv/XAsROOwrLaGCPsE+TD+I7ezpoDKy89tLm7rdBLxtgjq geUPjobTrRUacYgts/WRCjKeYsds2Wskh8wy0xVt2BguxzjwBVONLwTbvf16uU0h79+t 7LGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=QWCA9gPZ; 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 h22si890277ejd.367.2020.09.09.00.09.03; Wed, 09 Sep 2020 00:09:25 -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=@infradead.org header.s=casper.20170209 header.b=QWCA9gPZ; 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 S1727005AbgIIHG3 (ORCPT + 99 others); Wed, 9 Sep 2020 03:06:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbgIIHG2 (ORCPT ); Wed, 9 Sep 2020 03:06:28 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE77C061573 for ; Wed, 9 Sep 2020 00:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=hCw8xGdlNdOCLWn3JTGudEyCmE42OPi648sQ0UReuL4=; b=QWCA9gPZCZ3wzIlKZV6poclcFq LzfIY4lmnE8VjlKQlNvIxOZhHe41lSL2CEaz90i97YxxVXfVK2X9ipiCtBI5MxDA/GrklQLLksV9N A+Npi3L42x5yATBqMul+YVCITK1IZThjOn0EUXnndO9qp7cPI0FFjw4jGkioLYG7yo+OIXJ90SVhh p828BaX8dZFZEzYrjLX+PcMmEzTQ4QaFDIf9VTMHiOulzyKvRLp4LgQRkKE6IWheY0Qo2AZRcG4t/ E31RYqm6VXEyf9QSWC6uKFR7sdjlY3BZMedrpiAOMTsUbtVtomspvCxcQvlyn4mr8HghIktPWnf/d Z5aMpAyA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFuBQ-0007rM-HR; Wed, 09 Sep 2020 07:06:20 +0000 Date: Wed, 9 Sep 2020 08:06:20 +0100 From: Christoph Hellwig To: Lu Baolu Cc: Christoph Hellwig , Tom Murphy , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Linux Kernel Mailing List , Jani Nikula , iommu@lists.linux-foundation.org, Rodrigo Vivi , David Woodhouse Subject: Re: [PATCH V2 5/5] DO NOT MERGE: iommu: disable list appending in dma-iommu Message-ID: <20200909070620.GB28245@infradead.org> References: <20200903201839.7327-1-murphyt7@tcd.ie> <20200903201839.7327-6-murphyt7@tcd.ie> <20200907070035.GA25114@infradead.org> <20200908053619.GA15418@infradead.org> <20200908055510.GA19078@infradead.org> <9655fdc9-6ea0-e4c1-e104-a9a8981ecb1e@linux.intel.com> <20200908062326.GB20774@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 09:43:09AM +0800, Lu Baolu wrote: > + /* > + * The Intel graphic device driver is used to assume that the > returned > + * sg list is not combound. This blocks the efforts of converting > the This adds pointless overly long lines. > + * Intel IOMMU driver to dma-iommu api's. Add this quirk to make the > + * device driver work and should be removed once it's fixed in i915 > + * driver. > + */ > + if (dev_is_pci(dev) && > + to_pci_dev(dev)->vendor == PCI_VENDOR_ID_INTEL && > + (to_pci_dev(dev)->class >> 16) == PCI_BASE_CLASS_DISPLAY) { > + for_each_sg(sg, s, nents, i) { > + unsigned int s_iova_off = sg_dma_address(s); > + unsigned int s_length = sg_dma_len(s); > + unsigned int s_iova_len = s->length; > + > + s->offset += s_iova_off; > + s->length = s_length; > + sg_dma_address(s) = dma_addr + s_iova_off; > + sg_dma_len(s) = s_length; > + dma_addr += s_iova_len; > + } > + > + return nents; > + } This wants an IS_ENABLED() check. And probably a pr_once reminding of the workaround.