From owner-freebsd-current@freebsd.org Mon Sep 14 06:30:52 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8574C3F46F6 for ; Mon, 14 Sep 2020 06:30:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bqc1l3ZWTz4J5w; Mon, 14 Sep 2020 06:30:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qk1-x72e.google.com with SMTP id q63so15076066qkf.3; Sun, 13 Sep 2020 23:30:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eXBKzuu2nSrmqrbMohkCxxa1IzN3UqW9GqM+EdUp5gk=; b=aVk4cSJxUBOmxsOpJNZBYQP+hgLNzlTKEjqbxMV1fjFBiEWb1j86SlFSeRQEdl+O/i xrpZlBgOR1SFoxkKXUEB6V9MGvmKxIbl3tatP9VGptABYLKYggoV1MoB/YIW3BJN3qNg FGigCIJvcKF7xSdkm0HiJdpojk4c1b/b9Cua9mYxqPOupXg7RFOX7K7kO+fdUVIeAy6w cvKfZSLfUNhRjOKJZHgfPynt9WXHwTMtkVpyqoGHmKprwS2qcgQFyCQPqLnYzbr4FuxM h/0eS7XbcBpaxCx1W5Mw+i/FGHi4f+zx/sGHYAXfWVvOl4300UzS/GbRGN87XE5FKKrc aI4w== X-Gm-Message-State: AOAM530cukKEYnULlYXLzkYuSgf3L73gUtxnc8Pa/Uj5mspCfJD+qcC6 5svUi9llB9sAs7VJTvYzqA8qMpvQoD31ok1+alg= X-Google-Smtp-Source: ABdhPJzSu2nC7vucN0EE0YDwNLkn3iXvzzrbDG4o7Si3PoGMMLiID6NAPJHPTza0ybOMSNftvkBCrv6IalR3djgRE9A= X-Received: by 2002:a37:b882:: with SMTP id i124mr11892239qkf.51.1600065050473; Sun, 13 Sep 2020 23:30:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adrian Chadd Date: Sun, 13 Sep 2020 23:30:37 -0700 Message-ID: Subject: Re: Panic with wifi + usb in latest FreeBSD-current To: Warner Losh Cc: FreeBSD Current , Hans Petter Selasky , "Bjoern A. Zeeb" X-Rspamd-Queue-Id: 4Bqc1l3ZWTz4J5w X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.91 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.05)[-1.047]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; NEURAL_HAM_LONG(-1.03)[-1.028]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72e:from]; NEURAL_HAM_SHORT(-0.83)[-0.831]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 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: Mon, 14 Sep 2020 06:30:52 -0000 On Sun, 13 Sep 2020 at 22:34, Warner Losh wrote: > > > On Sun, Sep 13, 2020, 11:29 PM Adrian Chadd > wrote: > >> Yeah, this was also reported in #freebsd-wireless today. >> >> Is there a lock being held in the rtwn path that shouldn't be? >> > > I'll check in the morning... this was like the 20th thing to go wrong this > weekend, so I copied the panic down, send the email and grabbed a beer and > turned it off... > Ok. I checked the driver and the usb stack; nothing in the change lists obviously stands out to me at 11pm on a Sunday. Can you see if any locks are held? or an epoch? Something smells fishy. (defining EPOCH_TRACE will dump the list of epochs, if I'm reading the subr_sleepqueue.c code correctly.) Ok, so, since I dug a bit more on a hunch, I bet the NET epoch is being held - it's grabbed in rtwn_bulk_rx_callback, and rtwn_rx_common is reading some registers as part of processing the receive queue. I bet that act of reading registers over blocking USB is causing things to explode. If it is net epoch then we're going to have to think of a better design pattern here to migrate all of these here wifi drivers to, because I guarantee you they're all behaving poorly in this newer world order. Thanks, -adrian > > panic: sleepq_add: td to sleep on wchan with sleeping >>> prohibited >>> cpuid = 5 >>> time = 1600057358 >>> KDB: stack backtrace: >>> ... >>> panic() >>> sleepq_add() >>> _cv_wait() >>> usbd_do_request_flags >>> rtwn_do_request >>> rtwn_usb_read_4 >>> rtwn_rx_common >>> rtwn_bulk_rx_callback >>> usbd_callback_wrapper >>> usb_command_wrapper >>> usb_callback_proc >>> usb_process >>> ... >>> >>> I've done a fresh installworld and installkernel, but am running packages >>> from late may since I've not updated them. I've updated the iichid and >>> drm-kmod ports and rebuilt them and reinstalled them as well (so I know >>> they aren't out of date). >>> >>> Has anybody else seen this? >>> >>> Warner >>> _______________________________________________ >>> freebsd-current@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-current >>> To unsubscribe, send any mail to " >>> freebsd-current-unsubscribe@freebsd.org" >>> >>