From patchwork Fri Jan 8 10:25:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 7984061 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 88A809F54F for ; Fri, 8 Jan 2016 10:31:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8280D20122 for ; Fri, 8 Jan 2016 10:31:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F11720120 for ; Fri, 8 Jan 2016 10:31:29 +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 1aHUIl-0000vb-Bb; Fri, 08 Jan 2016 10:29:47 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHUIh-0000tY-Ei for linux-arm-kernel@lists.infradead.org; Fri, 08 Jan 2016 10:29:44 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id u08AOkK5022950; Fri, 8 Jan 2016 02:29:20 -0800 Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 209r2v386b-1 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 08 Jan 2016 02:29:20 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Fri, 8 Jan 2016 02:29:18 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server id 15.0.1104.5 via Frontend Transport; Fri, 8 Jan 2016 02:29:18 -0800 Received: from xhacker (unknown [10.37.135.134]) by maili.marvell.com (Postfix) with ESMTP id 0F0A23F703F; Fri, 8 Jan 2016 02:29:17 -0800 (PST) Date: Fri, 8 Jan 2016 18:25:37 +0800 From: Jisheng Zhang To: Stefan Roese Subject: Re: Armada XP (MV78460): BUG in netdevice.h with maxcpus=2 Message-ID: <20160108182537.0a68630c@xhacker> In-Reply-To: <568F6A47.6010905@gmail.com> References: <568F6A47.6010905@gmail.com> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-01-08_03:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310008 definitions=main-1601080180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160108_022943_744707_A9D184CE X-CRM114-Status: GOOD ( 20.82 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Hi Stefan, On Fri, 8 Jan 2016 08:50:31 +0100 Stefan Roese wrote: > Hi Thomas, > > I'm currently trying to boot latest Linux on the DB-MV784MP-GP > Marvell board. This works just fine for the normal > configuration. But when I try to boot with only 2 CPUs enabled > (maxcpus=2), mounting the rootfs via NFS crashes with this > log: > > [ 16.408285] ------------[ cut here ]------------ > [ 16.412915] kernel BUG at include/linux/netdevice.h:507! > [ 16.418239] Internal error: Oops - BUG: 0 [#1] SMP ARM > [ 16.423390] Modules linked in: > [ 16.426464] CPU: 0 PID: 1424 Comm: systemd-udevd Not tainted 4.4.0-rc8-00045-gcbf389a #37 > [ 16.434660] Hardware name: Marvell Armada 370/XP (Device Tree) > [ 16.440507] task: ee9d3100 ti: ee164000 task.ti: ee164000 > [ 16.445927] PC is at mvneta_percpu_notifier+0x358/0x35c > [ 16.451167] LR is at mvneta_percpu_notifier+0x27c/0x35c > [ 16.456405] pc : [] lr : [] psr: 60010013 > [ 16.456405] sp : ee165e18 ip : 00000003 fp : c077c494 > [ 16.467914] r10: c077cd58 r9 : 00000002 r8 : c077ce08 > [ 16.473154] r7 : eea8a520 r6 : ff7ea400 r5 : 00000004 r4 : 00000000 > [ 16.479697] r3 : 00000000 r2 : 00000008 r1 : 00000004 r0 : 00000004 > [ 16.486243] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none > [ 16.493402] Control: 10c5387d Table: 2e16806a DAC: 00000051 > [ 16.499168] Process systemd-udevd (pid: 1424, stack limit = 0xee164220) > [ 16.505801] Stack: (0xee165e18 to 0xee166000) > [ 16.510170] 5e00: c07b89c0 eea8a500 > [ 16.518373] 5e20: 00000002 ffffffdb 00000002 00000002 00000000 c0782aa0 00000000 ee82a5c0 > [ 16.526575] 5e40: 00000000 c003fb44 00000000 00000000 c077c494 00000000 00000001 c0024f68 > [ 16.534774] 5e60: 00000000 00000000 00000002 c0025574 ee165e7c 00000022 00000000 00000028 > [ 16.542977] 5e80: 00000002 eefca010 eefca044 ee165f88 edc61240 b6f07000 00000000 c00255fc > [ 16.551178] 5ea0: c02907fc c028c520 eefca010 00000001 00000001 c028c5ac 00000000 01eada00 > [ 16.559381] 5ec0: 00000001 edeada00 edc6124c c01324f0 00000000 00000000 00000800 ee9c6f40 > [ 16.567582] 5ee0: c0132438 b6f07000 ee165f88 c000f7c4 ee164000 00000000 00039388 c00d6bd0 > [ 16.575782] 5f00: 00000001 00000000 0002b2cc c00092f4 00001000 00001000 b6f07000 00000003 > [ 16.583981] 5f20: 00000000 edc22580 00000001 c077ce2c 00000073 c00c3994 000b6f07 00000000 > [ 16.592180] 5f40: beef1270 ffffffff 48400000 ee9c6f40 00000001 b6f07000 ee165f88 c000f7c4 > [ 16.600385] 5f60: ee164000 c00d7414 0002b2cc c00b3a88 ee9c6f40 ee9c6f40 b6f07000 00000001 > [ 16.608588] 5f80: c000f7c4 c00d7c38 00000000 00000000 48400000 00000001 b6f07000 00046c70 > [ 16.616797] 5fa0: 00000004 c000f600 00000001 b6f07000 00000005 b6f07000 00000001 00000000 > [ 16.625003] 5fc0: 00000001 b6f07000 00046c70 00000004 00000001 00000000 00039860 00039388 > [ 16.633208] 5fe0: 00000000 beef181c b6d6bf81 b6da5066 400d0030 00000005 00180011 000022be > [ 16.641431] [] (mvneta_percpu_notifier) from [] (notifier_call_chain+0x44/0x84) > [ 16.650513] [] (notifier_call_chain) from [] (cpu_notify+0x24/0x40) > [ 16.658544] [] (cpu_notify) from [] (_cpu_up+0x14c/0x164) > [ 16.665700] [] (_cpu_up) from [] (cpu_up+0x70/0x94) > [ 16.672333] [] (cpu_up) from [] (device_online+0x64/0x88) > [ 16.679490] [] (device_online) from [] (online_store+0x68/0x74) > [ 16.687174] [] (online_store) from [] (kernfs_fop_write+0xb8/0x1b4) > [ 16.695206] [] (kernfs_fop_write) from [] (__vfs_write+0x1c/0xd8) > [ 16.703061] [] (__vfs_write) from [] (vfs_write+0x90/0x16c) > [ 16.710391] [] (vfs_write) from [] (SyS_write+0x44/0x9c) > [ 16.717464] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x3c) > [ 16.725057] Code: 3afffff5 e3a00001 e28dd00c e8bd8ff0 (e7f001f2) > [ 16.731167] ---[ end trace 1451bd9f24838b0f ]--- > > > Again, this only happen, if I boot the system with 2 CPUs online. > Without this kernel commandline arg (and all 4 CPUs online), > mounting the NFS rootfs works just fine. > > Is this a known problem? Do you have any quick hints how to fix > this issue? can you please try the following patch? Thanks diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index ed622fa..e1242f4 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2446,7 +2446,7 @@ static void mvneta_start_dev(struct mvneta_port *pp) mvneta_port_enable(pp); /* Enable polling on the port */ - for_each_present_cpu(cpu) { + for_each_online_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); napi_enable(&port->napi); @@ -2472,7 +2472,7 @@ static void mvneta_stop_dev(struct mvneta_port *pp) phy_stop(pp->phy_dev); - for_each_present_cpu(cpu) { + for_each_online_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); napi_disable(&port->napi); @@ -2907,7 +2907,7 @@ static int mvneta_stop(struct net_device *dev) mvneta_stop_dev(pp); mvneta_mdio_remove(pp); unregister_cpu_notifier(&pp->cpu_notifier); - for_each_present_cpu(cpu) + for_each_online_cpu(cpu) smp_call_function_single(cpu, mvneta_percpu_disable, pp, true); free_percpu_irq(dev->irq, pp->ports); mvneta_cleanup_rxqs(pp);