Skip to content

Commit ab74cfe

Browse files
author
Christoph Hellwig
committed
net: remove the PCI_DMA_BUS_IS_PHYS check in illegal_highdma
These days the dma mapping routines must be able to handle any address supported by the device, be that using an iommu, or swiotlb if none is supported. With that the PCI_DMA_BUS_IS_PHYS check in illegal_highdma is not needed and can be removed. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: David S. Miller <davem@davemloft.net>
1 parent 164c3d0 commit ab74cfe

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

net/core/dev.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,11 +2884,7 @@ void netdev_rx_csum_fault(struct net_device *dev)
28842884
EXPORT_SYMBOL(netdev_rx_csum_fault);
28852885
#endif
28862886

2887-
/* Actually, we should eliminate this check as soon as we know, that:
2888-
* 1. IOMMU is present and allows to map all the memory.
2889-
* 2. No high memory really exists on this machine.
2890-
*/
2891-
2887+
/* XXX: check that highmem exists at all on the given machine. */
28922888
static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
28932889
{
28942890
#ifdef CONFIG_HIGHMEM
@@ -2902,20 +2898,6 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
29022898
return 1;
29032899
}
29042900
}
2905-
2906-
if (PCI_DMA_BUS_IS_PHYS) {
2907-
struct device *pdev = dev->dev.parent;
2908-
2909-
if (!pdev)
2910-
return 0;
2911-
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2912-
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2913-
dma_addr_t addr = page_to_phys(skb_frag_page(frag));
2914-
2915-
if (!pdev->dma_mask || addr + PAGE_SIZE - 1 > *pdev->dma_mask)
2916-
return 1;
2917-
}
2918-
}
29192901
#endif
29202902
return 0;
29212903
}

0 commit comments

Comments
 (0)