From patchwork Thu Dec 11 19:49:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 420241 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4CADB1400DD for ; Fri, 12 Dec 2014 06:49:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758905AbaLKTta (ORCPT ); Thu, 11 Dec 2014 14:49:30 -0500 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:52308 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758899AbaLKTt2 (ORCPT ); Thu, 11 Dec 2014 14:49:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Sender:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date; bh=5dFcNe/3/y3r5t2f+0yGAl8bLxvqBPywI+Ye9bHPNVE=; b=eVmXyO0C1k+JMlZj52cDD7md//kn6OKxXXW/j3eJMFph1CpsIwenf4bWhEn173HNzNEcdeZiKfl21hJfvPicMvoF+204Yq0rmiciyHkAmna+txmIYxWV+pcsK2ow+qnnj0+bFzGSEOs2I3aTmYwLrS0fhEzDMbQmdluKylLjmyE=; Received: from n2100.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:4f86]:52813) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Xz9jo-0002W2-AY; Thu, 11 Dec 2014 19:49:24 +0000 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1Xz9jl-0006ip-Ch; Thu, 11 Dec 2014 19:49:21 +0000 Date: Thu, 11 Dec 2014 19:49:20 +0000 From: Russell King - ARM Linux To: Ezequiel Garcia , "David S. Miller" Cc: netdev@vger.kernel.org Subject: Bug: mv643xxx fails with highmem Message-ID: <20141211194920.GR11285@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 69ad0dd7af22 removed skb_frag_dma_map() in favour of mapping all fragments with dma_map_single(). This fails when the driver is used in an environment with highmem. With this patch in place in 3.18: I regularly hit the first BUG_ON(). Without the BUG_ON(), the machine either freezes or oopses in the DMA API functions due to them being passed an invalid struct page *. So, I'm unclear whether this is a driver bug, or whether it's a core netdev bug: should netdev be passing skbuffs with highmem pages attached when the driver has NETIF_F_HIGHDMA clear, or is Ezequiel's patch removing the ability to map highmem pages from this driver incorrect? Here's the ethtool -k eth0 output for this driver: Features for eth0: rx-checksumming: on tx-checksumming: on tx-checksum-ipv4: on tx-checksum-ip-generic: off [fixed] tx-checksum-ipv6: off [fixed] tx-checksum-fcoe-crc: off [fixed] tx-checksum-sctp: off [fixed] scatter-gather: on tx-scatter-gather: on tx-scatter-gather-fraglist: off [fixed] tcp-segmentation-offload: on tx-tcp-segmentation: on tx-tcp-ecn-segmentation: off [fixed] tx-tcp6-segmentation: off [fixed] udp-fragmentation-offload: off [fixed] generic-segmentation-offload: on generic-receive-offload: on large-receive-offload: off [fixed] rx-vlan-offload: off [fixed] tx-vlan-offload: off [fixed] ntuple-filters: off [fixed] receive-hashing: off [fixed] highdma: off [fixed] rx-vlan-filter: off [fixed] vlan-challenged: off [fixed] tx-lockless: off [fixed] netns-local: off [fixed] tx-gso-robust: off [fixed] tx-fcoe-segmentation: off [fixed] tx-gre-segmentation: off [fixed] tx-ipip-segmentation: off [fixed] tx-sit-segmentation: off [fixed] tx-udp_tnl-segmentation: off [fixed] tx-mpls-segmentation: off [fixed] fcoe-mtu: off [fixed] tx-nocache-copy: off loopback: off [fixed] rx-fcs: off [fixed] rx-all: off [fixed] tx-vlan-stag-hw-insert: off [fixed] rx-vlan-stag-hw-parse: off [fixed] rx-vlan-stag-filter: off [fixed] l2-fwd-offload: off [fixed] busy-poll: off [fixed] Thanks. diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index d44560d1d268..14d1fc9ff485 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -882,7 +882,9 @@ static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) void *addr; this_frag = &skb_shinfo(skb)->frags[frag]; + BUG_ON(PageHighMem(this_frag->page.p)); addr = page_address(this_frag->page.p) + this_frag->page_offset; + BUG_ON(!addr); tx_index = txq->tx_curr_desc++; if (txq->tx_curr_desc == txq->tx_ring_size) txq->tx_curr_desc = 0;