From owner-freebsd-usb@FreeBSD.ORG Sun Dec 28 18:20:11 2014 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FB7C9CB for ; Sun, 28 Dec 2014 18:20:11 +0000 (UTC) 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 mx1.freebsd.org (Postfix) with ESMTPS id 6696B28DB for ; Sun, 28 Dec 2014 18:20:11 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id sBSIKBUu012473 for ; Sun, 28 Dec 2014 18:20:11 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 196332] New: [usb] Intenso External USB 3.0 not recognized on hotplug Date: Sun, 28 Dec 2014 18:20:11 +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.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: la5lbtyi@aon.at X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- 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: 7bit 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.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2014 18:20:11 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196332 Bug ID: 196332 Summary: [usb] Intenso External USB 3.0 not recognized on hotplug Product: Base System Version: 10.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: usb Assignee: freebsd-usb@FreeBSD.org Reporter: la5lbtyi@aon.at Scenario: - running FreeBSD 10.1 release on amd64 on a Lenovo W520 - trying to hotplug an Intenso External USB 3.0 drive to the USB 3.0 port - the USB controller is recognized as ("grep -i xhci /var/run/dmesg.boot") xhci0: mem 0xd4100000-0xd4101fff irq 18 at device 0.0 on pci14 xhci0: 32 byte context size. usbus1 on xhci0 uhub2: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1 - pciconf -lv yields xhci0@pci0:14:0:0: class=0x0c0330 card=0x21cf17aa chip=0x01941033 rev=0x04 hdr=0x00 vendor = 'NEC Corporation' device = 'uPD720200 USB 3.0 Host Controller' class = serial bus subclass = USB - the Intenso drive is described as # usbconfig -d ugen1.2 dump_device_desc ugen1.2: at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (2mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0300 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0009 idVendor = 0x152d idProduct = 0x0539 bcdDevice = 0x0205 iManufacturer = 0x000a iProduct = 0x000b iSerialNumber = 0x0003 <20120103070B> bNumConfigurations = 0x0001 Result: - Most of the time, the drive is not recognized at all when hotplugging - Very seldom, it is just recognized with the message ugen1.2: at usbus1 but not further recognized as being a umass device - If it is recognized at all, it may negotiate USB 2.0 mode although being connected to the 3.0 port Expected result: - Hotplugging of the drive should work :-) Notes: - This (hotplugging) worked better (about 60% of the time) in FreeBSD 9.2; maybe about 30% negotiating USB 3.0 and 30% USB 2.0; in about 40% of the cases the XHCI port just seemed to get stuck. - If I plug the drive in before booting FreeBSD, it is correctly negotiated by the BIOS and is then always recognized by FreeBSD 10.1 as follows: ugen1.2: at usbus1 umass0: on usbus1 (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10 00 00 (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error (probe0:umass-sim0:0:0:0): SCSI status: Check Condition (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable error da0 at umass-sim0 bus 0 scbus4 target 0 lun 0 da0: Fixed Direct Access SCSI-6 device da0: Serial Number 20120103070B da0: 400.000MB/s transfers da0: 2861588MB (732566528 4096 byte sectors: 255H 63S/T 45600C) da0: quirks=0x2 - In general, the drive takes a rather long time to spin up when plugged in Questions: - Is there a way to force renegotiation after the drive has already been plugged in? - In FreeBSD 9.2, whenever I had a USB 2.0 device first plugged into the 3.0 port and afterwards the Intenso drive, it would always negotiate as 2.0. There seemed to be some "memory" of the previous device. In FreeBSD 10.1 this can't be reproduced as the Intenso won't be recognized at all, but if hotplugging worked, would this not happen any more? -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-usb@FreeBSD.ORG Mon Dec 29 20:04:19 2014 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED713C10 for ; Mon, 29 Dec 2014 20:04:19 +0000 (UTC) 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 mx1.freebsd.org (Postfix) with ESMTPS id D531235FD for ; Mon, 29 Dec 2014 20:04:19 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id sBTK4JOc092731 for ; Mon, 29 Dec 2014 20:04:19 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 196362] New: [u3g] [patch] add dlink dwm-157 support to u3g Date: Mon, 29 Dec 2014 20:04:19 +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: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: max.n.boyarov@gmail.com X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- 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 attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 20:04:20 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196362 Bug ID: 196362 Summary: [u3g] [patch] add dlink dwm-157 support to u3g Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: usb Assignee: freebsd-usb@FreeBSD.org Reporter: max.n.boyarov@gmail.com Created attachment 151086 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=151086&action=edit add dwm 157 device id to u3g Add support for D-Link DWM-157 to u3g -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-usb@FreeBSD.ORG Mon Dec 29 18:25:17 2014 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E0FBEBC for ; Mon, 29 Dec 2014 18:25:17 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1.freebsd.org (Postfix) with ESMTP id 5508E15CC for ; Mon, 29 Dec 2014 18:25:16 +0000 (UTC) Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 1DBF1EFED06 for ; Mon, 29 Dec 2014 10:25:16 -0800 (PST) Date: Mon, 29 Dec 2014 11:25:15 -0700 (MST) From: kott To: freebsd-usb@freebsd.org Message-ID: <1419877515606-5976832.post@n5.nabble.com> In-Reply-To: <549BF430.8000207@selasky.org> References: <1419359192795-5975583.post@n5.nabble.com> <5499E734.1070507@selasky.org> <1419392511197-5975691.post@n5.nabble.com> <549A811D.3060204@selasky.org> <1419416870924-5975752.post@n5.nabble.com> <1419423740820-5975763.post@n5.nabble.com> <549AB711.8070005@selasky.org> <1419431704871-5975773.post@n5.nabble.com> <549BF430.8000207@selasky.org> Subject: Re: usb_pc_cpu_flush MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 29 Dec 2014 20:18:57 +0000 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2014 18:25:17 -0000 Will check with cache disabled. this may be the problem -- View this message in context: http://freebsd.1045724.n5.nabble.com/usb-pc-cpu-flush-tp5975583p5976832.html Sent from the freebsd-usb mailing list archive at Nabble.com. From owner-freebsd-usb@FreeBSD.ORG Tue Dec 30 09:21:41 2014 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3442CB47 for ; Tue, 30 Dec 2014 09:21:41 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82CC1F11 for ; Tue, 30 Dec 2014 09:21:40 +0000 (UTC) Received: from laptop015.home.selasky.org (31.89-11-148.nextgentel.com [89.11.148.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7008F1FE022; Tue, 30 Dec 2014 10:21:38 +0100 (CET) Message-ID: <54A26ECE.6040603@selasky.org> Date: Tue, 30 Dec 2014 10:22:22 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Kohji Okuno Subject: Re: About XHCI_TD_PAGE_SIZE. References: <549541BC.6070505@selasky.org> <20141222.103833.2105768702793613386.okuno.kohji@jp.panasonic.com> <5497E016.7020809@selasky.org> <20141222.183157.253796126986510571.okuno.kohji@jp.panasonic.com> In-Reply-To: <20141222.183157.253796126986510571.okuno.kohji@jp.panasonic.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2014 09:21:41 -0000 Hi Kohji! Here you go: https://svnweb.freebsd.org/changeset/base/276407 Please verify! --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Jan 3 23:02:57 2015 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D22609BF for ; Sat, 3 Jan 2015 23:02:57 +0000 (UTC) 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 mx1.freebsd.org (Postfix) with ESMTPS id 9FAC12FC6 for ; Sat, 3 Jan 2015 23:02:57 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t03N2vRg050550 for ; Sat, 3 Jan 2015 23:02:57 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 196471] segmentation fault in libusb usage Date: Sat, 03 Jan 2015 23:02:57 +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.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markus.heinz@uni-dortmund.de X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- 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 attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 23:02:57 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196471 Bug ID: 196471 Summary: segmentation fault in libusb usage Product: Base System Version: 10.1-STABLE Hardware: i386 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: usb Assignee: freebsd-usb@FreeBSD.org Reporter: markus.heinz@uni-dortmund.de Created attachment 151308 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=151308&action=edit testcase for libusb segmentation fault I have encountered a segmentation fault when using libusb on an i386 FreeBSD 10.1 system with the latest patches applied: Steps to reproduce: - get a pointer libusb_device *device - use it in some way - close it - reopen it - claim an interface of the device handle - then it crashes with a segmentation fault Debugging the libusb_claim_interface method led to this observation: I am referring to this source code: http://svnweb.freebsd.org/base/stable/10/lib/libusb/libusb10.c?view=markup#l611 In line 615 the libusb_device * is calculated from the given libusb_device_handle *. The device does contain a NULL pointer as dev->ctx. This null pointer is passed to CTX_LOCK in line 622. Then the segmentation fault occurs. If this line is inserted before line 622 the segmentation fault does not occur: dev->ctx = GET_CONTEXT(dev->ctx); But I am not sure if this is the right way to address the problem. I have created a testcase which I will attach. You need to replace the manufacturer and product ids with some values for a connected usb device. The values in the example are for a HP Deskjet 5550 printer. The same testcase works as expected on an Ubuntu 14.04 system with libusbx 1.0.17. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-usb@FreeBSD.ORG Sat Jan 3 23:34:20 2015 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58E7A292 for ; Sat, 3 Jan 2015 23:34:20 +0000 (UTC) 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 mx1.freebsd.org (Postfix) with ESMTPS id 40573663D0 for ; Sat, 3 Jan 2015 23:34:20 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t03NYKhP041076 for ; Sat, 3 Jan 2015 23:34:20 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 196471] segmentation fault in libusb usage Date: Sat, 03 Jan 2015 23:34:20 +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.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: hselasky@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 23:34:20 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196471 Hans Petter Selasky changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |In Progress CC| |hselasky@FreeBSD.org --- Comment #1 from Hans Petter Selasky --- Hi, You are accessing freed memory. If you want the "device" to stay around after "libusb_close()" please use "libusb_ref_device()" to get an extra reference on it. --HPS -- You are receiving this mail because: You are the assignee for the bug.