NetBSD Problem Report #55090

From www@netbsd.org  Fri Mar 20 03:35:18 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id F115E1A921A
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 20 Mar 2020 03:35:17 +0000 (UTC)
Message-Id: <20200320033516.2224A1A921A@mollari.NetBSD.org>
Date: Fri, 20 Mar 2020 03:35:16 +0000 (UTC)
From: venture37@geeklan.co.uk
Reply-To: venture37@geeklan.co.uk
To: gnats-bugs@NetBSD.org
Subject: block with spin-mutex held assertion when bringing iwn(4) up
X-Send-Pr-Version: www-1.0

>Number:         55090
>Category:       kern
>Synopsis:       block with spin-mutex held assertion when bringing iwn(4) up
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    thorpej
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 20 03:40:00 +0000 2020
>Closed-Date:    Wed Jun 10 23:33:29 +0000 2020
>Last-Modified:  Wed Jun 10 23:33:29 +0000 2020
>Originator:     Sevan Janiyan
>Release:        NetBSD 9.99.50
>Organization:
>Environment:
NetBSD 9.99.50 amd64 x86_64

>Description:
Brought iwn interface down, stopped dhcpcd, let some time pass and brought the interface back up. System panicked with 
kernel diagnostic assertion "ci->ci_mtx_count == -1" failed: file "/usr/src/sys/kern/kern_synch.c", line 740 mi_switch: cpu2: ci_mtx_count (-2) != -1 (block with spin-mutex held)

bt
vpanic()
kern_assert()
mi_switch()
sleepq_block()
iwn5000_load_firmware()
iwn_hw_init()
iwn_init()
ifmedia_change()
ifmedia_ioctl()
ieee80211_ioctl()
iwn_ioctl()
doifioctl()
sys_ioctl()
syscall()
--- syscall (number 54) ---

Photo of panic:
https://pbs.twimg.com/media/EThRIqFUMAAtRtp?format=jpg&name=orig

>How-To-Repeat:
flap iwn(4) with a delay in between up and down states or some minutes?
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->thorpej
Responsible-Changed-By: thorpej@NetBSD.org
Responsible-Changed-When: Fri, 20 Mar 2020 03:45:42 +0000
Responsible-Changed-Why:
Mine.


State-Changed-From-To: open->feedback
State-Changed-By: thorpej@NetBSD.org
State-Changed-When: Fri, 20 Mar 2020 13:35:11 +0000
State-Changed-Why:
This commit should fix it.

Module Name:	src
Committed By:	thorpej
Date:		Fri Mar 20 13:33:23 UTC 2020

Modified Files:
	src/sys/dev/pci: if_iwi.c if_iwivar.h

Log Message:
This driver sleeps during iwi_media_change(), and thus requires an
adaptive mutex for the media lock.


State-Changed-From-To: feedback->closed
State-Changed-By: sevan@NetBSD.org
State-Changed-When: Wed, 10 Jun 2020 23:33:29 +0000
State-Changed-Why:
fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.