From nobody Wed Jun 08 16:46:59 2022 X-Original-To: threads@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AAE7185F0BA for ; Wed, 8 Jun 2022 16:47:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LJCn00Qdqz4jjV for ; Wed, 8 Jun 2022 16:47:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E35AC132CF for ; Wed, 8 Jun 2022 16:46:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 258Gkxn4035616 for ; Wed, 8 Jun 2022 16:46:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 258GkxeP035615 for threads@FreeBSD.org; Wed, 8 Jun 2022 16:46:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: threads@FreeBSD.org Subject: [Bug 264549] e1000/bridge: "sleep on wchan ... with sleeping prohibited" Date: Wed, 08 Jun 2022 16:46:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 13.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bugaddress@posteo.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654706820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+o/Sx6GyoQzSSGSqZxWIv6UR7oq6NMiV+aX1OPgRbg=; b=I46n6QiUJwIcByxMwHCjJrlRbPWrWGwrR+z7tltzb0y1n6kwouQpPbTknUCZQn/Qh3MXxS V03dcpqBf0a+eL2GLWFv77bKDkc8zEIuzf/8tbO/9MC+j8V9qzkSqXjPnN0p6gLzfa9hZ+ pkh+oMaVxxs/YeucoagLNXcofMh1Pg2WaWgSMw3dOUyOKxOFrn7+xPihw9PplJqdR77Btq sItlHU4MVeYwR4730YI/nECMSqXSmLae1UDJEZZCS6QUxTd5SHi5oUNB+WUobxhVve6GIQ VJl9dCbIfR7m/TJDuKHY9eRsSo5INS1SgVC8BVhq0Zjnf1nMAYUKapLRxtyP5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654706820; a=rsa-sha256; cv=none; b=SEi+FI/ON7yuz8VAws35Rt0OoBS1wBYUkTxuUd3Ln4v7ejKZ7kZjCMMif2OMQcEnbl8Bp9 rmTuHcu0WfYeJmad96ZHAMwQFqLWLpiZGlvl3C73ZQA28+Lh1dE5gsWmSao9ya+CGctTQV +pwSr08QTh/TjpcyUV4fVEY6J8vttOyEEiK6Py4xLpbrmz2b8YFirdNCYJgUp4RqaYb7mw M9z2xO+vPHVTMsxdHA1ojjM/SOlU2soXRI5BBFhzjQm9LFIqZyYtyjKiai9JmKHfvINCCN 7mzbkyBEWrpIHdaH5Lb8q3yOSFn4eCSUKgbTzRcY3Jq9pOlAccCeR4ngxVwaUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264549 Bug ID: 264549 Summary: e1000/bridge: "sleep on wchan ... with sleeping prohibited" Product: Base System Version: 13.1-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: threads Assignee: threads@FreeBSD.org Reporter: bugaddress@posteo.net When employed as members of a bridge such as this one: bridge0: flags=3D8843 metric 0 mtu = 1500 ether 58:9c:fc:10:ff:d4 inet 192.168.219.1 netmask 0xffffff00 broadcast 192.168.219.255 id b1:c1:11:30:35:51 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id b1:c1:11:30:35:51 priority 32768 ifcost 0 port 0 member: igb1 flags=3D147 ifmaxaddr 0 port 2 priority 128 path cost 2000000 proto rstp role disabled state discarding member: igb0 flags=3D147 ifmaxaddr 0 port 1 priority 128 path cost 2000000 proto rstp role disabled state discarding nd6 options=3D9 groups: bridge network adapters igb0/igb1 trigger a "sleep on wchan ... with sleeping prohibited"-KASSERT whenever I pull any LAN cables. The stack backtrace reads: --------------------------------------------------- Unread portion of the kernel message buffer: [148] panic: sleepq_add: td 0xfffffe00380fd740 to sleep on wchan 0xffffffff8164ae00 with sleeping prohibited [148] cpuid =3D 0 [148] time =3D 1654687988 [148] __HardenedBSD_version =3D 1300062 __FreeBSD_version =3D 1301503 [148] version =3D FreeBSD 13.1-STABLE-HBSD #1=20 hardened/13-stable/master-n191189-be9f2a97c09: Wed Jun 8 11:14:09 UTC 2022 [148] (Redacted) [148] KDB: stack backtrace: [148] #0 0xffffffff80c7a3fb at kdb_backtrace+0x6b [148] #1 0xffffffff80c2f964 at vpanic+0x184 [148] #2 0xffffffff80c2f733 at panic+0x43 [148] #3 0xffffffff80c8a4b8 at sleepq_add+0x358 [148] #4 0xffffffff80c3bb44 at _sleep+0x194 [148] #5 0xffffffff80c3c160 at pause_sbt+0x110 [148] #6 0xffffffff82560efc at e1000_write_phy_reg_mdic+0xec [148] #7 0xffffffff825653b9 at e1000_read_phy_reg_gs40g+0x39 [148] #8 0xffffffff825626e0 at e1000_phy_has_link_generic+0x70 [148] #9 0xffffffff82569862 at e1000_check_for_copper_link_generic+0x22 [148] #10 0xffffffff8255884c at em_if_update_admin_status+0x18c [148] #11 0xffffffff80d685df at iflib_media_status+0x6f [148] #12 0xffffffff80d52624 at ifmedia_ioctl+0x174 [148] #13 0xffffffff83431189 at bstp_ifupdstatus+0x79 [148] #14 0xffffffff83431052 at bstp_linkstate+0x22 [148] #15 0xffffffff8342d494 at bridge_linkstate+0x84 [148] #16 0xffffffff80d4372c at do_link_state_change+0xcc [148] #17 0xffffffff80c8f990 at taskqueue_run_locked+0xb0 [148] Uptime: 2m28s [148] Dumping 1534 out of 32592 MB:..2%..11%..21%..31%..41%..51%..61%..71%..81%..91% __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55 55 __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" (offsetof(stru= ct pcpu, (kgdb) #0 __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55 #1 doadump (textdump=3D) at /usr/src/sys/kern/kern_shutdown.c:401 #2 0xffffffff80c2f574 in kern_reboot (howto=3D16644) at /usr/src/sys/kern/kern_shutdown.c:489 #3 0xffffffff80c2f9d3 in vpanic ( fmt=3D0xffffffff812bb4ad "%s: td %p to sleep on wchan %p with sleeping prohibited", ap=3D) at /usr/src/sys/kern/kern_shutdown.c:925 #4 0xffffffff80c2f733 in panic (fmt=3D) at /usr/src/sys/kern/kern_shutdown.c:846 #5 0xffffffff80c8a4b8 in sleepq_add ( wchan=3Dwchan@entry=3D0xffffffff8164ae00 , lock=3Dlock@ent= ry=3D0x0, wmesg=3Dwmesg@entry=3D0xffffffff8258ec2c "e1000_delay", flags=3D2, flags@entry=3D, queue=3Dqueue@entry=3D0) at /usr/src/sys/kern/subr_sleepqueue.c:328 #6 0xffffffff80c3bb44 in _sleep (ident=3D0xffffffff8164ae00 , lock=3Dlock@entry=3D0x0, priority=3D0, wmesg=3D, sbt=3Dsbt@entry=3D4294967, pr=3D0, flags=3D256) at /usr/src/sys/kern/kern_synch.c:208 #7 0xffffffff80c3c160 in pause_sbt (wmesg=3D, sbt=3D4294967, pr=3D, pr@entry=3D0, flags=3Dflags@entry=3D256) at /usr/src/sys/kern/kern_synch.c:340 #8 0xffffffff82560efc in safe_pause_us (x=3D50) at /usr/src/sys/dev/e1000/e1000_osdep.h:88 #9 e1000_write_phy_reg_mdic (hw=3Dhw@entry=3D0xfffffe00dfdd2000, offset=3Doffset@entry=3D22, data=3D) at /usr/src/sys/dev/e1000/e1000_phy.c:384 #10 0xffffffff825653b9 in e1000_read_phy_reg_gs40g (hw=3D0xfffffe00dfdd2000, offset=3D, data=3D0xfffffe00351e6b66) at /usr/src/sys/dev/e1000/e1000_phy.c:4103 #11 0xffffffff825626e0 in e1000_phy_has_link_generic (hw=3D0xfffffe00dfdd20= 00, iterations=3D1, usec_interval=3D0, success=3D0xfffffe00351e6ba7) at /usr/src/sys/dev/e1000/e1000_phy.c:2376 #12 0xffffffff82569862 in e1000_check_for_copper_link_generic ( hw=3D0xfffffe00dfdd2000) at /usr/src/sys/dev/e1000/e1000_mac.c:737 #13 0xffffffff8255884c in em_if_update_admin_status (ctx=3D0xfffff800020bd8= 00) at /usr/src/sys/dev/e1000/if_em.c:1803 #14 0xffffffff80d685df in IFDI_UPDATE_ADMIN_STATUS (_ctx=3D0xfffff800020bd8= 00) at ./ifdi_if.h:492 #15 iflib_media_status (ifp=3D, ifmr=3D0xfffffe00351e6c90) at /usr/src/sys/net/iflib.c:2557 #16 0xffffffff80d52624 in ifmedia_ioctl (ifp=3D, ifr=3D0xfffffe00351e6c90, ifm=3D0xfffff800020bdb18, cmd=3D) at /usr/src/sys/net/if_media.c:294 #17 0xffffffff83431189 in bstp_ifupdstatus (arg=3D0xfffff80023988018, pending=3Dpending@entry=3D0) at /usr/src/sys/net/bridgestp.c:1821 #18 0xffffffff83431052 in bstp_linkstate (bp=3Dbp@entry=3D0xfffff8002398801= 8) at /usr/src/sys/net/bridgestp.c:1802 #19 0xffffffff8342d494 in bridge_linkstate (ifp=3D0xfffff800020d0000) at /usr/src/sys/net/if_bridge.c:3729 #20 0xffffffff80d4372c in do_link_state_change (arg=3D0xfffff800020d0000, pending=3D1) at /usr/src/sys/net/if.c:2317 #21 0xffffffff80c8f990 in taskqueue_run_locked ( queue=3Dqueue@entry=3D0xfffff80001ac8b00) at /usr/src/sys/kern/subr_taskqueue.c:477 #22 0xffffffff80c8f89d in taskqueue_run (queue=3D0xfffff80001ac8b00) at /usr/src/sys/kern/subr_taskqueue.c:492 #23 0xffffffff80bed9ee in intr_event_execute_handlers (ie=3D0xfffff80001ac8= a00, p=3D) at /usr/src/sys/kern/kern_intr.c:1167 #24 ithread_execute_handlers (ie=3D0xfffff80001ac8a00, p=3D) at /usr/src/sys/kern/kern_intr.c:1180 #25 ithread_loop (arg=3D) at /usr/src/sys/kern/kern_intr.c:1= 268 #26 0xffffffff80bea955 in fork_exit ( callout=3D0xffffffff80bed790 , arg=3D0xfffff80001af10e0, frame=3D0xfffffe00351e6f40) at /usr/src/sys/kern/kern_fork.c:1109 #27 #28 mi_startup () at /usr/src/sys/kern/init_main.c:324 Backtrace stopped: Cannot access memory at address 0x2fd9008 (kgdb) --------------------------------------------------- I've solved this issue by replacing "pause" with "DELAY" inside the e1000 driver (see attachment). This certainly works for me, but could point to a deeper problem within anything bridge-related. (I couldn't reproduce this panic outside a bridge.) There's possibly a better solution in which we allow "pause" under some circumstances (unlike my blanket replacement), but I haven't found one. --=20 You are receiving this mail because: You are the assignee for the bug.=