From nobody Fri Nov 08 16:26:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlPT4033vz5cSnR; Fri, 08 Nov 2024 16:26:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlPT34W6kz4nFF; Fri, 8 Nov 2024 16:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731083175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cL+IrwCFege9RQ0d2U3ip1pq3ecBwWNGb6+9lt015NE=; b=n+Bv2oI6zanVcU5HdSjNjaQqcIlQzDrdpLyK29NEdTnDwExpicqtO70qrgnj6+1fxfFObN hxFy5K5wys3V0fFTqDMEy+F2AAqajc882KSFxKmUpG9FRH+/u29ONEo16736+OwiC/Rwdk 1hPT+J8Z2uRO85mVzCUhgyhqlgiL3fyjyxsRBAaB+0o7PGZwnDns8/DKWc6tGJse7EKot0 +E5lMOfa/g/jvpXB5/gvEDFLyWW4ptBRwsFngeETv9YqxrP97U2sdq5SXrwks9Ka5lRge/ tM0dHPq4GRgYdrVVJEDbmgof+/ATlVZowOmgNnQlGhEFwgVGAnKRFr1MPF77pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731083175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cL+IrwCFege9RQ0d2U3ip1pq3ecBwWNGb6+9lt015NE=; b=PY347be1W3FoQ+y68A9IPEhjDPDGDVBGQ7u0rajvGAygObvkXAWBr8H8YSo27ojY7zWsWS tV4jm5rGkidecLiYlbsf2PgRVPLtjW5APfOLj2iibtMQzja0DAPrqFKcHl/O4w8FTIQvvi U2g1WJVhMv7RpXHA6Tgx+TsIweLsYAZy9BdKDVVIz1TYwdgpGTBE/2bRPz4CR7/sCpja14 6YlvWnDTzzAemzUpVzLwkiPhDMOeuyluF2Lznd73I3pRICps/ny/eVQliivHUfxR0Iy8qZ XNCVl8VuNWfi/QZd5bFBcJFw33EIFzla10i51aofFSKOl2/9Yls1TXwtJBalYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731083175; a=rsa-sha256; cv=none; b=MY4BvikFN+hX3l25ywH4/ExRQCxbmSYw6UOxSQCHLDGTzq/MJAi2+BxedtwYpadctp/I+K EzPgRAw2Xd57uAxduzvKZhpNICs1t5cv52yW1C60Lb7qcoLLPaOKb34qj+OluX0CCPaSIv 8V0JUAwER8Y87l7wb1Z74kdSLRXXQAw4PwN3CB9n2fQST6pPGUIzDsGaYKUHyPSrPm7PMn MlJTXxu/kH1ynuT5nQ/b72+nbx5NMBkgS5wG25qu6CgUqQ7A8tg0NgGDDmoGHbs4ylMybT 0thNFoMJVqohmgTTuB94Lnn5ZgONC2YOgJu08nkqEmEy3QnSO6If2BTI9Vg/rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XlPT346Ddzc6q; Fri, 8 Nov 2024 16:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A8GQFDj029741; Fri, 8 Nov 2024 16:26:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A8GQF5J029738; Fri, 8 Nov 2024 16:26:15 GMT (envelope-from git) Date: Fri, 8 Nov 2024 16:26:15 GMT Message-Id: <202411081626.4A8GQF5J029738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 8838f3c32ac0 - main - rtwn: ensure TX work isn't scheduled during reset / abort List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8838f3c32ac0ebcb8b20863f8c455375039a505e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=8838f3c32ac0ebcb8b20863f8c455375039a505e commit 8838f3c32ac0ebcb8b20863f8c455375039a505e Author: Adrian Chadd AuthorDate: 2024-11-08 16:26:05 +0000 Commit: Adrian Chadd CommitDate: 2024-11-08 16:26:05 +0000 rtwn: ensure TX work isn't scheduled during reset / abort Don't schedule work during reset / abort. For USB NICs, work must not be scheduled during a call to rtwn_usb_abort_xfers(), as then it'll cause the call to usbd_transfer_drain() to hang. This fixes a hang I've been seeing where the NIC hits a TX timeout and then the reset/re-init path is called. If data is scheduled to be transmitted in that window, the call to usbd_transfer_drain() would hang and require a hard reboot to recover. Differential Revision: https://reviews.freebsd.org/D47479 --- sys/dev/rtwn/if_rtwn_tx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/rtwn/if_rtwn_tx.c b/sys/dev/rtwn/if_rtwn_tx.c index f5e97933b314..bf45d14f7edc 100644 --- a/sys/dev/rtwn/if_rtwn_tx.c +++ b/sys/dev/rtwn/if_rtwn_tx.c @@ -263,6 +263,11 @@ rtwn_start(struct rtwn_softc *sc) struct mbuf *m; RTWN_ASSERT_LOCKED(sc); + + /* Ensure no work is scheduled during reset/teardown */ + if ((sc->sc_flags & RTWN_RUNNING) == 0) + return; + while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) { if (sc->qfullmsk != 0) { mbufq_prepend(&sc->sc_snd, m);