From owner-freebsd-wireless@freebsd.org Mon Dec 2 18:35:09 2019 Return-Path: Delivered-To: freebsd-wireless@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 9405A1B3544 for ; Mon, 2 Dec 2019 18:35:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47RYgx3RSPz4CZC for ; Mon, 2 Dec 2019 18:35:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 744C51B3543; Mon, 2 Dec 2019 18:35:09 +0000 (UTC) Delivered-To: wireless@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 741281B3542 for ; Mon, 2 Dec 2019 18:35:09 +0000 (UTC) (envelope-from bugzilla-noreply@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47RYgx2SBJz4CZB for ; Mon, 2 Dec 2019 18:35:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37BC7332A for ; Mon, 2 Dec 2019 18:35:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB2IZ9TD003281 for ; Mon, 2 Dec 2019 18:35:09 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB2IZ9nL003280 for wireless@FreeBSD.org; Mon, 2 Dec 2019 18:35:09 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: wireless@FreeBSD.org Subject: [Bug 242337] iwm - rate 0 causes iwm panic (and work around) Date: Mon, 02 Dec 2019 18:35:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: markj@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: wireless@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Dec 2019 18:35:09 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242337 Mark Johnston changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |markj@FreeBSD.org --- Comment #4 from Mark Johnston --- Hmm, note that one of the callers of iwm_rate2idx() already contains this l= ogic (i.e., maps an unknown rate to the lowest one). I guess the problem is with the code which programs the fw rate table.=20 iwm_setrates() already skips over invalid rates... but the code which fills= in the rest of the table is wrong. Can you try this hack instead? I did not test it. There is a larger issue here in that we are ending up with a rate of 0, but= we can at least avoid panicking. diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 06bd66cc3ef6..4bd6547cc57f 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -4385,8 +4385,10 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *= in, int rix) /* Map 802.11 rate to HW rate index. */ ridx =3D iwm_rate2ridx(sc, rate); - if (ridx =3D=3D -1) + if (ridx =3D=3D -1) { + nrates--; continue; + } #if 0 if (txant =3D=3D 0) --=20 You are receiving this mail because: You are the assignee for the bug.=