From nobody Mon Nov 14 13:20:35 2022 X-Original-To: freebsd-usb@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 4N9qgb5FSBz4h6lV for ; Mon, 14 Nov 2022 13:20:43 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 4N9qgb2sS7z3pRd for ; Mon, 14 Nov 2022 13:20:43 +0000 (UTC) (envelope-from hps@selasky.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.69] (unknown [84.210.222.10]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A806426019B; Mon, 14 Nov 2022 14:20:38 +0100 (CET) Message-ID: <422b580a-007c-883d-ea9f-88d57101a172@selasky.org> Date: Mon, 14 Nov 2022 14:20:35 +0100 List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: USB SX lock hang with mass storage device Content-Language: en-US To: Daniel O'Connor , freebsd-usb@freebsd.org, Warner Losh References: From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4N9qgb2sS7z3pRd X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 11/14/22 13:10, Daniel O'Connor wrote: > Hi, > I have a USB 3 HD dock I use to backup a ZFS system (with zrepl) and mostly works pretty well, however I have repeatedly had it stuck and then usbconfig hangs (I can kill it). > Pressing ctrl-t shows: > load: 15.02 cmd: usbconfig 39354 [USB config SX lock] 116.44r 0.00u 0.00s 0% 2712k > mi_switch+0xc2 sleepq_catch_signals+0x2e6 sleepq_wait_sig+0x9 _sx_xlock_hard+0x454 usbd_enum_lock_sig+0xa1 usb_ref_device+0x221 usb_open+0x100 devfs_open+0x146 VOP_OPEN_APV+0x1c vn_open_vnode+0x1b2 vn_open_cred+0x655 kern_openat+0x283 amd64_syscall+0x10c fast_syscall_common+0xf8 > > If I run procstat -a -k I can see the usbconfig: > And usbconfig: > 39354 118526 usbconfig - mi_switch sleepq_catch_signals sleepq_wait_sig _sx_xlock_hard usbd_enum_lock_sig usb_ref_device usb_open devfs_open VOP_OPEN_APV vn_open_vnode vn_open_cred kern_openat amd64_syscall fast_syscall_common > > The other usb related processes look very similar to: > 15 100468 usb usbus0 mi_switch _cv_wait usb_process fork_exit fork_trampoline > > And a thread stuck waiting to free a SIM: > PID TID COMM TDNAME KSTACK > 15 100471 usb usbus0 mi_switch _sleep cam_sim_free umass_detach device_detach device_delete_child usb_detach_device usb_unconfigure usb_free_device uhub_detach device_detach device_delete_child usb_detach_device usb_unconfigure usbd_set_config_index usb_bus_suspend usb_bus_reset usb_process > > Which I presume is the cam_sim_free in umass_cam_detach_sim. Not sure if some more wisdom could be obtained via dtrace script or the like but I am open to suggestions :) > > It is currently running FreeBSD 13.1-RELEASE and it is a Supermicro AMD system (H12SSL-I). > > I can't easily update to -current but I can definitely try patches. > > Thanks. > > -- > Daniel O'Connor > "The nice thing about standards is that there > are so many of them to choose from." > -- Andrew Tanenbaum > > CC'ing Warner. Usually this is not a USB problem. --HPS