From owner-freebsd-firewire@FreeBSD.ORG Mon May 11 06:59:53 2009 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6488106564A; Mon, 11 May 2009 06:59:53 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from sopwith.solgatos.com (pool-173-50-234-194.ptldor.fios.verizon.net [173.50.234.194]) by mx1.freebsd.org (Postfix) with ESMTP id 03C7B8FC15; Mon, 11 May 2009 06:59:52 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: by sopwith.solgatos.com (Postfix, from userid 66) id 59604B64F; Sat, 9 May 2009 20:13:38 -0700 (PDT) Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id SAA05694; Sun, 10 May 2009 18:20:29 GMT Message-Id: <200905101820.SAA05694@sopwith.solgatos.com> To: Gavin Atkinson In-reply-to: Your message of "Fri, 06 Mar 2009 16:00:08 GMT." <200903061600.n26G082b030204@freefall.freebsd.org> Date: Sun, 10 May 2009 11:20:29 +0100 From: Dieter Cc: freebsd-firewire@freebsd.org, bug-followup@freebsd.org Subject: Re: kern/118093: [firewire] firewire bus reset hogs CPU, causing data to be lost X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2009 06:59:53 -0000 > > > This looks like it may be some bad > > > interaction between the firewire stack and using a serial > > > console. To submitter: It may be worth while switching to > > > uart(4) rather than sio(4) for your serial ports and seeing > > > if that makes any difference (as I don't think uart(4) uses > > > the Giant lock). > > Looks to me like commenting out sio doesn't work so well on my box. > > Is that the wrong way to switch from sio to uart? > > Is there something else I need to change instead, or in addition? > > You'll also need to add the uart hints to your device.hints file, if you > haven't already, and update /etc/ttys. > > hint.uart.0.at="isa" > hint.uart.0.port="0x3F8" > hint.uart.0.flags="0x10" > hint.uart.0.irq="4" > > /etc/ttys: you may find you need to change "ttyd0" to "ttyu0". > > Gavin Thanks, with those changes it works with uart now. The bad news is that switching from sio to uart didn't fix the CPU hogging problem. From owner-freebsd-firewire@FreeBSD.ORG Mon May 11 07:00:14 2009 Return-Path: Delivered-To: freebsd-firewire@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04BD1065674 for ; Mon, 11 May 2009 07:00:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DD9388FC1D for ; Mon, 11 May 2009 07:00:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4B70E64010505 for ; Mon, 11 May 2009 07:00:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4B70EGT010504; Mon, 11 May 2009 07:00:14 GMT (envelope-from gnats) Date: Mon, 11 May 2009 07:00:14 GMT Message-Id: <200905110700.n4B70EGT010504@freefall.freebsd.org> To: freebsd-firewire@FreeBSD.org From: Dieter Cc: Subject: Re: kern/118093: [firewire] firewire bus reset hogs CPU, causing data to be lost X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dieter List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2009 07:00:15 -0000 The following reply was made to PR kern/118093; it has been noted by GNATS. From: Dieter To: Gavin Atkinson Cc: freebsd-firewire@freebsd.org, bug-followup@freebsd.org Subject: Re: kern/118093: [firewire] firewire bus reset hogs CPU, causing data to be lost Date: Sun, 10 May 2009 11:20:29 +0100 > > > This looks like it may be some bad > > > interaction between the firewire stack and using a serial > > > console. To submitter: It may be worth while switching to > > > uart(4) rather than sio(4) for your serial ports and seeing > > > if that makes any difference (as I don't think uart(4) uses > > > the Giant lock). > > Looks to me like commenting out sio doesn't work so well on my box. > > Is that the wrong way to switch from sio to uart? > > Is there something else I need to change instead, or in addition? > > You'll also need to add the uart hints to your device.hints file, if you > haven't already, and update /etc/ttys. > > hint.uart.0.at="isa" > hint.uart.0.port="0x3F8" > hint.uart.0.flags="0x10" > hint.uart.0.irq="4" > > /etc/ttys: you may find you need to change "ttyd0" to "ttyu0". > > Gavin Thanks, with those changes it works with uart now. The bad news is that switching from sio to uart didn't fix the CPU hogging problem. From owner-freebsd-firewire@FreeBSD.ORG Mon May 11 11:06:54 2009 Return-Path: Delivered-To: freebsd-firewire@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 423EE1065676 for ; Mon, 11 May 2009 11:06:54 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2F1618FC13 for ; Mon, 11 May 2009 11:06:54 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4BB6s9T085931 for ; Mon, 11 May 2009 11:06:54 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4BB6rmw085927 for freebsd-firewire@FreeBSD.org; Mon, 11 May 2009 11:06:53 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 11 May 2009 11:06:53 GMT Message-Id: <200905111106.n4BB6rmw085927@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-firewire@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-firewire@FreeBSD.org X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2009 11:06:54 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- p kern/125673 firewire [firewire] [panic] FreeBSD7 panics when kldunloading f o kern/122951 firewire [firewire] video-transfer via fwcontrol triggers a pan o kern/118093 firewire [firewire] firewire bus reset hogs CPU, causing data t p kern/114646 firewire [firewire] [patch] firewire fails after suspend/resume o kern/113785 firewire [firewire] dropouts when playing DV on firewire o kern/97208 firewire [firewire] System hangs / locks up when a firewire dis o kern/74238 firewire [firewire] fw_rcv: unknown response; firewire ad-hoc w 7 problems total. From owner-freebsd-firewire@FreeBSD.ORG Mon May 11 19:29:25 2009 Return-Path: Delivered-To: freebsd-firewire@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id D24FF106566B; Mon, 11 May 2009 19:29:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Alexander Motin Date: Mon, 11 May 2009 15:29:10 -0400 User-Agent: KMail/1.6.2 References: <4A058B5C.3010707@FreeBSD.org> In-Reply-To: <4A058B5C.3010707@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <200905111529.12808.jkim@FreeBSD.org> Cc: freebsd-current@FreeBSD.org, freebsd-firewire@FreeBSD.org Subject: Re: [Fwd: Re: amd64 suspend/resume broken on current] X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2009 19:29:25 -0000 [CC added] On Saturday 09 May 2009 09:55 am, Alexander Motin wrote: > -------- Original Message -------- > Subject: Re: amd64 suspend/resume broken on current > Date: Fri, 8 May 2009 21:52:45 +0200 > From: Guy Brand > Organization: Direction Informatique, Université de Strasbourg, > France To: Alexander Motin > References: > <4A021118.2030106@mavhome.dp.ua> <20090508111024.GK4922@unistra.fr> > <4A041DC2.90106@mavhome.dp.ua> <20090508144551.GA1599@unistra.fr> > <4A047925.6060301@mavhome.dp.ua> > > Guy Brand wrote: > > Alexander Motin wrote: > > > Done. No firewire issue of course, but a kernel panic on > > > resume. Bad karma since yesterday :-) > > > > Where is this panic happens now? > > Just after resuming: > > Fatal trap 12: page fault while in kernel mode > ... > current process = 1415 (acpiconf) > > The backtrace says: > > intr_execute_handlers() at intr_execute_handlers+0x21 > lapic_handle_intr() at lapic_handle_intr+0x37 > Xapic_isr1() at Xapic_isr1+0xa4 > > acpi_sleep_machdep() at acpi_sleep_machdep+0x3b2 > acpi_EnterSleepState() at acpi_EnterSleepState+0x3fe > acpi_AckSleepState() at acpi_AckSleepState+0x163 > devfs_ioctl() at devfs_ioctl_f+0x77 > kern_ioctl() at kern_ioctl+0xb0 > ioctl() at ioctl+0xfd > syscall() at syscal+0x246 > Xfast_syscall() at Xfast_syscall+0xd0 So, that means the interrupt handler is executed *before* device is completely resumed. In fact, the interrupts are not disabled for dcons(4), it seems: #if 0 /* Let dcons(4) be accessed */ /* Stop interrupt */ OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_EN | OHCI_INT_ERR | OHCI_INT_PHY_SID | OHCI_INT_PHY_INT | OHCI_INT_DMA_ATRQ | OHCI_INT_DMA_ATRS | OHCI_INT_DMA_PRRQ | OHCI_INT_DMA_PRRS | OHCI_INT_DMA_ARRQ | OHCI_INT_DMA_ARRS | OHCI_INT_PHY_BUS_R); /* FLUSH FIFO and reset Transmitter/Reciever */ OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); #endif I guess firewire(4) should differentiate suspend and shutdown properly. Jung-uk Kim From owner-freebsd-firewire@FreeBSD.ORG Mon May 11 20:02:36 2009 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 63F851065676; Mon, 11 May 2009 20:02:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Guy Brand Date: Mon, 11 May 2009 16:02:16 -0400 User-Agent: KMail/1.6.2 References: <4A058B5C.3010707@FreeBSD.org> <200905111529.12808.jkim@FreeBSD.org> In-Reply-To: <200905111529.12808.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_MRICKTMydQQl+GD" Message-Id: <200905111602.20462.jkim@FreeBSD.org> Cc: Alexander Motin , freebsd-current@FreeBSD.org, freebsd-firewire@freebsd.org Subject: Re: [Fwd: Re: amd64 suspend/resume broken on current] X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2009 20:02:36 -0000 --Boundary-00=_MRICKTMydQQl+GD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Monday 11 May 2009 03:29 pm, Jung-uk Kim wrote: > [CC added] > > On Saturday 09 May 2009 09:55 am, Alexander Motin wrote: > > -------- Original Message -------- > > Subject: Re: amd64 suspend/resume broken on current > > Date: Fri, 8 May 2009 21:52:45 +0200 > > From: Guy Brand > > Organization: Direction Informatique, Université de Strasbourg, > > France To: Alexander Motin > > References: > > <4A021118.2030106@mavhome.dp.ua> > > <20090508111024.GK4922@unistra.fr> <4A041DC2.90106@mavhome.dp.ua> > > <20090508144551.GA1599@unistra.fr> > > <4A047925.6060301@mavhome.dp.ua> > > > > Guy Brand wrote: > > > Alexander Motin wrote: > > > > Done. No firewire issue of course, but a kernel panic on > > > > resume. Bad karma since yesterday :-) > > > > > > Where is this panic happens now? > > > > Just after resuming: > > > > Fatal trap 12: page fault while in kernel mode > > ... > > current process = 1415 (acpiconf) > > > > The backtrace says: > > > > intr_execute_handlers() at intr_execute_handlers+0x21 > > lapic_handle_intr() at lapic_handle_intr+0x37 > > Xapic_isr1() at Xapic_isr1+0xa4 > > > > acpi_sleep_machdep() at acpi_sleep_machdep+0x3b2 > > acpi_EnterSleepState() at acpi_EnterSleepState+0x3fe > > acpi_AckSleepState() at acpi_AckSleepState+0x163 > > devfs_ioctl() at devfs_ioctl_f+0x77 > > kern_ioctl() at kern_ioctl+0xb0 > > ioctl() at ioctl+0xfd > > syscall() at syscal+0x246 > > Xfast_syscall() at Xfast_syscall+0xd0 > > So, that means the interrupt handler is executed *before* device is > completely resumed. In fact, the interrupts are not disabled for > dcons(4), it seems: > > #if 0 /* Let dcons(4) be accessed */ > /* Stop interrupt */ > OWRITE(sc, FWOHCI_INTMASKCLR, > OHCI_INT_EN | OHCI_INT_ERR | > OHCI_INT_PHY_SID > > | OHCI_INT_PHY_INT > | OHCI_INT_DMA_ATRQ | OHCI_INT_DMA_ATRS > | OHCI_INT_DMA_PRRQ | OHCI_INT_DMA_PRRS > | OHCI_INT_DMA_ARRQ | OHCI_INT_DMA_ARRS > | OHCI_INT_PHY_BUS_R); > > /* FLUSH FIFO and reset Transmitter/Reciever */ > OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); > #endif > > I guess firewire(4) should differentiate suspend and shutdown > properly. Can you try the attached patch? I may be wrong cause I am not a firewire guru, though. Thanks! Jung-uk Kim --Boundary-00=_MRICKTMydQQl+GD Content-Type: text/plain; charset="utf-8"; name="firewire_suspend.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="firewire_suspend.diff" --- sys/dev/firewire/fwohci.c 13 Feb 2009 17:44:07 -0000 1.98 +++ sys/dev/firewire/fwohci.c 11 May 2009 19:46:24 -0000 @@ -1742,7 +1742,7 @@ } int -fwohci_stop(struct fwohci_softc *sc, device_t dev) +fwohci_stop(struct fwohci_softc *sc, device_t dev, int suspend) { u_int i; @@ -1759,9 +1759,10 @@ OWRITE(sc, OHCI_ITCTLCLR(i), OHCI_CNTL_DMA_RUN); } -#if 0 /* Let dcons(4) be accessed */ -/* Stop interrupt */ - OWRITE(sc, FWOHCI_INTMASKCLR, + /* Let dcons(4) be accessed if it is not suspending. */ + if (suspend) { + /* Stop interrupt */ + OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_EN | OHCI_INT_ERR | OHCI_INT_PHY_SID | OHCI_INT_PHY_INT | OHCI_INT_DMA_ATRQ | OHCI_INT_DMA_ATRS @@ -1769,9 +1770,9 @@ | OHCI_INT_DMA_ARRQ | OHCI_INT_DMA_ARRS | OHCI_INT_PHY_BUS_R); -/* FLUSH FIFO and reset Transmitter/Reciever */ - OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); -#endif + /* FLUSH FIFO and reset Transmitter/Reciever */ + OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); + } /* XXX Link down? Bus reset? */ return 0; --- sys/dev/firewire/fwohci_pci.c 9 Mar 2009 13:23:54 -0000 1.62 +++ sys/dev/firewire/fwohci_pci.c 11 May 2009 19:46:24 -0000 @@ -408,7 +408,7 @@ s = splfw(); if (sc->bsr) - fwohci_stop(sc, self); + fwohci_stop(sc, self, 0); bus_generic_detach(self); if (sc->fc.bdev) { @@ -462,7 +462,7 @@ err = bus_generic_suspend(dev); if (err) return err; - fwohci_stop(sc, dev); + fwohci_stop(sc, dev, 1); return 0; } @@ -482,7 +482,7 @@ fwohci_softc_t *sc = device_get_softc(dev); bus_generic_shutdown(dev); - fwohci_stop(sc, dev); + fwohci_stop(sc, dev, 0); return 0; } --- sys/dev/firewire/fwohcivar.h 3 Feb 2009 17:13:37 -0000 1.18 +++ sys/dev/firewire/fwohcivar.h 11 May 2009 19:46:24 -0000 @@ -83,4 +83,4 @@ void fwohci_reset (struct fwohci_softc *, device_t); int fwohci_detach (struct fwohci_softc *, device_t); int fwohci_resume (struct fwohci_softc *, device_t); -int fwohci_stop (struct fwohci_softc *, device_t dev); +int fwohci_stop (struct fwohci_softc *, device_t, int); --Boundary-00=_MRICKTMydQQl+GD--