]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Revert "iommu: Add quirk for Intel graphic devices in map_sg"
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 31 Dec 2020 00:53:22 +0000 (08:53 +0800)
committerWill Deacon <will@kernel.org>
Thu, 7 Jan 2021 13:27:14 +0000 (13:27 +0000)
This reverts commit 65f746e8285f0a67d43517d86fedb9e29ead49f2.

As commit 8a473dbadccf ("drm/i915: Fix DMA mapped scatterlist walks") and
commit 934941ed5a30 ("drm/i915: Fix DMA mapped scatterlist lookup") fixed
the DMA scatterlist limitations in the i915 driver, remove this temporary
workaround.

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Tom Murphy <murphyt7@tcd.ie>
Cc: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20201231005323.2178523-4-baolu.lu@linux.intel.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/dma-iommu.c

index f0305e6aac1b87fa3ca15ce7871ad7f943614131..4078358ed66ea86ddf61d24b982c159b35087d3a 100644 (file)
@@ -863,33 +863,6 @@ static int __finalise_sg(struct device *dev, struct scatterlist *sg, int nents,
        unsigned int cur_len = 0, max_len = dma_get_max_seg_size(dev);
        int i, count = 0;
 
-       /*
-        * The Intel graphic driver is used to assume that the returned
-        * sg list is not combound. This blocks the efforts of converting
-        * 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 (IS_ENABLED(CONFIG_DRM_I915) && 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;
-
-                       pr_info_once("sg combining disabled due to i915 driver\n");
-               }
-
-               return nents;
-       }
-
        for_each_sg(sg, s, nents, i) {
                /* Restore this segment's original unaligned fields first */
                unsigned int s_iova_off = sg_dma_address(s);