Received: by mail.netbsd.org (Postfix, from userid 605) id 4953D84EA9; Sat, 20 Aug 2022 14:06:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 7B39084E93 for ; Sat, 20 Aug 2022 14:06:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id cZWeyRXrEDQZ for ; Sat, 20 Aug 2022 14:06:21 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 150A584CFF for ; Sat, 20 Aug 2022 14:06:21 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 12760FB1A; Sat, 20 Aug 2022 14:06:21 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sat, 20 Aug 2022 14:06:21 +0000 From: "Taylor R Campbell" Subject: CVS commit: src/sys/dev/usb To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20220820140621.12760FB1A@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Taylor R Campbell" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: riastradh Date: Sat Aug 20 14:06:21 UTC 2022 Modified Files: src/sys/dev/usb: usbnet.c Log Message: usbnet(9): Split unp_stopping into stopped/txstopped/rxstopped. In practical terms this could be done with one variable and an atomic store, but serializing all access with a lock makes reasoning easier, and the locks have to be taken by the logic that queries the variables anyway, and the variables are set only under heavy-weight configuration changes anyway. What this accomplishes is disentangling lock order between rxlock and txlock: they are never taken at the same time, so no order is needed. I renamed unp_stopping to unp_stopped for a compiler-assisted audit to make sure I reviewed every case of it. To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sys/dev/usb/usbnet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.