From nobody Fri Sep 23 21:43:40 2022 X-Original-To: current@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 4MZ5J765ZDz4d1mM; Fri, 23 Sep 2022 21:43:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4MZ5J64gZzz3dqF; Fri, 23 Sep 2022 21:43:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.155] (unknown [178.232.223.95]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 36B44260BD2; Fri, 23 Sep 2022 23:43:43 +0200 (CEST) Message-ID: <0668f473-f6d3-eacf-e4ef-f8530563daed@selasky.org> Date: Fri, 23 Sep 2022 23:43:40 +0200 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: usbhid panic when switching vt-s (invariants+witness enabled) To: Andriy Gapon , freebsd-stable List Cc: FreeBSD Current , Vladimir Kondratyev References: Content-Language: en-US From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MZ5J64gZzz3dqF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.997]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_ALL(0.00)[]; MLMMJ_DEST(0.00)[current@FreeBSD.org,stable@FreeBSD.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_NA(0.00)[selasky.org]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 9/23/22 23:33, Andriy Gapon wrote: > > It seems that the problem may be related to different keyboard LED > states between the VTs.  The system is a fresh stable/13.  The panic > looks like an attempt to sleep while in an interrupt thread (a callout?). > Hi, I suspect vt_switch_timer must have a task to handle those requests, which allows sleeping. Vladimir, will you handle this? It is a minor regression issue when using the new usbhid feature. --HPS > panic: sleepq_add: td 0xfffff80006af0000 to sleep on wchan > 0xfffff802ea752e08 with sleeping prohibited > cpuid = 5 > time = 1663940484 > KDB: stack backtrace: > db_trace_self_wrapper() at 0xffffffff8061555b = > db_trace_self_wrapper+0x2b/frame 0xfffffe003590e7f0 > kdb_backtrace() at 0xffffffff80942637 = kdb_backtrace+0x37/frame > 0xfffffe003590e8a0 > vpanic() at 0xffffffff808f4c84 = vpanic+0x184/frame 0xfffffe003590e900 > panic() at 0xffffffff808f4a33 = panic+0x43/frame 0xfffffe003590e960 > sleepq_add() at 0xffffffff809521ab = sleepq_add+0x37b/frame > 0xfffffe003590e9b0 > _sleep() at 0xffffffff80902118 = _sleep+0x238/frame 0xfffffe003590ea40 > usbhid_sync_xfer() at 0xffffffff8532e071 = usbhid_sync_xfer+0x171/frame > 0xfffffe003590eaa0 > usbhid_set_report() at 0xffffffff8532db26 = usbhid_set_report+0x96/frame > 0xfffffe003590eae0 > hid_set_report() at 0xffffffff80686caa = hid_set_report+0x6a/frame > 0xfffffe003590eb20 > hidbus_write() at 0xffffffff85335a7c = hidbus_write+0x5c/frame > 0xfffffe003590eb50 > hid_write() at 0xffffffff80686b98 = hid_write+0x58/frame 0xfffffe003590eb80 > hkbd_set_leds() at 0xffffffff85c1cfe6 = hkbd_set_leds+0x206/frame > 0xfffffe003590ebc0 > hkbd_ioctl_locked() at 0xffffffff85c1cd6b = > hkbd_ioctl_locked+0x33b/frame 0xfffffe003590ec20 > hkbd_ioctl_locked() at 0xffffffff85c1caff = hkbd_ioctl_locked+0xcf/frame > 0xfffffe003590ec80 > hkbd_ioctl() at 0xffffffff85c1ba5a = hkbd_ioctl+0xba/frame > 0xfffffe003590ecc0 > kbdmux_ioctl() at 0xffffffff80695d3b = kbdmux_ioctl+0x12b/frame > 0xfffffe003590ed00 > vt_window_switch() at 0xffffffff8079d969 = vt_window_switch+0x229/frame > 0xfffffe003590ed40 > vt_switch_timer() at 0xffffffff807a15a1 = vt_switch_timer+0x21/frame > 0xfffffe003590ed60 > softclock_call_cc() at 0xffffffff809127c4 = > softclock_call_cc+0x244/frame 0xfffffe003590ee20 > softclock() at 0xffffffff80912c1c = softclock+0x7c/frame 0xfffffe003590ee50 > ithread_loop() at 0xffffffff808b662a = ithread_loop+0x2da/frame > 0xfffffe003590eef0 > fork_exit() at 0xffffffff808b2f85 = fork_exit+0xc5/frame 0xfffffe003590ef30 > fork_trampoline() at 0xffffffff80c084fe = fork_trampoline+0xe/frame > 0xfffffe003590ef30 > >