Skip to content

Commit 4df7b22

Browse files
LuBaoluwilldeacon
authored andcommitted
Revert "iommu: Add quirk for Intel graphic devices in map_sg"
This reverts commit 65f746e. As commit 8a473db ("drm/i915: Fix DMA mapped scatterlist walks") and commit 934941e ("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>
1 parent 1efd17e commit 4df7b22

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

drivers/iommu/dma-iommu.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -863,33 +863,6 @@ static int __finalise_sg(struct device *dev, struct scatterlist *sg, int nents,
863863
unsigned int cur_len = 0, max_len = dma_get_max_seg_size(dev);
864864
int i, count = 0;
865865

866-
/*
867-
* The Intel graphic driver is used to assume that the returned
868-
* sg list is not combound. This blocks the efforts of converting
869-
* Intel IOMMU driver to dma-iommu api's. Add this quirk to make the
870-
* device driver work and should be removed once it's fixed in i915
871-
* driver.
872-
*/
873-
if (IS_ENABLED(CONFIG_DRM_I915) && dev_is_pci(dev) &&
874-
to_pci_dev(dev)->vendor == PCI_VENDOR_ID_INTEL &&
875-
(to_pci_dev(dev)->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
876-
for_each_sg(sg, s, nents, i) {
877-
unsigned int s_iova_off = sg_dma_address(s);
878-
unsigned int s_length = sg_dma_len(s);
879-
unsigned int s_iova_len = s->length;
880-
881-
s->offset += s_iova_off;
882-
s->length = s_length;
883-
sg_dma_address(s) = dma_addr + s_iova_off;
884-
sg_dma_len(s) = s_length;
885-
dma_addr += s_iova_len;
886-
887-
pr_info_once("sg combining disabled due to i915 driver\n");
888-
}
889-
890-
return nents;
891-
}
892-
893866
for_each_sg(sg, s, nents, i) {
894867
/* Restore this segment's original unaligned fields first */
895868
unsigned int s_iova_off = sg_dma_address(s);

0 commit comments

Comments
 (0)