NetBSD Problem Report #48213

From gson@gson.org  Sun Sep 15 10:49:26 2013
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9D03870FBC
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 15 Sep 2013 10:49:26 +0000 (UTC)
Message-Id: <20130915104915.9C6E775FC8@guava.gson.org>
Date: Sun, 15 Sep 2013 13:49:15 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@gnats.NetBSD.org
Subject: ehci assertion failure during boot
X-Send-Pr-Version: 3.95

>Number:         48213
>Category:       kern
>Synopsis:       ehci assertion failure during boot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 15 10:50:00 +0000 2013
>Closed-Date:    Sun Dec 01 14:16:22 +0000 2013
>Last-Modified:  Sun Dec 01 14:16:22 +0000 2013
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2013.09.12.07.26.13
>Organization:
>Environment:
System: NetBSD guido.araneus.fi
Architecture: x86_64
Machine: amd64
>Description:

While doing reboots in a loop trying to reproduce a different bug, my
x86_64 machine paniced.  The following console output is manually
transcribed, so there may be typos:

  uhidev0: GASIA PS2toUSB Adapter, rev 1.10/2.80, addr 3, iclass 3/1
  ukbd0 at uhidev0: 8 modifier keys, 6 key codes

  This port is broken, it does not call cnpollc() before calling cngetc().
  This should be fixed, but it will work anyway (for now).
  panic: kernel diagnostic assertion "mutex_owned(&sc->sx_lock)" failed: file "/tmp/bracket/build/2013.09.12.07.26.13-amd64/sys/dev/usb/ehci.c", line 3302
  fatal breakpoint trap in supervisor mode
  trap type 1 code 0 rip ffffffff8026a46d cs 8 rflags 246 cr2 0 ilevel 8 rsp ffffffff810e3970
  curlwp 0xffffffff80ec7460 pid 0.1 lowest kstack 0xffffffff810dc280
  Stopped in pid 0,1 (system) at  netbsd:breakpoint+0x5:   leave
  db{0}> ehci_done: ex=0xfffffe8419c6b2e0 is done!

I am unable to obtain a stack trace, because when I try to type a ddb
command on the USB keyboard, each keypress only results in printing
another copy of the last line,

  ehci_done: ex=0xfffffe8419c6b2e0 is done!

This is an Intel DH67CLB3 motherboard with BIOS version BLH6710H.86A.0131.2011.0926.1945.
The same machine is also afflicted by PRs 38970, 46596, 46696, and 47153.

>How-To-Repeat:

Not sure since it has only happened once so far, but presumably
doing reboots in a loop with a similar motherboard and a USB
keyboard/mouse will eventually hit it.

>Fix:

>Release-Note:

>Audit-Trail:
From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: Andreas Gustafsson <gson@gson.org>, kern-bug-people@netbsd.org, 
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/48213: ehci assertion failure during boot
Date: Sat, 30 Nov 2013 13:16:59 +0000

 This is a multi-part message in MIME format.
 --------------070405060302030605000708
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit

 On 09/15/13 11:50, Andreas Gustafsson wrote:

 >>    This port is broken, it does not call cnpollc() before calling cngetc().
 >>    This should be fixed, but it will work anyway (for now).

 This part should be easy to fix, but first...
 >>    panic: kernel diagnostic assertion "mutex_owned(&sc->sx_lock)" failed: file "/tmp/bracket/build/2013.09.12.07.26.13-amd64/sys/dev/usb/ehci.c", line 3302

 The KASSERT misses the polling case which you've clearly entered.

 Nick

 --------------070405060302030605000708
 Content-Type: text/plain; charset=us-ascii;
  name="ctrl_done_polling.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="ctrl_done_polling.diff"

 Index: sys/dev/usb/ehci.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/ehci.c,v
 retrieving revision 1.219
 diff -u -p -u -r1.219 ehci.c
 --- sys/dev/usb/ehci.c	26 Nov 2013 05:54:43 -0000	1.219
 +++ sys/dev/usb/ehci.c	30 Nov 2013 13:11:50 -0000
 @@ -3296,7 +3296,7 @@ ehci_device_ctrl_done(usbd_xfer_handle x

  	DPRINTFN(10,("ehci_ctrl_done: xfer=%p\n", xfer));

 -	KASSERT(mutex_owned(&sc->sc_lock));
 +	KASSERT(sc->sc_bus.use_polling || mutex_owned(&sc->sc_lock));

  #ifdef DIAGNOSTIC
  	if (!(xfer->rqflags & URQ_REQUEST)) {


 --------------070405060302030605000708--

From: Andreas Gustafsson <gson@gson.org>
To: Nick Hudson <skrll@netbsd.org>
Cc: gnats-bugs@NetBSD.org,
    Andreas Gustafsson <gson@gson.org>,
    kern-bug-people@netbsd.org,
    gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: Re: kern/48213: ehci assertion failure during boot
Date: Sat, 30 Nov 2013 17:26:28 +0200

 Nick,

 You wrote:
 > >>    panic: kernel diagnostic assertion "mutex_owned(&sc->sx_lock)" failed: file "/tmp/bracket/build/2013.09.12.07.26.13-amd64/sys/dev/usb/ehci.c", line 3302
 > 
 > The KASSERT misses the polling case which you've clearly entered.

 In that case, it looks like ohci_device_ctrl_done() and
 ohci_device_ctrl_done() have the same problem.
 -- 
 Andreas Gustafsson, gson@gson.org

From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48213 CVS commit: src/sys/dev/usb
Date: Sun, 1 Dec 2013 07:28:48 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Sun Dec  1 07:28:48 UTC 2013

 Modified Files:
 	src/sys/dev/usb: ehci.c ohci.c uhci.c

 Log Message:
 Adjust KASSERT in device_ctrl_done to polling case.

 PR/48213: ehci assertion failure during boot


 To generate a diff of this commit:
 cvs rdiff -u -r1.219 -r1.220 src/sys/dev/usb/ehci.c
 cvs rdiff -u -r1.244 -r1.245 src/sys/dev/usb/ohci.c
 cvs rdiff -u -r1.262 -r1.263 src/sys/dev/usb/uhci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sun, 01 Dec 2013 07:40:54 +0000
State-Changed-Why:
Pullups?


From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org, 
 gnats-admin@netbsd.org, Andreas Gustafsson <gson@gson.org>
Subject: Re: kern/48213 (ehci assertion failure during boot)
Date: Sun, 01 Dec 2013 07:49:11 +0000

 On 12/01/13 07:40, skrll@NetBSD.org wrote:
 > Synopsis: ehci assertion failure during boot
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: skrll@NetBSD.org
 > State-Changed-When: Sun, 01 Dec 2013 07:40:54 +0000
 > State-Changed-Why:
 > Pullups?

 Of course, this isn't a problem pre-usbmp so no pullups are required.

 OK to close?

 Nick

From: Andreas Gustafsson <gson@gson.org>
To: Nick Hudson <skrll@netbsd.org>
Cc: gnats-bugs@NetBSD.org,
    kern-bug-people@netbsd.org,
    netbsd-bugs@netbsd.org,
    gnats-admin@netbsd.org
Subject: Re: kern/48213 (ehci assertion failure during boot)
Date: Sun, 1 Dec 2013 12:33:58 +0200

 Nick Hudson wrote:
 > Of course, this isn't a problem pre-usbmp so no pullups are required.
 > 
 > OK to close?

 Yes.  I have only seen this problem once, so I can't easily confirm
 the fix by testing, but I will consider it fixed unless or until it
 happens again.
 -- 
 Andreas Gustafsson, gson@gson.org

State-Changed-From-To: feedback->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sun, 01 Dec 2013 14:16:22 +0000
State-Changed-Why:
submitter agreed to close.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.