From owner-freebsd-usb@freebsd.org Sun Sep 23 21:00:32 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DEF21097BE7 for ; Sun, 23 Sep 2018 21:00:32 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 10B438280D for ; Sun, 23 Sep 2018 21:00:32 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id C775A1097BE3; Sun, 23 Sep 2018 21:00:31 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B64211097BE2 for ; Sun, 23 Sep 2018 21:00:31 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D20882808 for ; Sun, 23 Sep 2018 21:00:31 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id A91081C736 for ; Sun, 23 Sep 2018 21:00:30 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8NL0U7L018715 for ; Sun, 23 Sep 2018 21:00:30 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8NL0U0W018711 for usb@FreeBSD.org; Sun, 23 Sep 2018 21:00:30 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201809232100.w8NL0U0W018711@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: usb@FreeBSD.org Subject: Problem reports for usb@FreeBSD.org that need special attention Date: Sun, 23 Sep 2018 21:00:30 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2018 21:00:32 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 213877 | xhci reset causes panic on SuperMicro A1SRi-2758F 1 problems total for which you should take action. From owner-freebsd-usb@freebsd.org Wed Sep 26 15:44:29 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1BA10B0298 for ; Wed, 26 Sep 2018 15:44:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6A1B382E5F for ; Wed, 26 Sep 2018 15:44:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 2EBB210B0295; Wed, 26 Sep 2018 15:44:28 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC4C10B0294 for ; Wed, 26 Sep 2018 15:44:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A280082E5C for ; Wed, 26 Sep 2018 15:44:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id EF9601CB7E for ; Wed, 26 Sep 2018 15:44:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8QFiQY6064710 for ; Wed, 26 Sep 2018 15:44:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8QFiQU1064709 for usb@FreeBSD.org; Wed, 26 Sep 2018 15:44:26 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: usb@FreeBSD.org Subject: [Bug 231742] libusb_handle_events_completed() does not return after a transfer is cancelled Date: Wed, 26 Sep 2018 15:44:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ludovic.rousseau+freebsd@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter 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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2018 15:44:29 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231742 Bug ID: 231742 Summary: libusb_handle_events_completed() does not return after a transfer is cancelled Product: Base System Version: 10.4-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: usb Assignee: usb@FreeBSD.org Reporter: ludovic.rousseau+freebsd@gmail.com Hello, This bug may be related to Bug #231076. This time I use 2 USB devices instead of 1. When my program exits it stops every USB transfers. I use interrupts transf= ers with a long timeout to read card events. So with 2 readers I have 2 such USB interrupt transfers. The first transfer is cancelled fine and I can close the reader connection. The second transfer is also cancelled with no error but libusb_handle_events_completed() does NOT return and my program is blocked. Here is a log trace when 1 reader is used: ^CLIBUSB_FUNCTION: libusb_handle_events_locked leave 01528296 [679490304] pcscdaemon.c:193:signal_thread() Received signal: 2 00000011 [679490304] pcscdaemon.c:226:signal_thread() Preparing for suicide LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit 00000012 [683937920] ccid_usb.c:1333:InterruptRead() ret: -10 00000007 [683937920] ccid_usb.c:1336:InterruptRead()=20 00000005 [683937920] ccid_usb.c:1331:InterruptRead()=20 LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb10_handle_events_sub enter 01658982 [679490944] hotplug_libusb.c:403:HPRescanUsbBus() Hotplug stopped 00010624 [679489664] readerfactory.c:1353:RFCleanupReaders() entering clean= ing function 00000008 [679489664] readerfactory.c:1362:RFCleanupReaders() Stopping reade= r: Inside Secure AT90SCR200 00 00 00000005 [679489664] readerfactory.c:610:RFRemoveReader() UnrefReader() cou= nt was: 1 00000003 [679489664] eventhandler.c:175:EHDestroyEventHandler() Stomping thread. 00000004 [679489664] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB1, usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) 00000004 [679489664] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB2, usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) 00000004 [679489664] eventhandler.c:200:EHDestroyEventHandler() Request stopping of polling thread 00000004 [679489664] ifdhandler.c:346:IFDHStopPolling() usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) LIBUSB_FUNCTION: libusb_cancel_transfer enter libusb10.c:1556 LIBUSB_FUNCTION: libusb_cancel_transfer leave retval: 0 LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit 00000809 [683937920] ccid_usb.c:1333:InterruptRead() ret: 0 00000005 [683937920] ccid_usb.c:1355:InterruptRead()=20 00000004 [683937920] ccid_usb.c:1362:InterruptRead() after (0) (3) 00000004 [683937920] ccid_usb.c:1377:InterruptRead() InterruptRead (0/2): 3 00425691 [683937920] eventhandler.c:504:EHStatusHandlerThread() Die 00000030 [679489664] eventhandler.c:215:EHDestroyEventHandler() Thread stom= ped. 00000007 [679489664] readerfactory.c:1126:RFUnInitializeReader() Attempting shutdown of Inside Secure AT90SCR200 00 00. 00000006 [679489664] ifdhandler.c:284:IFDHCloseChannel() usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) 00000006 [679489664] -> 000000 63 00 00 00 00 00 09 00 00 00=20 LIBUSB_FUNCTION: libusb_bulk_transfer enter LIBUSB_FUNCTION: libusb_submit_transfer enter LIBUSB_FUNCTION: libusb_submit_transfer leave 0 LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb10_handle_events_sub enter LIBUSB_TRANSFER: sync I/O done LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit LIBUSB_FUNCTION: libusb_bulk_transfer leave LIBUSB_FUNCTION: libusb_bulk_transfer enter LIBUSB_FUNCTION: libusb_submit_transfer enter LIBUSB_FUNCTION: libusb_submit_transfer leave 0 LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb10_handle_events_sub enter LIBUSB_TRANSFER: sync I/O done LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit LIBUSB_FUNCTION: libusb_bulk_transfer leave 00000310 [679489664] <- 000000 81 00 00 00 00 00 09 01 00 00=20 00000004 [679489664] ccid_usb.c:942:CloseUSB() Closing USB device: 0/2 00000003 [679489664] ccid_usb.c:952:CloseUSB() Last slot closed. Release resources 00008782 [679489664] ccid_usb.c:189:close_libusb_if_needed() libusb_exit 00000016 [679489664] readerfactory.c:987:RFUnloadReader() Unloading reader driver. 00000027 [679489664] winscard_svc.c:155:ContextsDeinitialize() remaining threads: 0 00000005 [679489664] pcscdaemon.c:785:at_exit() cleaning /var/run/pcscd Now a trace when 2 readers are used: ^C02182975 [679490304] pcscdaemon.c:193:signal_thread() Received signal: 2 00000011 [679490304] pcscdaemon.c:226:signal_thread() Preparing for suicide 00971124 [679490944] hotplug_libusb.c:403:HPRescanUsbBus() Hotplug stopped 00933563 [679489664] readerfactory.c:1353:RFCleanupReaders() entering clean= ing function 00000008 [679489664] readerfactory.c:1362:RFCleanupReaders() Stopping reade= r: Inside Secure AT90SCR200 00 00 00000005 [679489664] readerfactory.c:610:RFRemoveReader() UnrefReader() cou= nt was: 1 00000004 [679489664] eventhandler.c:175:EHDestroyEventHandler() Stomping thread. 00000004 [679489664] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB1, usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) 00000004 [679489664] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB2, usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) 00000003 [679489664] eventhandler.c:200:EHDestroyEventHandler() Request stopping of polling thread 00000004 [679489664] ifdhandler.c:346:IFDHStopPolling() usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) LIBUSB_FUNCTION: libusb_cancel_transfer enter libusb10.c:1556 LIBUSB_FUNCTION: libusb_cancel_transfer leave retval: 0 LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit 00000817 [683937920] ccid_usb.c:1333:InterruptRead() ret: 0 00000006 [683937920] ccid_usb.c:1355:InterruptRead()=20 00000005 [683937920] ccid_usb.c:1362:InterruptRead() after (0) (3) 00000005 [683937920] ccid_usb.c:1377:InterruptRead() InterruptRead (0/2): 3 LIBUSB_FUNCTION: libusb_wait_for_event ERROR tv LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb_wait_for_event enter 00425967 [683937920] eventhandler.c:504:EHStatusHandlerThread() Die 00000037 [679489664] eventhandler.c:215:EHDestroyEventHandler() Thread stom= ped. 00000007 [679489664] readerfactory.c:1126:RFUnInitializeReader() Attempting shutdown of Inside Secure AT90SCR200 00 00. 00000008 [679489664] ifdhandler.c:284:IFDHCloseChannel() usb:2406/6407:libusb-1.0:0:2:0 (lun: 0) 00000006 [679489664] -> 000000 63 00 00 00 00 00 09 00 00 00=20 LIBUSB_FUNCTION: libusb_bulk_transfer enter LIBUSB_FUNCTION: libusb_submit_transfer enter LIBUSB_FUNCTION: libusb_submit_transfer leave 0 LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb10_handle_events_sub enter LIBUSB_TRANSFER: sync I/O done LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit LIBUSB_FUNCTION: libusb_bulk_transfer leave LIBUSB_FUNCTION: libusb_bulk_transfer enter LIBUSB_FUNCTION: libusb_submit_transfer enter LIBUSB_FUNCTION: libusb_wait_for_event ERROR tv LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb_wait_for_event enter LIBUSB_FUNCTION: libusb_submit_transfer leave 0 LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb10_handle_events_sub enter LIBUSB_TRANSFER: sync I/O done LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit LIBUSB_FUNCTION: libusb_bulk_transfer leave LIBUSB_FUNCTION: libusb_wait_for_event ERROR tv LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb_wait_for_event enter 00000325 [679489664] <- 000000 81 00 00 00 00 00 09 01 00 00=20 00000014 [679489664] ccid_usb.c:942:CloseUSB() Closing USB device: 0/2 00000003 [679489664] ccid_usb.c:952:CloseUSB() Last slot closed. Release resources 00008720 [679489664] readerfactory.c:1362:RFCleanupReaders() Stopping reade= r: SMSC USX101x Reader (EF149371) 01 00 00000006 [679489664] readerfactory.c:610:RFRemoveReader() UnrefReader() cou= nt was: 1 00000003 [679489664] eventhandler.c:175:EHDestroyEventHandler() Stomping thread. 00000004 [679489664] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB1, usb:0424/1100:libusb-1.0:0:3:0 (lun: 10000) 00000004 [679489664] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB2, usb:0424/1100:libusb-1.0:0:3:0 (lun: 10000) 00000004 [679489664] eventhandler.c:200:EHDestroyEventHandler() Request stopping of polling thread 00000004 [679489664] ifdhandler.c:346:IFDHStopPolling() usb:0424/1100:libusb-1.0:0:3:0 (lun: 10000) LIBUSB_FUNCTION: libusb_cancel_transfer enter libusb10.c:1556 LIBUSB_FUNCTION: libusb_cancel_transfer leave retval: 0 I modified libUSB to add some more debug. The 2 traces are identical except for this sequence: LIBUSB_FUNCTION: libusb_wait_for_event ERROR tv LIBUSB_FUNCTION: libusb_handle_events_locked leave LIBUSB_FUNCTION: libusb_handle_events_locked enter LIBUSB_FUNCTION: libusb_wait_for_event enter libusb_wait_for_event() returns because it is in the case "tv =3D=3D NULL" = at https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10_io.c#L312 The sequence is present 3 times in the case of 2 USB devices. it looks like libusb_cancel_transfer() has (also) an impact to another transfer. I use the same libUSB context for the 2 devices and all the USB transfers. I added logs in libusb_cancel_transfer(). For the 2 transfers that I cancel= the program goes into the case /* make sure the queue doesn't stall */ at line = 1544 https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10.c#L1544 I always get this problem when I quit my program with 2 USB devices. So it = is easy to reproduce. Thanks --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Thu Sep 27 08:55:17 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1664E10A687F for ; Thu, 27 Sep 2018 08:55:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id A465F7C47B for ; Thu, 27 Sep 2018 08:55:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 6974B10A687B; Thu, 27 Sep 2018 08:55:16 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 580A310A687A for ; Thu, 27 Sep 2018 08:55:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECD467C479 for ; Thu, 27 Sep 2018 08:55:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 46E9325A52 for ; Thu, 27 Sep 2018 08:55:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8R8tF7n021972 for ; Thu, 27 Sep 2018 08:55:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8R8tFLn021971 for usb@FreeBSD.org; Thu, 27 Sep 2018 08:55:15 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: usb@FreeBSD.org Subject: [Bug 231742] libusb_handle_events_completed() does not return after a transfer is cancelled Date: Thu, 27 Sep 2018 08:55:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: hselasky@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 08:55:17 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231742 Hans Petter Selasky changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hselasky@FreeBSD.org --- Comment #1 from Hans Petter Selasky --- Do you have multiple threads waiting for events on the same context when th= ere are two devices present? --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Thu Sep 27 08:55:23 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9264910A689F for ; Thu, 27 Sep 2018 08:55:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 2F5867C482 for ; Thu, 27 Sep 2018 08:55:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id E88F510A689D; Thu, 27 Sep 2018 08:55:22 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D734110A689C for ; Thu, 27 Sep 2018 08:55:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 789E17C480 for ; Thu, 27 Sep 2018 08:55:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id C714125A56 for ; Thu, 27 Sep 2018 08:55:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8R8tLPx022089 for ; Thu, 27 Sep 2018 08:55:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8R8tLIf022088 for usb@FreeBSD.org; Thu, 27 Sep 2018 08:55:21 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: usb@FreeBSD.org Subject: [Bug 231742] libusb_handle_events_completed() does not return after a transfer is cancelled Date: Thu, 27 Sep 2018 08:55:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: hselasky@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status 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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 08:55:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231742 Hans Petter Selasky changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |In Progress --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Thu Sep 27 08:55:31 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE10C10A68D6 for ; Thu, 27 Sep 2018 08:55:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC127C4AA for ; Thu, 27 Sep 2018 08:55:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 3011210A68D1; Thu, 27 Sep 2018 08:55:31 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EF1B10A68D0 for ; Thu, 27 Sep 2018 08:55:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B49F67C4A1 for ; Thu, 27 Sep 2018 08:55:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id EB07525A58 for ; Thu, 27 Sep 2018 08:55:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8R8tT1U022216 for ; Thu, 27 Sep 2018 08:55:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8R8tTml022215 for usb@FreeBSD.org; Thu, 27 Sep 2018 08:55:29 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: usb@FreeBSD.org Subject: [Bug 231742] libusb_handle_events_completed() does not return after a transfer is cancelled Date: Thu, 27 Sep 2018 08:55:30 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: hselasky@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: hselasky@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to 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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 08:55:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231742 Hans Petter Selasky changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|usb@FreeBSD.org |hselasky@FreeBSD.org --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Fri Sep 28 13:42:33 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53C4710B128D for ; Fri, 28 Sep 2018 13:42:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E4FD373AB8 for ; Fri, 28 Sep 2018 13:42:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id A67B510B128B; Fri, 28 Sep 2018 13:42:32 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8479B10B128A for ; Fri, 28 Sep 2018 13:42:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2397073AB5 for ; Fri, 28 Sep 2018 13:42:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 570B94E76 for ; Fri, 28 Sep 2018 13:42:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8SDgVAf077089 for ; Fri, 28 Sep 2018 13:42:31 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8SDgV4F077088 for usb@FreeBSD.org; Fri, 28 Sep 2018 13:42:31 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: usb@FreeBSD.org Subject: [Bug 231782] a USB frame from an interrupt endpoint may be missed Date: Fri, 28 Sep 2018 13:42:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ludovic.rousseau+freebsd@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter 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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Sep 2018 13:42:33 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231782 Bug ID: 231782 Summary: a USB frame from an interrupt endpoint may be missed Product: Base System Version: 10.4-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: usb Assignee: usb@FreeBSD.org Reporter: ludovic.rousseau+freebsd@gmail.com Hello, I have another issue. I can reproduce it easily using 1 USB device and 2 threads using the same libUSB context. I know a sequence to always reproduce the problem but I have no idea where = the problem comes from. Maybe it is not in libUSB but in a lower layer. The USB interrupt end point is used to wait for an event from the USB devic= e. In my case then event is a card removal from the smart card reader. In that case 2 bytes are sent on the interrupt end point. I note that in a given condition the event is *never* received by my application. I also see *no* log activity from libUSB. So maybe libUSB does not receive = the USB frame. When this happens I have 1 thread waiting in libusb_handle_events_completed= () (waiting on the interrupt end point) and the other thread is not doing any libUSB activity. The card removal event is not received. But the card insertion event (also 2 bytes sent on the interrupt end point) has no problem and is received by li= bUSB and my program. It looks like in some cases a USB frame is lost. I can send you libUSB logs if you want. But I was not able to find any prob= lem in them. I was also not able to find why in some cases I have the problem a= nd why in other cases my program works fine. Is there an equivalent of the Linux usbmon kernel facility to see all the U= SB activity in FreeBSD? https://www.kernel.org/doc/Documentation/usb/usbmon.txt Thanks --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Fri Sep 28 13:53:58 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7979E10B15CF for ; Fri, 28 Sep 2018 13:53:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 153F87418D for ; Fri, 28 Sep 2018 13:53:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id CAF6710B15CE; Fri, 28 Sep 2018 13:53:57 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B990610B15CD for ; Fri, 28 Sep 2018 13:53:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9D87418C for ; Fri, 28 Sep 2018 13:53:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id A8C804FD6 for ; Fri, 28 Sep 2018 13:53:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8SDrurp097038 for ; Fri, 28 Sep 2018 13:53:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8SDru0m097037 for usb@FreeBSD.org; Fri, 28 Sep 2018 13:53:56 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: usb@FreeBSD.org Subject: [Bug 231782] a USB frame from an interrupt endpoint may be missed Date: Fri, 28 Sep 2018 13:53:56 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: hselasky@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Sep 2018 13:53:58 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231782 Hans Petter Selasky changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hselasky@FreeBSD.org --- Comment #1 from Hans Petter Selasky --- Hi, In FreeBSD there is "usbdump -i usbusX -f Y -s 65536 -vvv" where X.Y are the numbers after ugen. If you are using BULK, unless you clear-halt the endpoint after cancelling,= one packet may get lost due to incorrect data-toggle values at the USB wire lev= el. --HPS --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Sat Sep 29 13:37:18 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4488109EC16 for ; Sat, 29 Sep 2018 13:37:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD4F7B1DF for ; Sat, 29 Sep 2018 13:37:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 3E125109EC15; Sat, 29 Sep 2018 13:37:17 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C1C2109EC13 for ; Sat, 29 Sep 2018 13:37:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1D047B1DC for ; Sat, 29 Sep 2018 13:37:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id EEF6615C88 for ; Sat, 29 Sep 2018 13:37:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8TDbF0V059632 for ; Sat, 29 Sep 2018 13:37:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8TDbFvp059631 for usb@FreeBSD.org; Sat, 29 Sep 2018 13:37:15 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: usb@FreeBSD.org Subject: [Bug 231782] a USB frame from an interrupt endpoint may be missed Date: Sat, 29 Sep 2018 13:37:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ludovic.rousseau+freebsd@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2018 13:37:18 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231782 --- Comment #2 from Ludovic Rousseau -= -- I do not always reproduce the problem. I do not yet know what is needed to = make the problem to happen. After that it is easy to reproduce but sometimes I g= et a normal execution again with no problem. Strange. For this issue I do not use libusb_cancel_transfer(). No transfer is cancel= led here. I used usbdump to dump the USB traffic. I can reproduce the problem even when usbdump is running. Good. When I have the issue *nothing* is logged by usbdump. The USB frame that sh= ould be received is not dumped. And then libUSB does not see it either. I do not have a USB hardware analyser to confirm the USB frame is really travelling on the USB bus. Since I do not have the issue on GNU/Linux and I have the problem on FreeBSD 10.4 with, at least, 3 different models of USB smart card reader I guess the problem is not in the USB devices. The missing frame is something like: 15:01:49.961874 usbus0.2 DONE-INTR-EP=3D00000083,SPD=3DFULL,NFR=3D1,SLEN=3D4,IVAL=3D16,ERR=3D0 frame[0] READ 2 bytes 0000 50 02 -- -- -- -- -- -- -- -- -- -- -- -- -- -- |P. | flags 0x16 status 0xcb821 It looks like the problem is not in libUSB but in a lower layer. It looks like the problem happens more often when using a USB3 port (blue connector) than a USB2 port. I will join the results of lshal for USB related parts. How can I help debug this issue? --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Sat Sep 29 13:39:03 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95BD9109ED81 for ; Sat, 29 Sep 2018 13:39:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 31ECF7B353 for ; Sat, 29 Sep 2018 13:39:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id E85F5109ED80; Sat, 29 Sep 2018 13:39:02 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6FFF109ED7F for ; Sat, 29 Sep 2018 13:39:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 781137B34E for ; Sat, 29 Sep 2018 13:39:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id C730D15C90 for ; Sat, 29 Sep 2018 13:39:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8TDd1BZ061340 for ; Sat, 29 Sep 2018 13:39:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8TDd1v5061339 for usb@FreeBSD.org; Sat, 29 Sep 2018 13:39:01 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: usb@FreeBSD.org Subject: [Bug 231782] a USB frame from an interrupt endpoint may be missed Date: Sat, 29 Sep 2018 13:39:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ludovic.rousseau+freebsd@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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-usb@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2018 13:39:03 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231782 --- Comment #3 from Ludovic Rousseau -= -- Created attachment 197594 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D197594&action= =3Dedit lshal(1) output --=20 You are receiving this mail because: You are the assignee for the bug.=