From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 23:12:50 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1B03816A41F for ; Sun, 21 Aug 2005 23:12:50 +0000 (GMT) (envelope-from thib@mi.is) Received: from quasar.skima.is (quasar.skima.is [212.30.200.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 901CB43D45 for ; Sun, 21 Aug 2005 23:12:49 +0000 (GMT) (envelope-from thib@mi.is) Received: from caulfield ([85.220.68.246] [85.220.68.246]) by quasar.skima.is; Sun, 21 Aug 2005 23:12:47 Z Date: Sun, 21 Aug 2005 23:12:47 +0000 From: "Thordur I. Bjornsson" To: hackers@freebsd.org Message-Id: <20050821231247.567b9c2f.thib@mi.is> Organization: n/a X-Mailer: Sylpheed version 1.0.5 (GTK+ 1.2.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Sun__21_Aug_2005_23_12_47_+0000_zdzsde=exJt6uwzc" Cc: Subject: xl driver proplem. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2005 23:12:50 -0000 This is a multi-part message in MIME format. --Multipart=_Sun__21_Aug_2005_23_12_47_+0000_zdzsde=exJt6uwzc Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello list. I had this proplem with the xl driver: Aug 21 22:45:38 caulfield kernel: taskqueue_drain with the following non-sleepable locks held: Aug 21 22:45:38 caulfield kernel: exclusive sleep mutex xl0 (network driver) r = 0 (0xc23c00a4) locked @ /usr/src/sys/pci/if_xl.c:2796 Aug 21 22:45:38 caulfield kernel: KDB: stack backtrace: Aug 21 22:45:38 caulfield kernel: witness_warn(2,0,c071f440,c23aa600,ed0baa80) at witness_warn+0x5d6 Aug 21 22:45:38 caulfield kernel: taskqueue_drain(c2287800,c23c00c8,c072a962,cc7,c23ac400) at taskqueue_drain+0x2e Aug 21 22:45:38 caulfield kernel: xl_stop(c23c00a4,1,c072a962,af9,c07c50d0) at xl_stop+0x56 Aug 21 22:45:38 caulfield kernel: xl_init_locked(c23c00a4,8,c072a962,aec,c23ac400) at xl_init_locked+0x47 Aug 21 22:45:38 caulfield kernel: xl_init(c23be000,740,c072eec1,8020690c,c23be000) at xl_init+0x3c Aug 21 22:45:38 caulfield kernel: ether_ioctl(c23ac400,8020690c,c2577e00,c055b96a,c0779dc0) at ether_ioctl+0xa4 Aug 21 22:45:38 caulfield kernel: xl_ioctl(c23ac400,8020690c,c2577e00,504,c2577e7c) at xl_ioctl+0xc8 Aug 21 22:45:38 caulfield kernel: in_ifinit(c2560350,0,0,0,ed0bab98) at in_ifinit+0xa6 Aug 21 22:45:38 caulfield kernel: in_control(c25e2de8,8040691a,c2560340,c23ac400,c23aa600) at in_control+0xe84 Aug 21 22:45:38 caulfield kernel: ifioctl(c25e2de8,8040691a,c2560340,c23aa600,2) at ifioctl+0x12d Aug 21 22:45:38 caulfield kernel: soo_ioctl(c2570438,8040691a,c2560340,c2286d00,c23aa600) at soo_ioctl+0x2c9 Aug 21 22:45:38 caulfield kernel: ioctl(c23aa600,ed0bad04,c,422,3) at ioctl+0x118 Aug 21 22:45:38 caulfield kernel: syscall(3b,3b,3b,8058900,0) at syscall+0x13b Aug 21 22:45:38 caulfield kernel: Xint0x80_syscall() at Xint0x80_syscall+0x1f Aug 21 22:45:38 caulfield kernel: --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x280d9593, esp = 0xbfbfe5fc, ebp = 0xbfbfee68 --- According to http://lists.freebsd.org/pipermail/freebsd-current/2005-May/050526.html taskqueue_drain() can not be called while holding a lock. I made a simple change to pull taskqueue_drain() out of xl_stop() and call it before the lock is taken in xl_init() This made the "proplem go away (TM)" and I have not noticed any proplems e.g. performance,uptime (on the NIC) &c. Still, when I reboot/shutdown the machine I see some funkyness but it scrolls by too fast, I'm currently on my why to the garage to make myself a null-modem cable and to some debugging ;) Attached is the diff. -- Thordur I. Humppa! --Multipart=_Sun__21_Aug_2005_23_12_47_+0000_zdzsde=exJt6uwzc Content-Type: text/plain; name="if_xl.diff" Content-Disposition: attachment; filename="if_xl.diff" Content-Transfer-Encoding: 7bit *** if_xl.c.ORIG Sun Aug 21 21:56:20 2005 --- if_xl.c Sun Aug 21 23:05:33 2005 *************** *** 2792,2798 **** xl_init(void *xsc) { struct xl_softc *sc = xsc; ! XL_LOCK(sc); xl_init_locked(sc); XL_UNLOCK(sc); --- 2792,2804 ---- xl_init(void *xsc) { struct xl_softc *sc = xsc; ! ! /* XXX ! * taskqueue_drain() can not be called while holding a lock. ! * Appers to be working fine. Is this the right thing todo (TM) ? ! */ ! taskqueue_drain(taskqueue_swi, &sc->xl_task); ! XL_LOCK(sc); xl_init_locked(sc); XL_UNLOCK(sc); *************** *** 3274,3281 **** #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif /* DEVICE_POLLING */ - - taskqueue_drain(taskqueue_swi, &sc->xl_task); CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_DISABLE); CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_STATS_DISABLE); --- 3280,3285 ---- --Multipart=_Sun__21_Aug_2005_23_12_47_+0000_zdzsde=exJt6uwzc--