From patchwork Tue Apr 24 18:16:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 903768 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="b7zxE+Sn"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40Vs3p50qWz9s06 for ; Wed, 25 Apr 2018 04:16:54 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782AbeDXSQv (ORCPT ); Tue, 24 Apr 2018 14:16:51 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54662 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbeDXSQq (ORCPT ); Tue, 24 Apr 2018 14:16:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KlxMKw+Rzf7FezAgjFaRUO8wZ40tsu7MAPlRGxE9Duw=; b=b7zxE+SnZTs4q1UZYLTIS56uX ahv8cF07ZNRNCmA8JjNQVBDgToiJ+JhtNY514CizFwIT7CWXWUaFeLBPxu7CU3GtLiOS9I4EaghkU Wb/Rgw3NeQVsL57GkZpqrcbzQ+C57ZPNpxWlCqa4b+ImkXAmO4joTcQZT5Vaql3cD+aPk7gZ5HOGh VOZhkrM8Gm9vNedxGL8YsXlwsEI4POtX/MrFFcINsEPxl9LTJoXx0Q3lbqCipR92dDjrsA8V2yHlS mtcZzvNHIrLjcqCO0VchC4C7OrnFjd+fOYtAsw09Fk9xPcG0G5WTM5mNc2y5hs/B9oXeSGhP/QtJI c5Tj3kMBg==; Received: from 213-225-11-78.nat.highway.a1.net ([213.225.11.78] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fB2Uc-0007uv-ME; Tue, 24 Apr 2018 18:16:43 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org, linux-arch@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] net: remove the PCI_DMA_BUS_IS_PHYS check in illegal_highdma Date: Tue, 24 Apr 2018 20:16:24 +0200 Message-Id: <20180424181625.22410-5-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180424181625.22410-1-hch@lst.de> References: <20180424181625.22410-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 --- net/core/dev.c | 20 +------------------- 1 file changed, 1 insertion(+), 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) EXPORT_SYMBOL(netdev_rx_csum_fault); #endif -/* Actually, we should eliminate this check as soon as we know, that: - * 1. IOMMU is present and allows to map all the memory. - * 2. No high memory really exists on this machine. - */ - +/* XXX: check that highmem exists at all on the given machine. */ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) { #ifdef CONFIG_HIGHMEM @@ -2902,20 +2898,6 @@ static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) return 1; } } - - if (PCI_DMA_BUS_IS_PHYS) { - struct device *pdev = dev->dev.parent; - - if (!pdev) - return 0; - for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { - skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; - dma_addr_t addr = page_to_phys(skb_frag_page(frag)); - - if (!pdev->dma_mask || addr + PAGE_SIZE - 1 > *pdev->dma_mask) - return 1; - } - } #endif return 0; }