Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: Andreas Gustafsson To: bug-follo...@freebsd.org Cc: Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Wed, 18 Sep 2013 10:33:22 +0300 FWIW, this problem also affects NetBSD, see http://gnats.netbsd.org/46596 . -- Andreas Gustafsson, g...@gson.org ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: TANABE Ken-ichi To: bug-follo...@freebsd.org, daynejor...@gmail.com Cc: Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Thu, 6 Jun 2013 00:58:09 +0900 --047d7b6dc7baa2bb9e04de6a43ba Content-Type: text/plain; charset=ISO-8859-1 Hi, On Wed, 24 Apr 2013 03:33:02 -0700, Andrew Fremantle wrote: > Based on the fact this only seems to happen on Intel Core architecture > machines, I think this issue may be miscategorized. > In my case, the flooding starts when I yank the VGA cable from the back of > the machine. vgapci0 shares irq16 with ehci0 in every example of this issue > i've been able to find. same here. I confirmed that the fooding starts when I remove the VGA cable from the machine (onboard). I've attached my full dmesg. -- TANABE Ken-ichi / @nabeken Mailto: nabe...@tknetworks.org / gmail.com / gentoo.gr.jp --047d7b6dc7baa2bb9e04de6a43ba Content-Type: text/plain; charset=US-ASCII; name="dmesg.txt" Content-Disposition: attachment; filename="dmesg.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hhkp15iw0 Q29weXJpZ2h0IChjKSAxOTkyLTIwMTIgVGhlIEZyZWVCU0QgUHJvamVjdC4KQ29weXJpZ2h0IChj KSAxOT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y3kgMzU3OTU0NSBIeiBxdWFsaXR5IDg1MAphY3BpX3RpbWVyMDogPDI0LWJpdCB0aW1lciBhdCAz LjU3OTU0NU1Iej4gcG9ydCAweDQwOC0weDQwYiBvbiBhY3BpMApwY2liMDogPEFDUEkgSG9zdC1Q Q0kgYnJpZGdlPiBwb3J0IDB4Y2Y4LTB4Y2ZmIG9uIGFjcGkwCnBjaTA6IDxBQ1BJIFBDSSBidXM+ IG9uIHBjaWIwCnZnYXBjaTA6IDxWR0EtY29tcGF0aWJsZSBkaXNwbGF5PiBwb3J0IDB4ZjEwMC0w eGYxMDcgbWVtIDB4ZmUwMDAwMDAtMHh
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: Andrew Fremantle To: bug-follo...@freebsd.org, daynejor...@gmail.com Cc: Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Wed, 24 Apr 2013 03:33:02 -0700 --047d7b10d1b7998c1c04db18d35b Content-Type: text/plain; charset=ISO-8859-1 Based on the fact this only seems to happen on Intel Core architecture machines, I think this issue may be miscategorized. In my case, the flooding starts when I yank the VGA cable from the back of the machine. vgapci0 shares irq16 with ehci0 in every example of this issue i've been able to find. The forum thread on this issue may make for relevant reading: http://forums.freebsd.org/showthread.php?t=24952 --047d7b10d1b7998c1c04db18d35b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Based on the fact this only seems to happen on I= ntel Core architecture machines, I think this issue may be miscategorized.<= br>In my case, the flooding starts when I yank the VGA cable from= the back of the machine. vgapci0 shares irq16 with ehci0 in every example = of this issue i've been able to find. The forum thread on this issue may make for relevant reading: http://forums.freebsd.org/showthread.php?t=3D24952";>http://forums.f= reebsd.org/showthread.php?t=3D24952 --047d7b10d1b7998c1c04db18d35b-- ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: Colin Percival To: Hans Petter Selasky Cc: "bug-follo...@freebsd.org" Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Sun, 10 Jul 2011 18:30:22 -0700 On 07/09/11 02:07, Hans Petter Selasky wrote: > Have you tried to set any of these quirks: > > hw.usb.ehci.lostintrbug: 0 > hw.usb.ehci.iaadbug: 0 Yes. Neither has any effect. (At least, not when I set them via sysctl; I could try setting them as loader tunables if you think that would make a difference.) I wrote: > The attached patch seems to fix the problem while not breaking anything on > my laptop. Key words, "seems to". On further use I've found that my change didn't make any difference; it was just a coincidence that the problem temporarily went away at that time. However, I've managed (I think!) to figure out what's triggering this: The IRQ flood starts when the laptop battery is recharging. Letting the battery run down for a couple hours and then plugging in AC power has 100% consistently triggered this; but if the battery is already fully charged when FreeBSD boots I don't get the IRQ flood. Hans Petter Selasky wrote: > Try the attached patch and report back. The EHCI should never generate more > than 8000 IRQ/s second, so this clearly indicates a Hardware Problem. No change, I'm afraid. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: Hans Petter Selasky To: Colin Percival Cc: "bug-follo...@freebsd.org" Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Sat, 9 Jul 2011 11:48:29 +0200 --Boundary-00=_tPCGOkni6SDJGZL Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Friday 08 July 2011 22:37:45 Colin Percival wrote: > Hi, > > I'm seeing this ehci interrupt storm with 8.2-RELEASE on my Dell E5420 > laptop; vmstat -i reports 187300 interrupts per second from ehci. > > I've attached my /var/log/messages showing the boot messages and 1 seconds > worth of hw.usb.ehci.debug=15 output as suggested. Hopefully it means > more to you than it does to me... Try the attached patch and report back. The EHCI should never generate more than 8000 IRQ/s second, so this clearly indicates a Hardware Problem. --HPS --Boundary-00=_tPCGOkni6SDJGZL Content-Type: text/x-patch; charset="iso-8859-15"; name="ehci_fix_terminate.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ehci_fix_terminate.patch" === ehci.c == --- ehci.c (revision 223868) +++ ehci.c (local) @@ -354,12 +354,9 @@ htohc32(sc, EHCI_QH_SET_MULT(1)); qh->qh_curqtd = 0; - qh->qh_qtd.qtd_next = - htohc32(sc, EHCI_LINK_TERMINATE); - qh->qh_qtd.qtd_altnext = - htohc32(sc, EHCI_LINK_TERMINATE); - qh->qh_qtd.qtd_status = - htohc32(sc, EHCI_QTD_HALTED); + qh->qh_qtd.qtd_next = sc->sc_terminate_self; + qh->qh_qtd.qtd_altnext = sc->sc_terminate_self; + qh->qh_qtd.qtd_status = htohc32(sc, EHCI_QTD_HALTED); } /* @@ -394,7 +391,7 @@ qh = sc->sc_intr_p_last[0]; /* the last (1ms) QH terminates */ - qh->qh_link = htohc32(sc, EHCI_LINK_TERMINATE); + qh->qh_link = sc->sc_terminate_self; } for (i = 0; i < EHCI_VIRTUAL_FRAMELIST_COUNT; i++) { ehci_sitd_t *sitd; @@ -497,8 +494,8 @@ qh->qh_curqtd = 0; /* fill the overlay qTD */ - qh->qh_qtd.qtd_next = htohc32(sc, EHCI_LINK_TERMINATE); - qh->qh_qtd.qtd_altnext = htohc32(sc, EHCI_LINK_TERMINATE); + qh->qh_qtd.qtd_next = sc->sc_terminate_self; + qh->qh_qtd.qtd_altnext = sc->sc_terminate_self; qh->qh_qtd.qtd_status = htohc32(sc, EHCI_QTD_HALTED); } /* flush all cache into memory */ --Boundary-00=_tPCGOkni6SDJGZL-- ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: Hans Petter Selasky To: Colin Percival Cc: "bug-follo...@freebsd.org" Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Sat, 9 Jul 2011 11:33:40 +0200 On Saturday 09 July 2011 02:26:37 Colin Percival wrote: > Hi again, > > The attached patch seems to fix the problem while not breaking anything on > my laptop. It makes handles the case of EHCI_REMOVE_QH(sqh, last) with > sqh == last and sqh->prev == NULL by setting last = NULL -- the idea being > that if sqh is the only entry in the queue, we still ought to delete it > even though it doesn't have a predecessor. > > I have no idea if this is correct, since I don't know the rest of the code > in this file. Maybe we should also delete the first entry in a queue even > when it isn't also the last entry; maybe the problem lies somewhere else > entirely. I'm hoping that someone who knows this code will be able to > figure out the right fix easily now that I have an apparently-working > hack. Hi, The last element should always be there. If it is NULL I would like to see a backtrace from that. KASSERT(last != NULL) in both add and remove. If you clear that the USB queue will stop working I believe. Anyway, I think your clue might give some hints what is wrong. It appears that the EHCI is spinning on the IDLE queue somehow producing a lot of IRQ's. --HPS ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: Hans Petter Selasky To: Colin Percival Cc: "bug-follo...@freebsd.org" Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Sat, 9 Jul 2011 11:07:16 +0200 On Friday 08 July 2011 22:37:45 Colin Percival wrote: > Hi, > > I'm seeing this ehci interrupt storm with 8.2-RELEASE on my Dell E5420 > laptop; vmstat -i reports 187300 interrupts per second from ehci. > > I've attached my /var/log/messages showing the boot messages and 1 seconds > worth of hw.usb.ehci.debug=15 output as suggested. Hopefully it means > more to you than it does to me... Have you tried to set any of these quirks: hw.usb.ehci.lostintrbug: 0 hw.usb.ehci.iaadbug: 0 --HPS ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
The following reply was made to PR usb/156596; it has been noted by GNATS. From: Colin Percival To: bug-follo...@freebsd.org, Hans Petter Selasky Cc: Subject: Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Fri, 08 Jul 2011 17:26:37 -0700 This is a multi-part message in MIME format. --060902060404020901000206 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi again, The attached patch seems to fix the problem while not breaking anything on my laptop. It makes handles the case of EHCI_REMOVE_QH(sqh, last) with sqh == last and sqh->prev == NULL by setting last = NULL -- the idea being that if sqh is the only entry in the queue, we still ought to delete it even though it doesn't have a predecessor. I have no idea if this is correct, since I don't know the rest of the code in this file. Maybe we should also delete the first entry in a queue even when it isn't also the last entry; maybe the problem lies somewhere else entirely. I'm hoping that someone who knows this code will be able to figure out the right fix easily now that I have an apparently-working hack. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid --060902060404020901000206 Content-Type: text/x-patch; name="ehci.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ehci.c.diff" --- sys/dev/usb/controller/ehci.c.orig 2011-07-08 16:48:10.0 + +++ sys/dev/usb/controller/ehci.c 2011-07-08 16:49:18.0 + @@ -1177,7 +1177,9 @@ sqh->prev = 0; usb_pc_cpu_flush(sqh->page_cache); - } + } else if (last == sqh) + last = NULL; + return (last); } --060902060404020901000206-- ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: usb/156596: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0
Old Synopsis: Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 New Synopsis: [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Responsible-Changed-From-To: freebsd-amd64->freebsd-usb Responsible-Changed-By: linimon Responsible-Changed-When: Sun Apr 24 03:15:01 UTC 2011 Responsible-Changed-Why: reclassify. http://www.freebsd.org/cgi/query-pr.cgi?pr=156596 ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"