From patchwork Mon Apr 16 08:50:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10342363 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 BAC4160365 for ; Mon, 16 Apr 2018 08:51:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAE9828389 for ; Mon, 16 Apr 2018 08:51:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FBE328505; Mon, 16 Apr 2018 08:51:57 +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=unavailable 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 35CB628389 for ; Mon, 16 Apr 2018 08:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754477AbeDPIvm (ORCPT ); Mon, 16 Apr 2018 04:51:42 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44880 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754111AbeDPIvj (ORCPT ); Mon, 16 Apr 2018 04:51:39 -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=1qApOWwf+CReUx3578YhHPu76Na+veeSyEfz/EXwiDM=; b=u5EMZywUozs0CtRy3CCL63rfu L/xS15798vUqwZYpbSRwouji5HntVtUcvp6Kejapc+yk1keKj8FRAlhbUeJBSTjELPdk7nEM6fWuZ /roAKpJ3ntLEDJCecRKrPljNsG5zKJqoScaQXt0ltm3k1V8RMR8pV3uumYsa5UMGALTfo+krKGvqL nMQk+4W+hSSCNVY3lBs2N/k55tsnV927FWcF9c23aiM4On0CAvei8/QoD33UfQHqoc+RBUb4MnAPz FrV23tnClKr7rwbP9TLx6G9t+698nRN+WAKFs593j5l6ycgFP4j5PrtVQV62KinPsD0uSqROyjPMC O/VCP5cig==; Received: from 089144200254.atnat0009.highway.a1.net ([89.144.200.254] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7zrL-0007Cs-72; Mon, 16 Apr 2018 08:51:38 +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: linux-kernel@vger.kernel.org Subject: [PATCH 11/12] net: remove the PCI_DMA_BUS_IS_PHYS check in illegal_highdma Date: Mon, 16 Apr 2018 10:50:31 +0200 Message-Id: <20180416085032.7367-12-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180416085032.7367-1-hch@lst.de> References: <20180416085032.7367-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 969462ebb296..5802cf177b07 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; }