From patchwork Thu Oct 30 00:56:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 5192701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9C0129F349 for ; Thu, 30 Oct 2014 00:58:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E895A2025B for ; Thu, 30 Oct 2014 00:58:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 384BE20254 for ; Thu, 30 Oct 2014 00:58:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xje29-0007gE-Jr; Thu, 30 Oct 2014 00:56:13 +0000 Received: from exprod5og106.obsmtp.com ([64.18.0.182]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xje1t-0007Za-8n for linux-arm-kernel@lists.infradead.org; Thu, 30 Oct 2014 00:55:58 +0000 Received: from mail-pa0-f51.google.com ([209.85.220.51]) (using TLSv1) by exprod5ob106.postini.com ([64.18.4.12]) with SMTP ID DSNKVFGMiNHPXAuKqhppfBYhLvtMY1Q8RZGR@postini.com; Wed, 29 Oct 2014 17:55:57 PDT Received: by mail-pa0-f51.google.com with SMTP id kq14so4260746pab.24 for ; Wed, 29 Oct 2014 17:55:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pv+KTaoSGIhpcCACOfo/TPDTGFsH3X14WHr1BQkgo64=; b=RUgRufC1Kjw3mlHgtdtk8SbpSb1qmIxGVHGmPUjYEoVGTRgjpj1iw2IHK6MewaBl4V n2IENjkCm8XjhYpgyzMsg/RCZT5UjUCxXdSqSHahOIUicO7A3BelJBU/mJ3JkdzTVM4u 2313nGl7zxwLnDupLLqbWtVV5jnD+OhCmh5K9G9Mwg+f/Wv/92VTrIw/n2S5CoJFtFWQ iyu+HJ9iQUH6FpMxcS2SdenRI3U/FN+3lHO9kEbJB9rsAnEYgVAHFyf0g2UsGH6hrDd+ N3WrWJaaTua8KYozs2EINDaqVryTrtIgeHdoSvxxPkCUk7eQfhP5fuRh/uG7IrMsce0f tFrg== X-Gm-Message-State: ALoCoQmxNjY1CvzC6g3NJTFzjZIBvZl6yC1cQ2JlhSD+/w+PAwmqsoKsndZVJ9cmCLmABJweY51XthLUTWW3syXnfnAojKg9XUhqsNUmfThFieSxSY9zhkhWFKUstEfLmE4OX6Fa4N6+WArEMms0LwbZJjWB60fZnSIXAuKOLyJA2kacOGqH5Uk= X-Received: by 10.70.10.229 with SMTP id l5mr13935674pdb.94.1414630535999; Wed, 29 Oct 2014 17:55:35 -0700 (PDT) X-Received: by 10.70.10.229 with SMTP id l5mr13935663pdb.94.1414630535899; Wed, 29 Oct 2014 17:55:35 -0700 (PDT) Received: from svdclab-13-11.amcc.com (67-207-112-226.static.wiline.com. [67.207.112.226]) by mx.google.com with ESMTPSA id jq5sm5398462pbc.32.2014.10.29.17.55.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Oct 2014 17:55:34 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v1 2/2] drivers: net: xgene: fix: Use separate resources Date: Wed, 29 Oct 2014 17:56:20 -0700 Message-Id: <1414630580-24640-3-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414630580-24640-1-git-send-email-isubramanian@apm.com> References: <1414630580-24640-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141029_175557_369333_C09FD719 X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: -2.3 (--) Cc: kchudgar@apm.com, patches@apm.com, linux-arm-kernel@lists.infradead.org, Iyappan Subramanian X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the following kernel crash during SGMII based 1GbE probe. BUG: Bad page state in process swapper/0 pfn:40fe6ad page:ffffffbee37a75d8 count:-1 mapcount:0 mapping: (null) index:0x0 flags: 0x0() page dumped because: nonzero _count Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.17.0+ #7 Call trace: [] dump_backtrace+0x0/0x12c [] show_stack+0x10/0x1c [] dump_stack+0x74/0xc4 [] bad_page+0xd8/0x128 [] get_page_from_freelist+0x4b8/0x640 [] __alloc_pages_nodemask+0xd8/0x834 [] __netdev_alloc_frag+0x124/0x1b8 [] __netdev_alloc_skb+0x90/0x10c [] xgene_enet_refill_bufpool+0x11c/0x280 [] xgene_enet_process_ring+0x168/0x340 [] xgene_enet_napi+0x1c/0x50 [] net_rx_action+0xc8/0x18c [] __do_softirq+0x114/0x24c [] irq_exit+0x94/0xc8 [] __handle_domain_irq+0x8c/0xf4 [] gic_handle_irq+0x30/0x7c This was due to hardware resource sharing conflict with the firmware. This patch fixes this crash by using resources (descriptor ring, prefetch buffer) that are not shared. Signed-off-by: Iyappan Subramanian Signed-off-by: Keyur Chudgar --- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 6 +++--- drivers/net/ethernet/apm/xgene/xgene_enet_main.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 3c208cc..ac37e26 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -639,9 +639,9 @@ static int xgene_enet_create_desc_rings(struct net_device *ndev) struct device *dev = ndev_to_dev(ndev); struct xgene_enet_desc_ring *rx_ring, *tx_ring, *cp_ring; struct xgene_enet_desc_ring *buf_pool = NULL; - u8 cpu_bufnum = 0, eth_bufnum = 0; - u8 bp_bufnum = 0x20; - u16 ring_id, ring_num = 0; + u8 cpu_bufnum = 0, eth_bufnum = START_ETH_BUFNUM; + u8 bp_bufnum = START_BP_BUFNUM; + u16 ring_id, ring_num = START_RING_NUM; int ret; /* allocate rx descriptor ring */ diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h index 874e5a0..7d8b6ea 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h @@ -38,6 +38,9 @@ #define SKB_BUFFER_SIZE (XGENE_ENET_MAX_MTU - NET_IP_ALIGN) #define NUM_PKT_BUF 64 #define NUM_BUFPOOL 32 +#define START_ETH_BUFNUM 2 +#define START_BP_BUFNUM 0x22 +#define START_RING_NUM 8 #define PHY_POLL_LINK_ON (10 * HZ) #define PHY_POLL_LINK_OFF (PHY_POLL_LINK_ON / 5)