From owner-freebsd-usb@FreeBSD.ORG Sun May 1 13:08:19 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E387016A4FC; Sun, 1 May 2005 13:08:19 +0000 (GMT) Received: from ms-smtp-02.nyroc.rr.com (ms-smtp-02.nyroc.rr.com [24.24.2.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46DD543D2F; Sun, 1 May 2005 13:08:19 +0000 (GMT) (envelope-from akropel1@rochester.rr.com) Received: from mail.kroptech.com (cpe-24-93-20-125.rochester.res.rr.com [24.93.20.125])j41D8DJj024259; Sun, 1 May 2005 09:08:13 -0400 (EDT) Received: from pia (pia.kroptech.com [192.168.200.3]) by mail.kroptech.com (Postfix) with SMTP id 814DD11376E; Sun, 1 May 2005 09:19:00 -0400 (EDT) Message-ID: <004c01c54e4e$d45baa80$03c8a8c0@kroptech.com> From: "Adam Kropelin" To: "Thierry Thomas" , "Lonnie Mendez" References: <20050427055531.07B7D60FB@gnome.dnsalias.net> <20050430160650.GC95709@graf.pompo.net> Date: Sun, 1 May 2005 09:08:12 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: Symantec AntiVirus Scan Engine cc: FreeBSD-gnats-submit@freebsd.org cc: freebsd-usb@freebsd.org Subject: Re: kern/80383: [PATCH] Add quirk for uhid to ignore certain usbdevices (blacklist) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2005 13:08:20 -0000 Thierry Thomas wrote: >> Le Mer 27 avr 05 à 7:55:31 +0200, Lonnie Mendez >> écrivait : >>> >>>> Number: 80383 >>>> Category: kern >>>> Synopsis: [PATCH] Add quirk for uhid to ignore certain usb >>>> devices (blacklist) >> >>>> Description: >>> >>> This patch allows uhid to leave alone devices that identify >>> themselves as hid based, but are indeed >>> used via another interface. This is very simliar in concept to the >>> hid blacklist table found in hid-core.c in the linux kernel. >> >> Fine! I also need this to use the new MGE UPS devices (with nut, >> libusb and the newhidups driver). I have applied the submitted patch >> on a >> 5.4-STABLE, and it's OK. >> >> To add the MGE UPS devices, I need the attached patches. Just to nitpick a little... > +product MGE UPS1 0x0001 MGEUPS newhidups 1 > +product MGE UPS2 0xffff MGEUPS newhidups 2 I'm not sure it's appropriate in this context to refer to a userspace program like "newhidups". I think this field is really meant to be a textual name for the product being identified. Based on the other entries in the file, something like a model name or generc description may be more appropriate. --Adam From owner-freebsd-usb@FreeBSD.ORG Sun May 1 13:13:00 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4BF116A4CE; Sun, 1 May 2005 13:13:00 +0000 (GMT) Received: from ms-smtp-01.nyroc.rr.com (ms-smtp-01.nyroc.rr.com [24.24.2.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A65C43D2D; Sun, 1 May 2005 13:13:00 +0000 (GMT) (envelope-from akropel1@rochester.rr.com) Received: from mail.kroptech.com (cpe-24-93-20-125.rochester.res.rr.com [24.93.20.125])j41DCuXs017910; Sun, 1 May 2005 09:12:56 -0400 (EDT) Received: from pia (pia.kroptech.com [192.168.200.3]) by mail.kroptech.com (Postfix) with SMTP id BAEE811376E; Sun, 1 May 2005 09:23:43 -0400 (EDT) Message-ID: <006601c54e4f$7d2a3c30$03c8a8c0@kroptech.com> From: "Adam Kropelin" To: "Thierry Thomas" , "Lonnie Mendez" References: <20050427055531.07B7D60FB@gnome.dnsalias.net> <20050430160650.GC95709@graf.pompo.net> Date: Sun, 1 May 2005 09:12:55 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0063_01C54E2D.F60F2650" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: Symantec AntiVirus Scan Engine cc: FreeBSD-gnats-submit@freebsd.org cc: freebsd-usb@freebsd.org Subject: Re: kern/80383: [PATCH] Add quirk for uhid to ignore certain usbdevices (blacklist) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2005 13:13:00 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0063_01C54E2D.F60F2650 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit Thierry Thomas wrote: >> Le Mer 27 avr 05 à 7:55:31 +0200, Lonnie Mendez >> écrivait : >>> >>>> Number: 80383 >>>> Category: kern >>>> Synopsis: [PATCH] Add quirk for uhid to ignore certain usb >>>> devices (blacklist) >> >>>> Description: >>> >>> This patch allows uhid to leave alone devices that identify >>> themselves as hid based, but are indeed >>> used via another interface. This is very simliar in concept to the >>> hid blacklist table found in hid-core.c in the linux kernel. >> >> Fine! I also need this to use the new MGE UPS devices (with nut, >> libusb and the newhidups driver). I have applied the submitted patch >> on a >> 5.4-STABLE, and it's OK. >> >> To add the MGE UPS devices, I need the attached patches. Here are additional patches to add APC UPSes to the quirk table. I've changed the APC UPSPRO500 usbdevs entry to a more generic name and description since APC actually uses that product id for all of its UPS models. There aren't any existing in-tree users, but I'm not sure what affect that change might have on userspace. It can be undone if its likely to create compatibility issues. --Adam ------=_NextPart_000_0063_01C54E2D.F60F2650 Content-Type: application/octet-stream; name="usb-hid-quirk.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="usb-hid-quirk.patch" --- usbdevs Sun May 1 09:11:47 2005=0A= +++ usbdevs.new Sun May 1 09:10:36 2005=0A= @@ -471,7 +471,7 @@=0A= product ALTEC ASC495 0xff05 ASC495 Speakers=0A= =0A= /* American Power Conversion products */=0A= -product APC UPSPRO500 0x0002 Back-UPS Pro 500=0A= +product APC UPS 0x0002 Uninterruptible Power Supply=0A= =0A= /* Anchor products */=0A= product ANCHOR EZUSB 0x2131 EZUSB=0A= --- usb_quirks.c Sun May 1 09:13:12 2005=0A= +++ usb_quirks.c.new Sun May 1 09:13:03 2005=0A= @@ -108,6 +108,8 @@=0A= ANY, { UQ_HID_IGNORE }},=0A= { USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS2,=0A= ANY, { UQ_HID_IGNORE }},=0A= + { USB_VENDOR_APC, USB_PRODUCT_APC_UPS,=0A= + ANY, { UQ_HID_IGNORE }},=0A= { 0, 0, 0, { 0 } }=0A= };=0A= =0A= ------=_NextPart_000_0063_01C54E2D.F60F2650-- From owner-freebsd-usb@FreeBSD.ORG Mon May 2 11:02:01 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5065616A4F5 for ; Mon, 2 May 2005 11:02:01 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CAE443D45 for ; Mon, 2 May 2005 11:02:01 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j42B20Ip030331 for ; Mon, 2 May 2005 11:02:00 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j42B1xhR030317 for freebsd-usb@freebsd.org; Mon, 2 May 2005 11:01:59 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 2 May 2005 11:01:59 GMT Message-Id: <200505021101.j42B1xhR030317@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2005 11:02:01 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2002/07/19] kern/40792 usb signals lead to data loss on device ugen o [2002/12/10] kern/46176 usb umass causes kernel panic if device remov o [2002/12/19] i386/46371 usb USB controller cannot be initialized on I f [2003/02/17] kern/48359 usb SiS 5597/8 USB + uscanner breakage f [2003/03/05] kern/48952 usb uscanner0 hangs o [2003/09/26] bin/57255 usb usbd and multi-function devices f [2003/12/11] kern/60131 usb [usb] Page fault on disconnect of USB dev s [2003/12/15] kern/60276 usb [usb] Kernel panic when plugging in USB ( f [2004/01/11] kern/61191 usb [usb] panic: USB vs. Serial problems o [2004/01/20] kern/61627 usb [usb] [patch] New USB printer not support o [2004/01/24] kern/61841 usb [boot] 5.2 Boot freeze if memorybird (USB f [2004/01/30] kern/62088 usb [usb] Logitech Cordless/Optical Mouse not f [2004/01/30] kern/62123 usb [usb] LaCie 160GB USB drive umass: BBB re f [2004/02/23] i386/63251 usb [usb] USB stops working after 2nd APM sus f [2004/03/01] kern/63621 usb [usb] USB MemoryStick Reader stalls/crash f [2004/04/07] kern/65292 usb [panic] random page faults (usb-related?) o [2004/07/13] kern/69006 usb [patch] Apple Cinema Display hangs USB po o [2004/08/30] kern/71155 usb [usb] misbehaving usb-printer hangs proce o [2004/10/30] kern/73307 usb Kernel panics on USB disconnect f [2004/11/18] kern/74088 usb ohci ehci uhub: port disabled on connecti o [2005/01/13] usb/76204 usb panic while using usb attached modem o [2005/01/18] usb/76395 usb USB printer does not work, usbdevs says " o [2005/01/21] usb/76554 usb Panram "yoyo" USB MP3 player causes panic f [2005/01/25] usb/76684 usb Toshiba PDR-M4 camera connected via USB h f [2005/01/26] usb/76727 usb usb printing locks machine f [2005/01/30] usb/76847 usb ukbd panics on boot o [2005/02/06] usb/77184 usb kernel panic on USB device disconnect o [2005/02/09] usb/77294 usb ucom + ulpcom panic o [2005/02/16] usb/77604 usb Sluggish Logitch LX700 USB Mouse o [2005/03/18] usb/78989 usb please add USB keyboard support to instal o [2005/03/22] usb/79140 usb WD Firewire/USB Combo hangs under load on o [2005/03/27] usb/79287 usb UHCI hang after interrupt transfer o [2005/04/02] usb/79436 usb Panic: ohci_abort_xfer: not in process co o [2005/04/04] usb/79524 usb printing to Minolta PagePro 1[23]xxW via o [2005/04/07] usb/79656 usb [usb] RHSC interrupts lost o [2005/04/09] usb/79722 usb [usb] wrong alignments in ehci.h o [2005/04/17] usb/80040 usb [hang] Use of sound mixer causes system f o [2005/04/22] usb/80260 usb Travan USB tape drive fails to write o [2005/04/26] usb/80361 usb mounting of usb-stick fails o [2005/04/26] usb/80373 usb usb keyboard does not respond 40 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/09/30] conf/30929 usb [patch] use usbd to initialize USB ADSL m o [2001/12/09] kern/32652 usb [patch] A new ioctl to uscanner s [2001/12/09] ports/32653 usb Added patches to improve USB scanner supp f [2002/07/24] kern/40948 usb [usb] USB HP CDW8200 does not work o [2002/08/07] kern/41415 usb [usb] [patch] Some USB scanners cannot ta o [2003/02/16] bin/48342 usb [PATCH] usbd dynamic device list. f [2003/03/19] kern/50110 usb [usb] Astra 2100U scanner being detected o [2003/05/08] kern/51958 usb [usb] [patch] update for urio driver o [2003/05/10] kern/52026 usb [usb] feature request: umass driver suppo f [2003/05/19] bin/52432 usb [sysinstall] drivers.flp won't load with o [2003/06/08] kern/53025 usb [PATCH] ugen does not allow O_NONBLOCK fo f [2003/09/19] kern/56999 usb FreeCom USB CD/RW problem on FreeBSD 5.1 f [2003/11/10] i386/59147 usb [usb] USB active extension cable not reco o [2003/11/11] kern/59169 usb [patch] ulpt is missing read operation o [2003/12/15] kern/60248 usb [patch] Problem with USB printer HP Laser o [2004/01/12] bin/61234 usb [usb] [patch] usbhidaction doesn't suppor f [2004/02/13] kern/62788 usb need quirks for Super Talent Flash USB 2. f [2004/03/04] kern/63779 usb [usb] USB-mass storage (USB to IDE Conver o [2004/03/06] kern/63837 usb [patch] USB: hid_is_collection() only loo o [2004/04/11] kern/65436 usb QUIRK: [patch] to add support for PNY Att o [2004/04/19] kern/65769 usb [usb] Call to tcflush(x, TCIFLUSH) stops f [2004/05/11] kern/66547 usb [usb] Palm Tungsten T USB does not initia o [2004/06/27] kern/68412 usb [usb] [patch] QUIRK: Philips KEY013 USB M o [2004/07/06] i386/68719 usb [usb] USB 2.0 mobil rack+ fat32 performan o [2004/08/16] kern/70523 usb [usb] [patch] umct sending/receiving wron o [2004/08/25] kern/70942 usb [usb] Genius Wireless USB mouse: moused d o [2004/09/06] kern/71416 usb [usb] Cryptoflex e-gate USB token (ugen0) o [2004/09/06] kern/71417 usb [usb] Cryptoflex e-gate USB token (ugen0) o [2004/09/07] kern/71455 usb [usb] Slow USB umass performance of 5.3 o [2004/09/11] kern/71605 usb [usb] [patch] umass doesn't recognize mul o [2004/10/05] kern/72344 usb [usb] [patch] QUIRK: Dane-Elec zMate 512 f [2004/10/06] i386/72380 usb [usb] USB does not work [dual Celeron Abi o [2004/10/23] i386/73056 usb [usb] Sun Microsystems Type 6 USB mouse n f [2004/11/02] i386/73421 usb [usb] USB not recgnized/working on Toshib o [2004/11/30] usb/74557 usb imation 500mb usb key can only be written o [2004/12/12] usb/74989 usb (regression) Lost USB support between 5.2 o [2004/12/28] usb/75578 usb [patch] QUIRK: PNY USB flash key o [2005/01/07] usb/75928 usb Cytronix SmartMedia card (SMC) reader has o [2005/01/19] usb/76461 usb disklabel of umass(4)-CAM(4)-da(4) not us o [2005/01/27] usb/76732 usb Mouse problems with USB KVM Switch f [2005/03/03] usb/78371 usb Philips Wearable Audio Player (128) fails o [2005/03/07] usb/78543 usb [patch] Support for Trip-Lite USB 2 Seria o [2005/03/18] usb/78984 usb Creative MUVO umass failure o [2005/04/09] usb/79723 usb [usb] prepare for high speed isochronous o [2005/04/09] usb/79725 usb [patch] [usb] USB device speed is not dou o [2005/04/16] usb/80010 usb Add support for the AEI USB to LAN adapte o [2005/04/27] usb/80420 usb atapicam stops iPod functionality 47 problems total. From owner-freebsd-usb@FreeBSD.ORG Tue May 3 23:10:09 2005 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9626416A4E7 for ; Tue, 3 May 2005 23:10:09 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A69143D8E for ; Tue, 3 May 2005 23:10:09 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j43NA8Qc077220 for ; Tue, 3 May 2005 23:10:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j43NA8gn077219; Tue, 3 May 2005 23:10:08 GMT (envelope-from gnats) Date: Tue, 3 May 2005 23:10:08 GMT Message-Id: <200505032310.j43NA8gn077219@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Marc Olzheim Subject: Re: usb/80361: mounting of usb-stick fails X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Marc Olzheim List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2005 23:10:09 -0000 The following reply was made to PR usb/80361; it has been noted by GNATS. From: Marc Olzheim To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: mounting of usb-stick fails Date: Wed, 4 May 2005 01:05:31 +0200 On today's stable it works again on my amd64 (with a Kingston DataTraveler Elite). Marc From owner-freebsd-usb@FreeBSD.ORG Wed May 4 06:10:29 2005 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1689B16A4CE for ; Wed, 4 May 2005 06:10:29 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE39B43D77 for ; Wed, 4 May 2005 06:10:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j446A9Ve064892 for ; Wed, 4 May 2005 06:10:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j446A9qZ064796; Wed, 4 May 2005 06:10:09 GMT (envelope-from gnats) Date: Wed, 4 May 2005 06:10:09 GMT Message-Id: <200505040610.j446A9qZ064796@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Fridtjof Busse Subject: Re: usb/80361: mounting of usb-stick fails X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Fridtjof Busse List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2005 06:10:29 -0000 The following reply was made to PR usb/80361; it has been noted by GNATS. From: Fridtjof Busse To: bug-followup@FreeBSD.org, fbusse@gmx.de Cc: Subject: Re: usb/80361: mounting of usb-stick fails Date: Wed, 4 May 2005 08:05:53 +0200 My Dell still fails to mount without the workaround on 5.4-RC4/x86. From owner-freebsd-usb@FreeBSD.ORG Wed May 4 11:13:55 2005 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CE1116A4CE; Wed, 4 May 2005 11:13:55 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4329743D5D; Wed, 4 May 2005 11:13:55 +0000 (GMT) (envelope-from pav@FreeBSD.org) Received: from freefall.freebsd.org (pav@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j44BDOQR090640; Wed, 4 May 2005 11:13:24 GMT (envelope-from pav@freefall.freebsd.org) Received: (from pav@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j44BDOsN090636; Wed, 4 May 2005 11:13:24 GMT (envelope-from pav) Date: Wed, 4 May 2005 11:13:24 GMT From: Pav Lucistnik Message-Id: <200505041113.j44BDOsN090636@freefall.freebsd.org> To: pav@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-usb@FreeBSD.org Subject: Re: usb/80383: [PATCH] Add quirk for uhid to ignore certain usb devices (blacklist) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2005 11:13:55 -0000 Synopsis: [PATCH] Add quirk for uhid to ignore certain usb devices (blacklist) Responsible-Changed-From-To: freebsd-bugs->freebsd-usb Responsible-Changed-By: pav Responsible-Changed-When: Wed May 4 11:13:09 GMT 2005 Responsible-Changed-Why: Reassign to usb bucket. Requested by: submitter http://www.freebsd.org/cgi/query-pr.cgi?pr=80383 From owner-freebsd-usb@FreeBSD.ORG Thu May 5 05:46:10 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E94416A4CE for ; Thu, 5 May 2005 05:46:10 +0000 (GMT) Received: from camay.yandex.ru (camay.yandex.ru [213.180.200.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A3B443D73 for ; Thu, 5 May 2005 05:46:10 +0000 (GMT) (envelope-from retrograd@yandex.ru) Received: from YAMAIL (camay.yandex.ru) by mail.yandex.ru id ; Thu, 5 May 2005 09:45:56 +0400 Date: Thu, 5 May 2005 09:45:56 +0400 (MSD) From: "retrograd" Sender: retrograd@yandex.ru Message-Id: <4279B314.000003.19307@camay.yandex.ru> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] Errors-To: retrograd@yandex.ru To: freebsd-usb@freebsd.org X-Source-Ip: 213.140.236.241 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: The USB storage device X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: retrograd@yandex.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 05:46:10 -0000 Hello everybody I have two storage USB device. The first is memory stick Kingston DataTravel 256mb, FAT, the second is external hard disk Maxtor One Touch 250gb, NTFS and I have some problems with using these devices. When I connect Kingston DataTravel, I get system message "umass0: Kingston DataTravel 2.0 addr 3" and then nothing. The device da0 is not created and as result I can not to use the device. When I connect Maxtor One Touch, the device is connected normally, I can see the devices da0 and da0s1 but when I try to use command "mount_ntfs /dev/da0s1 /mnt " the operation system is died. I can not use any commamnd after this. Could you help me? Best regards, Maxim From owner-freebsd-usb@FreeBSD.ORG Thu May 5 07:04:23 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AE6316A4CE; Thu, 5 May 2005 07:04:23 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 355D443D76; Thu, 5 May 2005 07:04:23 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 3ACCF7A403; Thu, 5 May 2005 00:04:19 -0700 (PDT) Message-ID: <4279C572.50809@elischer.org> Date: Thu, 05 May 2005 00:04:18 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Helge Oldach References: <200505042226.j44MQq2n004793@sep.oldach.net> In-Reply-To: <200505042226.j44MQq2n004793@sep.oldach.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: usb@freebsd.org Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 07:04:23 -0000 >> >> >I rebuilt my machine today and thus incorporated the USB changes that >have been MFC'd some days ago by julian@. Now I observe duplicated dmesg >entries for all newly attached USB devices, e.g. > > >Worse, the machine crashes when I remove USB sticks (tried various >models, all behave the same), saying > >umass0: BBB reset failed, STALLED >umass0: BBB bulk-in clear stall failed, STALLED >umass0: BBB bulk-out clear stall failed, STALLED >umass0: BBB reset failed, STALLED >umass0: BBB bulk-in clear stall failed, STALLED >umass0: BBB bulk-out clear stall failed, STALLED >umass0: BBB reset failed, STALLED >umass0: BBB bulk-in clear stall failed, STALLED >umass0: BBB bulk-out clear stall failed, STALLED >umass0: BBB reset failed, STALLED >umass0: BBB bulk-in clear stall failed, STALLED >umass0: BBB bulk-out clear stall failed, STALLED >umass0: at uhub1 port 2 (addr 4) disconnected >umass0: detached > > >Fatal trap 12:: BBB reset failed, STALLED > page fault while in kernel mode >fault virtual address = 0x3c >fault code = supervisor read, page not present >instruction pointer = 0x8:0xc016dbfe >stack pointer = 0x10:0xd159af08 >frame pointer = 0x10:0xd159af08 >code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, def32 1, gran 1 >processor eflags = interrupt enabled, resume, IOPL = 0 >current process = 3 (usb0) >interrupt mask = none >trap number = 12 >panic: page fault > >: BBB bulk-in clear stall failed, STALLED > >I did already apply yesterday's change to uhub.c (1.21.2.11). > >My previous kernel was built on 29th April and works fine. This already >includes the ehci, uhci and ohci changes that were done on 26th April. >So this problem must be related to the USB changes on 30th April. > > I just tried this I can not make it fail with my Lexar jumpdrive on a UHCI port. can you say if you are using uhci, ehci or ohci? I however DID find another failure mode.. If I boot with the drive plugged in, I get nested recursive interrupts (or rather polled interrupt equivalents) and it crashes.. (I think it may even be running out of stack.. there were about 50 functions on the stack traceback) Unfortunatly I'm about to go offline for a week If I can't figure it out I'll revert those patches. >>How-To-Repeat: >> >> > > > >>Fix: >> >> > > > > > From owner-freebsd-usb@FreeBSD.ORG Thu May 5 20:56:37 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E3B316A4CE for ; Thu, 5 May 2005 20:56:37 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C7A443DAA for ; Thu, 5 May 2005 20:56:37 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 05A637A403; Thu, 5 May 2005 13:56:32 -0700 (PDT) Message-ID: <427A887F.3020108@elischer.org> Date: Thu, 05 May 2005 13:56:31 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Helge Oldach , usb@freebsd.org References: <200505050618.j456IleO001353@sep.oldach.net> In-Reply-To: <200505050618.j456IleO001353@sep.oldach.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 20:56:37 -0000 Helge Oldach wrote: >Julian Elischer: > > >>any chance of getting a stack trace or a core dump? >> >> > >Ok, here we go: > > > >#6 0xc016f772 in device_get_ivars (dev=0x0) at /usr/src/sys/kern/subr_bus.c:998 >#7 0xc0237d5d in usb_disconnect_port (up=0xc18971c4, parent=0xc1897280) > at /usr/src/sys/dev/usb/usb_subr.c:1440 > > can you go to this frame "up 7" and print dev and i and *dev >#8 0xc02423b4 in uhub_explore (dev=0xc1897380) at /usr/src/sys/dev/usb/uhub.c:488 >#9 0xc02424f1 in uhub_explore (dev=0xc1813400) at /usr/src/sys/dev/usb/uhub.c:571 >#10 0xc02340cf in usb_discover (v=0xc18110c0) at /usr/src/sys/dev/usb/usb.c:745 >#11 0xc0233b92 in usb_event_thread (arg=0xc18110c0) at /usr/src/sys/dev/usb/usb.c:431 >(kgdb) list *0xc016f772 >0xc016f772 is in device_get_ivars (/usr/src/sys/kern/subr_bus.c:999). >994 } >995 >996 void * >997 device_get_ivars(device_t dev) >998 { >999 return dev->ivars; >1000 } >1001 >1002 void >1003 device_set_ivars(device_t dev, void * ivars) >(kgdb) quit > > From owner-freebsd-usb@FreeBSD.ORG Thu May 5 21:24:04 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54CD216A4CE for ; Thu, 5 May 2005 21:24:04 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2884443DA2 for ; Thu, 5 May 2005 21:24:04 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id A14937A403; Thu, 5 May 2005 14:24:03 -0700 (PDT) Message-ID: <427A8EF3.70003@elischer.org> Date: Thu, 05 May 2005 14:24:03 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Julian Elischer References: <200505050618.j456IleO001353@sep.oldach.net> <427A887F.3020108@elischer.org> In-Reply-To: <427A887F.3020108@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: Helge Oldach Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 21:24:04 -0000 Julian Elischer wrote: try: in usb_port.h comment out line 425 (as below) 422 423 #define config_detach(dev, flag) \ 424 do { \ 425 /* device_detach(dev); */ \ 426 free(device_get_ivars(dev), M_USB); \ 427 device_delete_child(device_get_parent(dev), dev); \ 428 } while (0); 429 > > > Helge Oldach wrote: > >> Julian Elischer: >> >> >>> any chance of getting a stack trace or a core dump? >>> >> >> >> Ok, here we go: >> >> >> > >> #6 0xc016f772 in device_get_ivars (dev=0x0) at >> /usr/src/sys/kern/subr_bus.c:998 >> #7 0xc0237d5d in usb_disconnect_port (up=0xc18971c4, parent=0xc1897280) >> at /usr/src/sys/dev/usb/usb_subr.c:1440 >> >> > can you go to this frame > "up 7" > and print dev and i and *dev > >> #8 0xc02423b4 in uhub_explore (dev=0xc1897380) at >> /usr/src/sys/dev/usb/uhub.c:488 >> #9 0xc02424f1 in uhub_explore (dev=0xc1813400) at >> /usr/src/sys/dev/usb/uhub.c:571 >> #10 0xc02340cf in usb_discover (v=0xc18110c0) at >> /usr/src/sys/dev/usb/usb.c:745 >> #11 0xc0233b92 in usb_event_thread (arg=0xc18110c0) at >> /usr/src/sys/dev/usb/usb.c:431 >> (kgdb) list *0xc016f772 >> 0xc016f772 is in device_get_ivars (/usr/src/sys/kern/subr_bus.c:999). >> 994 } >> 995 >> 996 void * >> 997 device_get_ivars(device_t dev) >> 998 { >> 999 return dev->ivars; >> 1000 } >> 1001 >> 1002 void >> 1003 device_set_ivars(device_t dev, void * ivars) >> (kgdb) quit >> >> > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Thu May 5 21:27:01 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27AA216A4CE for ; Thu, 5 May 2005 21:27:01 +0000 (GMT) Received: from sep.oldach.net (sep.oldach.net [194.180.25.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2ABE143D1F for ; Thu, 5 May 2005 21:27:00 +0000 (GMT) (envelope-from hmo@sep.oldach.net) Received: from sep.oldach.net (localhost [127.0.0.1])j45LQiA1093782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 May 2005 23:26:45 +0200 (CEST) (envelope-from hmo@sep.oldach.net) Received: (from hmo@localhost) by sep.oldach.net (8.13.3/8.13.3/Submit) id j45LQiaS093781; Thu, 5 May 2005 23:26:44 +0200 (CEST) (envelope-from hmo) Message-Id: <200505052126.j45LQiaS093781@sep.oldach.net> In-Reply-To: <427A887F.3020108@elischer.org> from Julian Elischer at "May 5, 2005 1:56:31 pm" To: julian@elischer.org (Julian Elischer) Date: Thu, 5 May 2005 23:26:44 +0200 (CEST) From: usbcrash@oldach.net (Helge Oldach) X-Message-Flag: No HTML mail please MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.84/871/Thu May 5 15:50:45 2005 on sep.oldach.net X-Virus-Status: Clean cc: usb@freebsd.org Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 21:27:01 -0000 Julian Elischer: > >#6 0xc016f772 in device_get_ivars (dev=0x0) at /usr/src/sys/kern/subr_bus.c:998 > >#7 0xc0237d5d in usb_disconnect_port (up=0xc18971c4, parent=0xc1897280) > > at /usr/src/sys/dev/usb/usb_subr.c:1440 > > > > > can you go to this frame > "up 7" > and print dev and i and *dev (kgdb) up 7 #7 0xc0237d5d in usb_disconnect_port (up=0xc18971c4, parent=0xc1897280) at /usr/src/sys/dev/usb/usb_subr.c:1440 1440 config_detach(dev->subdevs[i], DETACH_FORCE); (kgdb) print dev $1 = 0x0 (kgdb) print i $2 = 0 (kgdb) print *dev Cannot access memory at address 0x0. (kgdb) Helge From owner-freebsd-usb@FreeBSD.ORG Thu May 5 21:33:28 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 835C516A4CE for ; Thu, 5 May 2005 21:33:28 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A50343D55 for ; Thu, 5 May 2005 21:33:28 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j45LX2Zw094054; Thu, 5 May 2005 15:33:02 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 May 2005 15:33:02 -0600 (MDT) Message-Id: <20050505.153302.71182158.imp@bsdimp.com> To: julian@elischer.org From: Warner Losh In-Reply-To: <427A8EF3.70003@elischer.org> References: <200505050618.j456IleO001353@sep.oldach.net> <427A887F.3020108@elischer.org> <427A8EF3.70003@elischer.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 21:33:28 -0000 From: Julian Elischer Subject: Re: recent USB MFCs cause panics Date: Thu, 05 May 2005 14:24:03 -0700 > > > Julian Elischer wrote: > > try: > > in usb_port.h > comment out line 425 (as below) > > 422 > 423 #define config_detach(dev, flag) \ > 424 do { \ > 425 /* device_detach(dev); */ \ > 426 free(device_get_ivars(dev), M_USB); \ > 427 device_delete_child(device_get_parent(dev), dev); \ > 428 } while (0); > 429 Commenting it out is lame... I fixed this in current in uhub.c as well as here... Since 'dev' is 0 here, I'm unsure that commenting it out will fix the problem because the next line frees it.... Warner From owner-freebsd-usb@FreeBSD.ORG Thu May 5 21:51:27 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1112016A4CE for ; Thu, 5 May 2005 21:51:27 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4A0843D5F for ; Thu, 5 May 2005 21:51:26 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 842177A403; Thu, 5 May 2005 14:51:26 -0700 (PDT) Message-ID: <427A955E.4070605@elischer.org> Date: Thu, 05 May 2005 14:51:26 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Julian Elischer References: <200505050618.j456IleO001353@sep.oldach.net> <427A887F.3020108@elischer.org> <427A8EF3.70003@elischer.org> In-Reply-To: <427A8EF3.70003@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: Helge Oldach Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 21:51:27 -0000 Julian Elischer wrote: > > > Julian Elischer wrote: > > try: > > in usb_port.h > comment out line 425 (as below) > > 422 > 423 #define config_detach(dev, flag) \ > 424 do { \ > 425 /* device_detach(dev); */ \ > 426 free(device_get_ivars(dev), M_USB); \ > 427 device_delete_child(device_get_parent(dev), > dev); \ > 428 } while (0); > 429 > hmm maybe not the right answer.. maybe the answer is to comment out DEVMETHOD(bus_child_detached, uhub_child_detached), at line 134 of uhub.c DEVMETHOD(bus_child_detached, uhub_child_detached), It's kind of hard for me to...... (sudden thought appears) DUH you are running this in a hub aren't you? (I'm not) so, yes, remove that line and try again. >> >> >> >> Helge Oldach wrote: >> >>> Julian Elischer: >>> >>> >>>> any chance of getting a stack trace or a core dump? >>>> >>> >>> >>> >>> Ok, here we go: >>> >>> >>> >> >>> #6 0xc016f772 in device_get_ivars (dev=0x0) at >>> /usr/src/sys/kern/subr_bus.c:998 >>> #7 0xc0237d5d in usb_disconnect_port (up=0xc18971c4, >>> parent=0xc1897280) >>> at /usr/src/sys/dev/usb/usb_subr.c:1440 >>> >>> >> can you go to this frame >> "up 7" >> and print dev and i and *dev >> >>> #8 0xc02423b4 in uhub_explore (dev=0xc1897380) at >>> /usr/src/sys/dev/usb/uhub.c:488 >>> #9 0xc02424f1 in uhub_explore (dev=0xc1813400) at >>> /usr/src/sys/dev/usb/uhub.c:571 >>> #10 0xc02340cf in usb_discover (v=0xc18110c0) at >>> /usr/src/sys/dev/usb/usb.c:745 >>> #11 0xc0233b92 in usb_event_thread (arg=0xc18110c0) at >>> /usr/src/sys/dev/usb/usb.c:431 >>> (kgdb) list *0xc016f772 >>> 0xc016f772 is in device_get_ivars (/usr/src/sys/kern/subr_bus.c:999). >>> 994 } >>> 995 996 void * >>> 997 device_get_ivars(device_t dev) >>> 998 { >>> 999 return dev->ivars; >>> 1000 } >>> 1001 1002 void >>> 1003 device_set_ivars(device_t dev, void * ivars) >>> (kgdb) quit >>> >>> >> _______________________________________________ >> freebsd-usb@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-usb >> To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Thu May 5 21:56:33 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10D5D16A4CE for ; Thu, 5 May 2005 21:56:33 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5C1A43D45 for ; Thu, 5 May 2005 21:56:32 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id A6BA87A403; Thu, 5 May 2005 14:56:32 -0700 (PDT) Message-ID: <427A9690.9080108@elischer.org> Date: Thu, 05 May 2005 14:56:32 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Warner Losh References: <200505050618.j456IleO001353@sep.oldach.net> <427A887F.3020108@elischer.org> <427A8EF3.70003@elischer.org> <20050505.153302.71182158.imp@bsdimp.com> In-Reply-To: <20050505.153302.71182158.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 21:56:33 -0000 Warner Losh wrote: >From: Julian Elischer >Subject: Re: recent USB MFCs cause panics >Date: Thu, 05 May 2005 14:24:03 -0700 > > > >>Julian Elischer wrote: >> >>try: >> >>in usb_port.h >>comment out line 425 (as below) >> >>422 >> 423 #define config_detach(dev, flag) \ >> 424 do { \ >> 425 /* device_detach(dev); */ \ >> 426 free(device_get_ivars(dev), M_USB); \ >> 427 device_delete_child(device_get_parent(dev), dev); \ >> 428 } while (0); >> 429 >> >> > >Commenting it out is lame... I fixed this in current in uhub.c as >well as here... Since 'dev' is 0 here, I'm unsure that commenting it >out will fix the problem because the next line frees it.... > > yes I noticed that.. the next line doesn't free it, it frees the ivars which I don't think is the same thing.. the problem is that the 5.0 code does the device_delete_child() (as you see above) where 4.x did it in the device_detach() so with this merge I get the worst of both worlds.. the answer is to make uhub.c not call it's bus_child_detached() method (as 5.0 doesn't) or to make it a null function, as it clears the subdev entry which causes this problem. (see teh next email.) >Warner >_______________________________________________ >freebsd-usb@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-usb >To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > > From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:00:31 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0461A16A4CE for ; Thu, 5 May 2005 22:00:31 +0000 (GMT) Received: from sep.oldach.net (sep.oldach.net [194.180.25.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8A1143D1F for ; Thu, 5 May 2005 22:00:29 +0000 (GMT) (envelope-from hmo@sep.oldach.net) Received: from sep.oldach.net (localhost [127.0.0.1])j45M0EKM001020 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 May 2005 00:00:15 +0200 (CEST) (envelope-from hmo@sep.oldach.net) Received: (from hmo@localhost) by sep.oldach.net (8.13.3/8.13.3/Submit) id j45M0ET8001019; Fri, 6 May 2005 00:00:14 +0200 (CEST) (envelope-from hmo) Message-Id: <200505052200.j45M0ET8001019@sep.oldach.net> In-Reply-To: <427A8EF3.70003@elischer.org> from Julian Elischer at "May 5, 2005 2:24: 3 pm" To: julian@elischer.org (Julian Elischer) Date: Fri, 6 May 2005 00:00:14 +0200 (CEST) From: usbcrash@oldach.net (Helge Oldach) X-Message-Flag: No HTML mail please MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.84, clamav-milter version 0.84e on sep.oldach.net X-Virus-Status: Clean cc: usb@freebsd.org Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:00:31 -0000 Julian Elischer: > in usb_port.h > comment out line 425 (as below) > > 422 > 423 #define config_detach(dev, flag) \ > 424 do { \ > 425 /* device_detach(dev); */ \ > 426 free(device_get_ivars(dev), M_USB); \ > 427 device_delete_child(device_get_parent(dev), dev); \ > 428 } while (0); > 429 > OK. Upon inserting and detaching a flash diesk I get: umass0: USB Flash Disk, rev 2.00/2.00, addr 5 umass0: USB Flash Disk, rev 2.00/2.00, addr 5 umass0: BBB reset failed, STALLED umass0: BBB bulk-in clear stall failed, STALLED umass0: BBB bulk-out clear stall failed, STALLED umass0: BBB reset failed, STALLED umass0: BBB bulk-in clear stall failed, STALLED umass0: BBB bulk-out clear stall failed, STALLED umass0: BBB reset failed, STALLED umass0: BBB bulk-in clear stall failed, STALLED umass0: BBB bulk-out clear stall failed, STALLED umass0: BBB reset failed, STALLED umass0: BBB bulk-in clear stall failed, STALLED umass0: BBB bulk-out clear stall failed, STALLED umass0: BBB reset failed, STALLED umass0: BBB bulk-in clear stall failed, STALLED umass0: BBB bulk-out clear stall failed, STALLED umass0: at uhub1 port 2 (addr 5) disconnected umass0: detached Now insert it again, for the second attempt: umass0: USB Flash Disk, rev 2.00/2.00, addr 5 umass0: USB Flash Disk, rev 2.00/2.00, addr 5 umass0: BBB reset failed, STALLED umass0: BBB bulk-in clear stall failed, STALLED umass0: BBB bulk-out clear stall failed, STALLED umass0: BBB reset failed, STALLED umass0: BBB bulk-in clear stall failed, STALLED umass0: at uhub1 port 2 (addr 5) disconnected umass0: detached : BBB bulk-out clear stall failed, CANCELLED umass-sim:1:0:0:func_code 0x0901: Invalid target (target needed) umass-sim:1:0:0:func_code 0x0901: Invalid target (target needed) umass-sim:1:0:0:func_code 0x0901: Invalid target (target needed) panic: : Unknown state 0 syncing disks... done Uptime: 1m45s Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. Rebooting... Helge From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:03:30 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA66E16A4CE for ; Thu, 5 May 2005 22:03:30 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D62A43D60 for ; Thu, 5 May 2005 22:03:30 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j45M1lYN094340; Thu, 5 May 2005 16:01:47 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 May 2005 16:01:47 -0600 (MDT) Message-Id: <20050505.160147.112530402.imp@bsdimp.com> To: julian@elischer.org From: Warner Losh In-Reply-To: <427A9690.9080108@elischer.org> References: <427A8EF3.70003@elischer.org> <20050505.153302.71182158.imp@bsdimp.com> <427A9690.9080108@elischer.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:03:30 -0000 But I also fundamentally changed how usb children were detached in 5. Before they were deleted if no one claimed the device. Now they aren't so that loadable drivers have a chance of working (some do, some don't for reasons unknow). Warner From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:03:51 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8706A16A4CE for ; Thu, 5 May 2005 22:03:51 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 170B543DA9 for ; Thu, 5 May 2005 22:03:51 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j45M0tj6094338; Thu, 5 May 2005 16:00:55 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 May 2005 16:00:55 -0600 (MDT) Message-Id: <20050505.160055.78800132.imp@bsdimp.com> To: julian@elischer.org From: Warner Losh In-Reply-To: <427A9690.9080108@elischer.org> References: <427A8EF3.70003@elischer.org> <20050505.153302.71182158.imp@bsdimp.com> <427A9690.9080108@elischer.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:03:51 -0000 From: Julian Elischer Subject: Re: recent USB MFCs cause panics Date: Thu, 05 May 2005 14:56:32 -0700 > > > Warner Losh wrote: > > >From: Julian Elischer > >Subject: Re: recent USB MFCs cause panics > >Date: Thu, 05 May 2005 14:24:03 -0700 > > > > > > > >>Julian Elischer wrote: > >> > >>try: > >> > >>in usb_port.h > >>comment out line 425 (as below) > >> > >>422 > >> 423 #define config_detach(dev, flag) \ > >> 424 do { \ > >> 425 /* device_detach(dev); */ \ > >> 426 free(device_get_ivars(dev), M_USB); \ > >> 427 device_delete_child(device_get_parent(dev), dev); \ > >> 428 } while (0); > >> 429 > >> > >> > > > >Commenting it out is lame... I fixed this in current in uhub.c as > >well as here... Since 'dev' is 0 here, I'm unsure that commenting it > >out will fix the problem because the next line frees it.... > > > > > > yes I noticed that.. > the next line doesn't free it, it frees the ivars > which I don't think is the same thing.. if dev is NULL, then freeing the ivars from dev will still result in a NULL pointer dereference... > the problem is that the 5.0 code does the device_delete_child() (as you > see above) > where 4.x did it in the device_detach() > so with this merge I get the worst of both worlds.. > > the answer is to make uhub.c not call it's bus_child_detached() method > (as 5.0 doesn't) > or to make it a null function, as it clears the subdev entry which > causes this problem. Yes. I think that's the more correct fix. Warner From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:04:19 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 349B416A4CE for ; Thu, 5 May 2005 22:04:19 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B65943D66 for ; Thu, 5 May 2005 22:04:19 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 8F9DD7A403; Thu, 5 May 2005 15:04:18 -0700 (PDT) Message-ID: <427A9862.1020100@elischer.org> Date: Thu, 05 May 2005 15:04:18 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Warner Losh References: <200505050618.j456IleO001353@sep.oldach.net> <427A887F.3020108@elischer.org> <427A8EF3.70003@elischer.org> <20050505.153302.71182158.imp@bsdimp.com> In-Reply-To: <20050505.153302.71182158.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:04:19 -0000 Warner Losh wrote: >From: Julian Elischer >Subject: Re: recent USB MFCs cause panics >Date: Thu, 05 May 2005 14:24:03 -0700 > > > >>Julian Elischer wrote: >> >>try: >> >>in usb_port.h >>comment out line 425 (as below) >> >>422 >> 423 #define config_detach(dev, flag) \ >> 424 do { \ >> 425 /* device_detach(dev); */ \ >> 426 free(device_get_ivars(dev), M_USB); \ >> 427 device_delete_child(device_get_parent(dev), dev); \ >> 428 } while (0); >> 429 >> >> > >Commenting it out is lame... I fixed this in current in uhub.c as >well as here... Since 'dev' is 0 here, I'm unsure that commenting it >out will fix the problem because the next line frees it.... > > do you remember the full extent of your fix? I'm just learning about the bus/device stuff as I go.. the trick is bringing forward as much of the USB code withoug bringing forward a bunch of subr_bus etc. as well. >Warner >_______________________________________________ >freebsd-usb@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-usb >To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > > From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:06:40 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5C2E16A4CE for ; Thu, 5 May 2005 22:06:40 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B647B43D45 for ; Thu, 5 May 2005 22:06:40 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 7BBBE7A403; Thu, 5 May 2005 15:06:37 -0700 (PDT) Message-ID: <427A98ED.1000704@elischer.org> Date: Thu, 05 May 2005 15:06:37 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Warner Losh References: <427A8EF3.70003@elischer.org> <20050505.153302.71182158.imp@bsdimp.com> <427A9690.9080108@elischer.org> <20050505.160055.78800132.imp@bsdimp.com> In-Reply-To: <20050505.160055.78800132.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:06:40 -0000 Warner Losh wrote: >From: Julian Elischer >Subject: Re: recent USB MFCs cause panics >Date: Thu, 05 May 2005 14:56:32 -0700 > > > >>Warner Losh wrote: >> >> >> >>>From: Julian Elischer >>>Subject: Re: recent USB MFCs cause panics >>>Date: Thu, 05 May 2005 14:24:03 -0700 >>> >>> >>> >>> >>> >>>>Julian Elischer wrote: >>>> >>>>try: >>>> >>>>in usb_port.h >>>>comment out line 425 (as below) >>>> >>>>422 >>>> 423 #define config_detach(dev, flag) \ >>>> 424 do { \ >>>> 425 /* device_detach(dev); */ \ >>>> 426 free(device_get_ivars(dev), M_USB); \ >>>> 427 device_delete_child(device_get_parent(dev), dev); \ >>>> 428 } while (0); >>>> 429 >>>> >>>> >>>> >>>> >>>Commenting it out is lame... I fixed this in current in uhub.c as >>>well as here... Since 'dev' is 0 here, I'm unsure that commenting it >>>out will fix the problem because the next line frees it.... >>> >>> >>> >>> >>yes I noticed that.. >>the next line doesn't free it, it frees the ivars >>which I don't think is the same thing.. >> >> > >if dev is NULL, then freeing the ivars from dev will still result in a >NULL pointer dereference... > > > >>the problem is that the 5.0 code does the device_delete_child() (as you >>see above) >>where 4.x did it in the device_detach() >>so with this merge I get the worst of both worlds.. >> >>the answer is to make uhub.c not call it's bus_child_detached() method >>(as 5.0 doesn't) >>or to make it a null function, as it clears the subdev entry which >>causes this problem. >> >> > >Yes. I think that's the more correct fix. > > Is there a reason tio not just remove the method entry? will it default to a good default? (i.e. not an error default?) if not then I guess just stubbibg the method would work.. >Warner > > From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:15:27 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E62D216A4CE for ; Thu, 5 May 2005 22:15:27 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB53443D81 for ; Thu, 5 May 2005 22:15:26 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j45MDpHw094462; Thu, 5 May 2005 16:13:51 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 May 2005 16:13:51 -0600 (MDT) Message-Id: <20050505.161351.59748132.imp@bsdimp.com> To: julian@elischer.org From: Warner Losh In-Reply-To: <427A98ED.1000704@elischer.org> References: <427A9690.9080108@elischer.org> <20050505.160055.78800132.imp@bsdimp.com> <427A98ED.1000704@elischer.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:15:28 -0000 > Is there a reason tio not just remove the method entry? > will it default to a good default? (i.e. not an error default?) > if not then I guess just stubbibg the method would work.. Maybe you should look at the current code rather than taking the scatter gun approach to hoping that there's a magic bullet. Warner From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:15:50 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C065C16A505 for ; Thu, 5 May 2005 22:15:50 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37D9743D48 for ; Thu, 5 May 2005 22:15:50 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j45MDGIA094460; Thu, 5 May 2005 16:13:16 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 May 2005 16:13:16 -0600 (MDT) Message-Id: <20050505.161316.39243994.imp@bsdimp.com> To: julian@elischer.org From: Warner Losh In-Reply-To: <427A9862.1020100@elischer.org> References: <427A8EF3.70003@elischer.org> <20050505.153302.71182158.imp@bsdimp.com> <427A9862.1020100@elischer.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:15:51 -0000 From: Julian Elischer > do you remember the full extent of your fix? > I'm just learning about the bus/device stuff as I go.. > the trick is bringing forward as much of the USB code withoug bringing > forward a bunch of subr_bus etc. as well. I'm sure that cvs does: revision 1.63 date: 2004/09/09 20:43:49; author: imp; state: Exp; lines: +2 -34 We don't need a uhub_child_detached() routine now that we don't detach device_t instances when no driver attaches. They are left around, and we need to remember them. # The usbd_device_handle->subdevs[] array likely is completely bogus # at this point, but one change at a time, since its removal will need # to have similar code replace it extracted from newbus. Part of the patch submitted by Peter Pentchev after an excellent analysis of the underlying problems. MFC After: 1 week which lead me to the following from CVSROOT/commitligs/sys.20040922.gz: imp 2004-08-14 22:10:26 UTC FreeBSD src repository Modified files: sys/dev/usb uhub.c usb_port.h usb_subr.c Log: Next step in making usb more newbus: o reprobe children when a new driver is added to uhub o fix the usbd_probe_and_attach to set the ivars to a malloc'd area, as well as freeing the ivars on child destruction. o Don't delete children that don't attach. Evidentally, the need to do this is a common misconception. o minor formatting foo that may violate style(9) at the moment, but keeps the diffs against my p4 tree smaller. This does not solve the ugen gobbling things up problem, but the fixes I have for that expose bugs in other parts of the tree... Revision Changes Path 1.61 +14 -26 src/sys/dev/usb/uhub.c 1.66 +5 -1 src/sys/dev/usb/usb_port.h 1.68 +31 -37 src/sys/dev/usb/usb_subr.c imp 2004-09-09 20:43:49 UTC FreeBSD src repository Modified files: sys/dev/usb uhub.c Log: We don't need a uhub_child_detached() routine now that we don't detach device_t instances when no driver attaches. They are left around, and we need to remember them. # The usbd_device_handle->subdevs[] array likely is completely bogus # at this point, but one change at a time, since its removal will need # to have similar code replace it extracted from newbus. Part of the patch submitted by Peter Pentchev after an excellent analysis of the underlying problems. MFC After: 1 week Revision Changes Path 1.63 +2 -34 src/sys/dev/usb/uhub.c imp 2004-09-09 20:47:28 UTC FreeBSD src repository Modified files: sys/dev/usb usb_subr.c Log: Add comments about why we're freeing subdevs (which is completely redundant at this point and should be retired). Don't free subdevs if we don't attach any devices. This was leaving stale device_t's around. Don't touch the device if it isn't attached since the name isn't meaningful then. Switch from strncpy (properly used) to strlcpy. From a patch submitted by Peter Pentchev Revision Changes Path 1.70 +11 -8 src/sys/dev/usb/usb_subr.c I can't recall of there were other commits to follow. Warner From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:21:27 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5562016A4CE for ; Thu, 5 May 2005 22:21:27 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D24043D7E for ; Thu, 5 May 2005 22:21:26 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1]) by harmony.village.org (8.13.3/8.13.1) with ESMTP id j45MKfpE094524; Thu, 5 May 2005 16:20:41 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 May 2005 16:20:41 -0600 (MDT) Message-Id: <20050505.162041.116001724.imp@bsdimp.com> To: julian@elischer.org From: Warner Losh In-Reply-To: <20050505.161351.59748132.imp@bsdimp.com> References: <20050505.160055.78800132.imp@bsdimp.com> <427A98ED.1000704@elischer.org> <20050505.161351.59748132.imp@bsdimp.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:21:27 -0000 From: Warner Losh Subject: Re: recent USB MFCs cause panics Date: Thu, 05 May 2005 16:13:51 -0600 (MDT) > > Is there a reason tio not just remove the method entry? > > will it default to a good default? (i.e. not an error default?) > > if not then I guess just stubbibg the method would work.. > > Maybe you should look at the current code rather than taking the > scatter gun approach to hoping that there's a magic bullet. Sorry for the short reply, but the current code has: USB_DECLARE_DRIVER_INIT(uhub, DEVMETHOD(bus_child_pnpinfo_str, uhub_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, uhub_child_location_str), DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD(device_shutdown, bus_generic_shutdown) ); But there's more than just removing the entry in the table to making it work. Warner From owner-freebsd-usb@FreeBSD.ORG Thu May 5 22:58:28 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7891A16A4CE for ; Thu, 5 May 2005 22:58:28 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32EA143DC4 for ; Thu, 5 May 2005 22:58:28 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 1A4797A41E; Thu, 5 May 2005 15:58:28 -0700 (PDT) Message-ID: <427AA513.7020304@elischer.org> Date: Thu, 05 May 2005 15:58:27 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.7) Gecko/20050423 X-Accept-Language: en, hu MIME-Version: 1.0 To: Warner Losh References: <427A9690.9080108@elischer.org> <20050505.160055.78800132.imp@bsdimp.com> <427A98ED.1000704@elischer.org> <20050505.161351.59748132.imp@bsdimp.com> In-Reply-To: <20050505.161351.59748132.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: usb@freebsd.org cc: usbcrash@oldach.net Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 22:58:28 -0000 Warner Losh wrote: >>Is there a reason tio not just remove the method entry? >>will it default to a good default? (i.e. not an error default?) >>if not then I guess just stubbibg the method would work.. >> >> > >Maybe you should look at the current code rather than taking the >scatter gun approach to hoping that there's a magic bullet. > >Warner > > I am going through both 6.x and 4.x and trying to understand the changes.. I just misunderstood this one :-/ From owner-freebsd-usb@FreeBSD.ORG Fri May 6 01:50:10 2005 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 746FE16A4CE for ; Fri, 6 May 2005 01:50:10 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36A2943D7C for ; Fri, 6 May 2005 01:50:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j461oAhh081683 for ; Fri, 6 May 2005 01:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j461oAWP081682; Fri, 6 May 2005 01:50:10 GMT (envelope-from gnats) Resent-Date: Fri, 6 May 2005 01:50:10 GMT Resent-Message-Id: <200505060150.j461oAWP081682@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Richard S. Conto" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C55E916A4CE for ; Fri, 6 May 2005 01:49:47 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADE4543D7B for ; Fri, 6 May 2005 01:49:47 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j461nlJX076460 for ; Fri, 6 May 2005 01:49:47 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j461nl09076459; Fri, 6 May 2005 01:49:47 GMT (envelope-from nobody) Message-Id: <200505060149.j461nl09076459@www.freebsd.org> Date: Fri, 6 May 2005 01:49:47 GMT From: "Richard S. Conto" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: usb/80685: panic in usb_cold_explore() at begining X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2005 01:50:10 -0000 >Number: 80685 >Category: usb >Synopsis: panic in usb_cold_explore() at begining >Confidential: no >Severity: critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 06 01:50:09 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Richard S. Conto >Release: 4.11-STABLE i386 >Organization: >Environment: FreeBSD toolbox.family 4.11-STABLE FreeBSD 4.11-STABLE #0: Sun Jan 23 12:14:05 EST 2005 root@toolbox.family:/usr/src/sys/compile/TOOLBOX i386 >Description: During boot, I get a panic in "usb_cold_explore". IP packet filtering initialized, divert disabled, rule-based forwarding enabled, default to accept, logging limited to 100 packets/entry by default panic: usb_cold_explore: busses to explore when !cold A "boot -v" doesn't show any more detail to me, and I can't capture the output in any event. This machine is rather old and slow. I suspect timing issues. I think "dmesg" explains my machine best: Timecounter "i8254" frequency 1193182 Hz CPU: Pentium/P54C (119.75-MHz 586-class CPU) Origin = "GenuineIntel" Id = 0x526 Stepping = 6 Features=0x1bf real memory = 100663296 (98304K bytes) avail memory = 92835840 (90660K bytes) I recently "cvsup"'d this system, so the "uname -a" for Environment is somewhat misleading. This happens with a version as recently updated as May 3. I haven't tried removing the USB card. If I could disable the usb support and probing with /boot/loader.conf, I would. >How-To-Repeat: Boot my old and creaky system >Fix: >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Sat May 7 14:41:59 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5932116A4DB for ; Sat, 7 May 2005 14:41:59 +0000 (GMT) Received: from swip.net (mailfe10.tele2.se [212.247.155.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C15E43D93 for ; Sat, 7 May 2005 14:41:58 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-217-232-250.daxnet.no ([193.217.232.250] verified) by mailfe10.swip.net (CommuniGate Pro SMTP 4.3c5) with ESMTP id 152319563 for freebsd-usb@freebsd.org; Sat, 07 May 2005 16:41:55 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sat, 7 May 2005 16:42:39 +0200 User-Agent: KMail/1.7 References: <200505042226.j44MQq2n004793@sep.oldach.net> <4279C572.50809@elischer.org> In-Reply-To: <4279C572.50809@elischer.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200505071642.39796.hselasky@c2i.net> Subject: Re: recent USB MFCs cause panics X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2005 14:41:59 -0000 On Thursday 05 May 2005 09:04, Julian Elischer wrote: > >I rebuilt my machine today and thus incorporated the USB changes that > >have been MFC'd some days ago by julian@. Now I observe duplicated dmesg > >entries for all newly attached USB devices, e.g. > > > > > >Worse, the machine crashes when I remove USB sticks (tried various > >models, all behave the same), saying > > > >umass0: BBB reset failed, STALLED > >umass0: BBB bulk-in clear stall failed, STALLED > >umass0: BBB bulk-out clear stall failed, STALLED > >umass0: BBB reset failed, STALLED > >umass0: BBB bulk-in clear stall failed, STALLED > >umass0: BBB bulk-out clear stall failed, STALLED > >umass0: BBB reset failed, STALLED > >umass0: BBB bulk-in clear stall failed, STALLED > >umass0: BBB bulk-out clear stall failed, STALLED > >umass0: BBB reset failed, STALLED > >umass0: BBB bulk-in clear stall failed, STALLED > >umass0: BBB bulk-out clear stall failed, STALLED > >umass0: at uhub1 port 2 (addr 4) disconnected > >umass0: detached > > > > > >Fatal trap 12:: BBB reset failed, STALLED > > page fault while in kernel mode > >fault virtual address = 0x3c > >fault code = supervisor read, page not present > >instruction pointer = 0x8:0xc016dbfe > >stack pointer = 0x10:0xd159af08 > >frame pointer = 0x10:0xd159af08 > >code segment = base 0x0, limit 0xfffff, type 0x1b > > = DPL 0, pres 1, def32 1, gran 1 > >processor eflags = interrupt enabled, resume, IOPL = 0 > >current process = 3 (usb0) > >interrupt mask = none > >trap number = 12 > >panic: page fault > > > >: BBB bulk-in clear stall failed, STALLED > > > >I did already apply yesterday's change to uhub.c (1.21.2.11). > > > >My previous kernel was built on 29th April and works fine. This already > >includes the ehci, uhci and ohci changes that were done on 26th April. > >So this problem must be related to the USB changes on 30th April. > > I just tried this I can not make it fail with my Lexar jumpdrive on a > UHCI port. > > can you say if you are using uhci, ehci or ohci? > > > I however DID find another failure mode.. > > If I boot with the drive plugged in, I get nested recursive interrupts > (or rather polled interrupt equivalents) > and it crashes.. (I think it may even be running out of stack.. there > were about 50 functions on > the stack traceback) > > Unfortunatly I'm about to go offline for a week If I can't figure it out > I'll revert those patches. > What branch is this. Current? It might not be related, but I just looked at the existing code (FreeBSD-6-current), and I found that "usbd_probe_and_attach()" will leave devices around if it fails. I assume that this was to enable hot driver loading, but that is _not_ the right way to do it. To allow this the "uaa" structure (usb_attach_arg) is allocated in memory, instead of on the stack, which is just a waste of memory! This structure is only supposed to be there during probe and attach, and to make this clear "device_set_ivars(..., NULL);" should be put somewhere, to have invalid use cause "page faults". When a new driver is loaded "usbd_probe_and_attach()" must be called again! If "usbd_probe_and_attach()" detects that devices already exists it should just return. I suggest that "usbd_probe_and_attach()" is called from "uhub_explore()", to avvoid race conditions, when some parameter is set, and that "bus_driver_added" is not set to generic. The reason is simple: One has to loop over the configurations again, because some devices have "ifaces". The current solution will only work for "iface"-less devices ! Yours --HPS