aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-03 14:31:35 -0400
committerChristoph Hellwig <hch@lst.de>2018-05-07 01:15:41 -0400
commitab74cfebafa3b71caa1e82793032b4867dcf5ea6 (patch)
tree2c2bdf774f6e393e967b349b54ddda7ec9d4aab3
parent164c3d091292130c82306c97718b2d90534b8897 (diff)
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>
-rw-r--r--net/core/dev.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index af0558b00c6c..060256cbf4f3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2884,11 +2884,7 @@ void netdev_rx_csum_fault(struct net_device *dev)
2884EXPORT_SYMBOL(netdev_rx_csum_fault); 2884EXPORT_SYMBOL(netdev_rx_csum_fault);
2885#endif 2885#endif
2886 2886
2887/* Actually, we should eliminate this check as soon as we know, that: 2887/* XXX: check that highmem exists at all on the given machine. */
2888 * 1. IOMMU is present and allows to map all the memory.
2889 * 2. No high memory really exists on this machine.
2890 */
2891
2892static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) 2888static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
2893{ 2889{
2894#ifdef CONFIG_HIGHMEM 2890#ifdef CONFIG_HIGHMEM
@@ -2902,20 +2898,6 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
2902 return 1; 2898 return 1;
2903 } 2899 }
2904 } 2900 }
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 }
2919#endif 2901#endif
2920 return 0; 2902 return 0;
2921} 2903}