From owner-freebsd-stable@FreeBSD.ORG Thu Apr 2 13:36:30 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0CB106564A for ; Thu, 2 Apr 2009 13:36:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id BE1DF8FC12 for ; Thu, 2 Apr 2009 13:36:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 239184842; Thu, 02 Apr 2009 16:36:28 +0300 Message-ID: <49D4BF5C.4010509@FreeBSD.org> Date: Thu, 02 Apr 2009 16:36:28 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Dmitry Morozovsky References: <49D29097.9040701@FreeBSD.org> <49D3BD14.9070505@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org Subject: Re: RELENG_7 ata panic on atacontrol attach X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 13:36:30 -0000 Dmitry Morozovsky wrote: > On Thu, 2 Apr 2009, Dmitry Morozovsky wrote: > > DM> AM> > AM> > AM> > atapci3: port > DM> AM> > AM> > > DM> AM> > 0xbc00-0xbc07,0xb880-0xb883,0xb800-0xb807,0xb480-0xb483,0xb400-0xb40f mem > DM> AM> > AM> > 0xefcb3000-0xefcb3fff irq 23 at device 5.2 on pci0 > DM> AM> > AM> > AM> > AM> > atacontrol detach ata7 > DM> AM> > AM> > - insert ATA disk (ad14) > DM> AM> > AM> > atacontrol attach ata7 > DM> AM> > AM> > AM> > pinics with Fatal trap 12: page fault while in kernel mode > DM> AM> > AM> AM> Any kernel verbose messages before it? > > got it: > > ata7: SATA connect time=0ms^M > ata7: reset tp1 mask=01 ostat0=50 ostat1=00^M > ata7: stat0=0x50 err=0x01 lsb=0x00 msb=0x00^M > ata7: reset tp2 stat0=50 stat1=00 devices=0x1^M > ata7: [MPSAFE]^M > ata7: [ITHREAD]^M > ata7-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire^M > ad14: 715404MB at ata7-master SATA300^M > ad14: 1465149168 sectors [1453521C/16H/63S] 16 sectors/interrupt 1 depth > queue^M > GEOM: new disk ad14^M > GEOM_LABEL: Label for provider ad14a is ufs/moose09.^M > GEOM_LABEL: Label ufs/moose09 removed.^M > [-- MARK -- Thu Apr 2 17:00:00 2009] > GEOM_LABEL: Label for provider ad14a is ufs/moose09.^M > GEOM_LABEL: Label ufs/moose09 removed.^M > ata7: SATA connect time=0ms^M > ata7: reset tp1 mask=01 ostat0=50 ostat1=00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x01 lsb=0x00 msb=0x00^M > ata7: stat0=0x50 err=0x01 lsb=0x00 msb=0x00^M > ata7: reset tp2 stat0=50 stat1=00 devices=0x1^M > ata7: ata7: [MPSAFE]^M > CONNECT requested^M > ata7: [ITHREAD]^M > ata7: CONNECTED^M > ata7: SATA connect time=0ms^M > ata7: reset tp1 mask=01 ostat0=50 ostat1=00^M > ata7: DISCONNECT requested^M > ata7: CONNECT requested^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: DISCONNECT requested^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: CONNECT requested^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: DISCONNECT requested^M > ata7: CONNECT requested^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: DISCONNECT requested^M > ata7: CONNECT requested^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: DISCONNECT requested^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: CONNECT requested^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: stat0=0x80 err=0x00 lsb=0x00 msb=0x00^M > ata7: stat0=0x50 err=0x01 lsb=0x00 msb=0x00^M This looks like race between PATA reset sequence and SATA hot plug events. For AHCI it is handled by masking interrupts during reset. How it is expected to be done here, I am not sure. You can just disable hot plug by commenting respective part of of ata_sata_phy_check_events() function. > ata7: reset tp2 stat0=50 stat1=00 devices=0x1^M > ata7-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire^M > ata7-master: pio=PIO4 wdma=WDMA2 udma=UDMA133 cable=40 wire^M > ad: ad14 already exists; skipping it^M > ad: ad14 already exists; skipping it^M > ^M > ^M > Fatal trap 12: page fault while in kernel mode^M It looks alike to crash I have already fixed on CURRENT: http://svn.freebsd.org/changeset/base/188464 -- Alexander Motin