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: 10360727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A34AD601BE for ; Tue, 24 Apr 2018 18:17:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9491628710 for ; Tue, 24 Apr 2018 18:17:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88D6F28AC8; Tue, 24 Apr 2018 18:17:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29FB028710 for ; Tue, 24 Apr 2018 18:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752789AbeDXSQy (ORCPT ); Tue, 24 Apr 2018 14:16:54 -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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }