From owner-freebsd-current@FreeBSD.ORG Sat Jun 25 02:53:40 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A37A16A41C; Sat, 25 Jun 2005 02:53:40 +0000 (GMT) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: from www.mmlab.cse.yzu.edu.tw (www.mmlab.cse.yzu.edu.tw [140.138.150.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48CC443D1F; Sat, 25 Jun 2005 02:53:40 +0000 (GMT) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: by www.mmlab.cse.yzu.edu.tw (qmail, from userid 1000) id 0881C5078CD; Sat, 25 Jun 2005 10:53:39 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by www.mmlab.cse.yzu.edu.tw (qmail) with ESMTP id 02F78507835; Sat, 25 Jun 2005 10:53:39 +0800 (CST) Date: Sat, 25 Jun 2005 10:53:38 +0800 (CST) From: Tai-hwa Liang To: John Baldwin In-Reply-To: <200506241600.42470.jhb@FreeBSD.org> Message-ID: <0506251043379.48374@www.mmlab.cse.yzu.edu.tw> References: <200506241600.42470.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1298518687-1119668018=:48374" Cc: Sam Leffler , freebsd-current@freebsd.org, Rainer Hungershausen , Pascal Hofstee Subject: Re: if_ral + wpa_supplicant stack backtrace X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2005 02:53:40 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1298518687-1119668018=:48374 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Fri, 24 Jun 2005, John Baldwin wrote: > On Saturday 18 June 2005 11:56 am, Pascal Hofstee wrote: >> Hi, >> >> I am seeing period occurances of the same system call with the same >> WITNESS warning and similar backtrace on yesterday's AMD64 CURRENT. >> >> ---------------------- >> ral0: link state changed to DOWN >> malloc(M_WAITOK) of "32", forcing M_NOWAIT with the following >> non-sleepable locks held: >> exclusive sleep mutex ral0 (network driver) r = 0 (0xffffffff80c64de8) >> locked @ /usr/src/sys/dev/ral/if_ral.c:2167 >> KDB: stack backtrace: >> kdb_backtrace() at kdb_backtrace+0x37 >> witness_warn() at witness_warn+0x2c1 >> uma_zalloc_arg() at uma_zalloc_arg+0x69 >> malloc() at malloc+0xf5 >> ieee80211_ioctl_setoptie() at ieee80211_ioctl_setoptie+0x4b >> ieee80211_ioctl_set80211() at ieee80211_ioctl_set80211+0x64e >> ieee80211_ioctl() at ieee80211_ioctl+0x125 >> ral_ioctl() at ral_ioctl+0xa4 >> in_control() at in_control+0xc2f >> ifioctl() at ifioctl+0x1f6 >> soo_ioctl() at soo_ioctl+0x38c >> ioctl() at ioctl+0x476 >> syscall() at syscall+0x332 >> Xfast_syscall() at Xfast_syscall+0xa8 >> --- syscall (54, FreeBSD ELF64, ioctl), rip = 0x8007c2d4c, rsp = >> 0x7fffffffdfd8, rbp = 0x18 --- >> ral0: link state changed to UP >> ---------------------- >> >> I am indeed curious to understand what exactly is causing these WITNESS >> warnings > > This is a bug in ral(4) as it indiscriminately just holds its mutex across > ieee80211_ioctl() which isn't safe. The ral(4) maintainer needs to fix it. The same WITNESS warning also occurs in ath(4) whilst using wpa_supplicant. It looks to me that it's probably not individual driver's fault, but a known behaviour in net80211. Attached patch should suppress this warning; however, I'm not quite sure about whether it's safe to do so or not.... -- Cheers, Tai-hwa Liang --0-1298518687-1119668018=:48374 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=ieee80211_ioctl.patch Content-Transfer-Encoding: BASE64 Content-ID: <05062510533813.48374@www.mmlab.cse.yzu.edu.tw> Content-Description: Content-Disposition: attachment; filename=ieee80211_ioctl.patch LS0tIGllZWU4MDIxMV9pb2N0bC5jLm9yaWcJU2F0IEp1biAxOCAxNDowNzow MSAyMDA1DQorKysgaWVlZTgwMjExX2lvY3RsLmMJU2F0IEp1biAyNSAxMDow NDo0OCAyMDA1DQpAQCAtMTQ3NSw3ICsxNDc1LDcgQEANCiAJaWYgKGlyZXEt PmlfbGVuID4gSUVFRTgwMjExX01BWF9PUFRfSUUpDQogCQlyZXR1cm4gRUlO VkFMOw0KIAkvKiBOQjogZGF0YS5sZW5ndGggaXMgdmFsaWRhdGVkIGJ5IHRo ZSB3aXJlbGVzcyBleHRlbnNpb25zIGNvZGUgKi8NCi0JTUFMTE9DKGllLCB2 b2lkICosIGlyZXEtPmlfbGVuLCBNX0RFVkJVRiwgTV9XQUlUT0spOw0KKwlN QUxMT0MoaWUsIHZvaWQgKiwgaXJlcS0+aV9sZW4sIE1fREVWQlVGLCBNX05P V0FJVCk7DQogCWlmIChpZSA9PSBOVUxMKQ0KIAkJcmV0dXJuIEVOT01FTTsN CiAJZXJyb3IgPSBjb3B5aW4oaXJlcS0+aV9kYXRhLCBpZSwgaXJlcS0+aV9s ZW4pOw0K --0-1298518687-1119668018=:48374--