From owner-freebsd-current@FreeBSD.ORG Thu Nov 22 12:09:06 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6887116A419 for ; Thu, 22 Nov 2007 12:09:06 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id 725EF13C45A for ; Thu, 22 Nov 2007 12:09:05 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so2498739nfb for ; Thu, 22 Nov 2007 04:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=M1ELUfBX4GEWFVxSyDfEfHqfbNv9+rQbo5rBCbmk8k8=; b=iwZpXvtAXhUoXeGr6cIbFQEQt0cTbW1RKol4y5WQHpBX0EUToGJemuA9PmGFKo9F98AEEMrRVAlRhm2AjWAnxIoeOEvxpwqDwy/k3cubCgODWDw5zvFt3B6Mnf6XucKCT6oxpKkaO6yiZOOEHAjbQZeSmz+fGfxTUP6xs4HV2ps= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Be9UN3eg5PoXcW04UzIXbxjq818yHZkgbnhXuQR5CLZdku8a5B0BneM4ztKZRMvKDRYIMZeayA8LEnTrC+JPJgMSfP4I81KflggcuU36tPCkUzVdCTk0U32541dMxZ0MYMxat1Qcx/WDQL+LvVXJK0bmNd8KBBEQqSd6qmLnpRw= Received: by 10.86.87.5 with SMTP id k5mr8382567fgb.1195733334067; Thu, 22 Nov 2007 04:08:54 -0800 (PST) Received: by 10.86.28.19 with HTTP; Thu, 22 Nov 2007 04:08:54 -0800 (PST) Message-ID: <3bbf2fe10711220408t30136430s15fdba0ebcbbfa66@mail.gmail.com> Date: Thu, 22 Nov 2007 13:08:54 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Benjamin Close" In-Reply-To: <4744EBA4.7020209@clearchain.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4744EBA4.7020209@clearchain.com> X-Google-Sender-Auth: c8a60a57b080ab71 Cc: freebsd-current@freebsd.org Subject: Re: em0 panic: mutex em0 not owned X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2007 12:09:06 -0000 2007/11/22, Benjamin Close : > Hi Folks, > With a recent current I'm now getting panics when em0 tries to come up: > > panic: mutex em0 not owned at ../../../kern/kern_mutex.c:144 > > _mtx_assert() + 0xdc > _callout_stop_safe()+0x5d > em_stop() + 0x50 (if_em.c:2546) > em_init_locked()+0x47 (if_em.c:1256) > em_ioctl()+0x466 > ifhwioctl() + 0x75f > ifioctl() +0xb0 > kern_ioctl() + 0xa3 > > This is even after atillos, latest patch. Yes, this is a race access to callout_stop() in em driver. callout_stop() needs to be called with callout-specific lock held otherwise you can get a race and this seems not happening. I just inserted this assertions in order to catch bugs like these. I have no time to double-check it, can you do? Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein