From owner-freebsd-bugs@freebsd.org Thu Aug 6 14:33:10 2020 Return-Path: Delivered-To: freebsd-bugs@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 E8D353A3BFD for ; Thu, 6 Aug 2020 14:33:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4BMrZG4CF3z4BxB for ; Thu, 6 Aug 2020 14:33:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 8E6F83A3BFC; Thu, 6 Aug 2020 14:33:10 +0000 (UTC) Delivered-To: bugs@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 8D2E63A3C6F for ; Thu, 6 Aug 2020 14:33:10 +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) 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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMrZG36Gsz4C0d for ; Thu, 6 Aug 2020 14:33:10 +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.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 3599D85C6 for ; Thu, 6 Aug 2020 14:33:10 +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 076EXABR020349 for ; Thu, 6 Aug 2020 14:33:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 076EXAoF020348 for bugs@FreeBSD.org; Thu, 6 Aug 2020 14:33:10 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: bugs@FreeBSD.org Subject: [Bug 248500] cam_sim_free() sleeping forever Date: Thu, 06 Aug 2020 14:33:09 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: cam X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bz@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter cc Message-ID: 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-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2020 14:33:11 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248500 Bug ID: 248500 Summary: cam_sim_free() sleeping forever Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Keywords: cam Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: bz@FreeBSD.org CC: bsdimp@FreeBSD.org Hi, I have a system with a locked USB because cam_sim_free() seems to sleep for= ever (at least 24 hours by now): # procstat -akk | grep -i usb 15 100045 usb usbus0 mi_switch+0xc1 _cv_wait+0xf2 usb_process+0x101 fork_exit+0x7e fork_trampoline+0xe 15 100046 usb usbus0 mi_switch+0xc1 _cv_wait+0xf2 usb_process+0x101 fork_exit+0x7e fork_trampoline+0xe 15 100047 usb usbus0 mi_switch+0xc1 _cv_wait+0xf2 usb_process+0x101 fork_exit+0x7e fork_trampoline+0xe 15 100048 usb usbus0 mi_switch+0xc1 _sleep+0x1cb cam_sim_free+0x7e umass_detach+0xd8 device_detach+0x185 device_delete_child+0x15 usb_detach_device+0x18f usb_unconfigure+0x2b usb_free_device+0x 11d uhub_explore+0x2ad usb_bus_explore+0x13e usb_process+0x13b fork_exit+0x= 7e fork_trampoline+0xe 15 100049 usb usbus0 mi_switch+0xc1 _cv_wait+0xf2 usb_process+0x101 fork_exit+0x7e fork_trampoline+0xe 0x2be is in cam_sim_free (/usr/src/head.svn/sys/cam/cam_sim.c:142). 137 if (sim->refcount > 0) { 138 error =3D msleep(sim, mtx, PRIBIO, "simfree", 0); 139 KASSERT(error =3D=3D 0, ("invalid error value for msleep(9)")); 140 } 141 KASSERT(sim->refcount =3D=3D 0, ("sim->refcount =3D=3D 0")); 142 if (sim->mtx =3D=3D NULL) 143 mtx_unlock(mtx); 144 145 if (free_devq) 146 cam_simq_free(sim->devq); What should wake us up in this case? Was there a race somewhere? Any idea= s? --=20 You are receiving this mail because: You are the assignee for the bug.=