From owner-freebsd-current@FreeBSD.ORG Wed Jun 27 14:23:11 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618651065672; Wed, 27 Jun 2012 14:23:11 +0000 (UTC) (envelope-from imb@protected-networks.net) Received: from sarah.protected-networks.net (sarah.protected-networks.net [64.46.156.146]) by mx1.freebsd.org (Postfix) with ESMTP id 22C378FC1D; Wed, 27 Jun 2012 14:23:11 +0000 (UTC) Received: from toshi.auburn.protected-networks.net (toshi.auburn.protected-networks.net [202.12.127.84]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "Iain Butler", Issuer "RSA Class 2 Personal CA" (not verified)) (Authenticated sender: imb@protected-networks.net) by sarah.protected-networks.net (Postfix) with ESMTPSA id 1018F6130; Wed, 27 Jun 2012 10:23:06 -0400 (EDT) DomainKey-Signature: a=rsa-sha1; s=200509; d=protected-networks.net; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:cc:subject: references:in-reply-to:x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=bYwCk2U2gXkC8zoC8FzNHm7TqXPHp3Mq23SSHPWjgf90+xSuVtbsj8zbjrLJVKkbj 9WzmJONaRLSKfDGqutf+vf7u0sSKrdYHnaUYZ8Vjdb4jvv2oXVr0G4pU94OfZfP Message-ID: <4FEB1743.506@protected-networks.net> Date: Wed, 27 Jun 2012 10:22:59 -0400 From: Michael Butler User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20120619 Thunderbird/13.0.1 MIME-Version: 1.0 To: "Kenneth D. Merry" References: <4FE9D958.4000901@protected-networks.net> <20120627022909.GA153@nargothrond.kdm.org> In-Reply-To: <20120627022909.GA153@nargothrond.kdm.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=0442D492 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Benjamin Kaduk , current@freebsd.org Subject: Re: Removing an SDHC card causes a kernel panic on -current 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: Wed, 27 Jun 2012 14:23:11 -0000 On 06/26/12 22:29, Kenneth D. Merry wrote: > On Tue, Jun 26, 2012 at 19:41:07 -0400, Benjamin Kaduk wrote: >> On Tue, 26 Jun 2012, Michael Butler wrote: >> >>> As follows, in "g_disk_providergone", a NULL pointer reference?: >> >> g_disk_providergone() is new in r237518 (by ken); ken cc'd. > > Can you try the attached patch to sys/geom/geom_disk.c? This fixes the panic :-) > > Also, do you have full dmesg information for when the panic happened? > > It looks like disk_destroy() has already been called in this case, and I > suppose that's likely to happen for any of the users of the GEOM disk class > that haven't been updated with the reference count changes I made in da(4). > (i.e. all of the rest of them.) > > Let me know whether this works for you. All I have is the following leading up to my removal of the card (and the restart afterwards): Jun 26 08:57:11 toshi kernel: sdhci0-slot0: Card inserted Jun 26 08:57:11 toshi kernel: mmc0: on sdhci0 Jun 26 08:57:11 toshi kernel: mmc0: Probing bus Jun 26 08:57:11 toshi kernel: mmc0: SD probe: OK (OCR: 0x00ff8000) Jun 26 08:57:11 toshi kernel: mmc0: Current OCR: 0x00ff8000 Jun 26 08:57:11 toshi kernel: mmc0: Probing cards Jun 26 08:57:11 toshi kernel: mmc0: New card detected (CID 03534453553136478080d4290400a300) Jun 26 08:57:11 toshi kernel: mmc0: New card detected (CSD 400e00325b59000076b27f800a404000) Jun 26 08:57:11 toshi kernel: mmc0: Card at relative address 36832 added: Jun 26 08:57:11 toshi kernel: mmc0: card: SDHC SU16G 8.0 SN -2133579516 MFG 03/2010 by 3 SD Jun 26 08:57:11 toshi kernel: mmc0: bus: 4bit, 50MHz, high speed timing Jun 26 08:57:11 toshi kernel: mmc0: memory: 31116288 blocks, erase sector 8192 blocks Jun 26 08:57:12 toshi kernel: mmc0: setting transfer rate to 25.000MHz Jun 26 08:57:12 toshi kernel: mmcsd0: 14GB at mmc0 24.0MHz/4bit/65535-block Jun 26 08:57:12 toshi kernel: GEOM: new disk mmcsd0 Jun 26 08:57:12 toshi kernel: mmc0: setting bus width to 4 bits Jun 26 08:58:44 toshi syslogd: kernel boot file is /boot/kernel/kernel Jun 26 08:58:44 toshi kernel: Copyright (c) 1992-2012 The FreeBSD Project. Jun 26 08:58:44 toshi kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 Jun 26 08:58:44 toshi kernel: The Regents of the University of California. All rights reserved. Jun 26 08:58:44 toshi kernel: FreeBSD is a registered trademark of The FreeBSD Foundation.