From owner-freebsd-usb@FreeBSD.ORG Sun Dec 23 21:10:03 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C591916A468 for ; Sun, 23 Dec 2007 21:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A0FA813C4F0 for ; Sun, 23 Dec 2007 21:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBNLA23d024328 for ; Sun, 23 Dec 2007 21:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBNLA2SG024321; Sun, 23 Dec 2007 21:10:02 GMT (envelope-from gnats) Date: Sun, 23 Dec 2007 21:10:02 GMT Message-Id: <200712232110.lBNLA2SG024321@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Alan Grow Cc: Subject: Re: usb/118098: 6th gen iPod causes problems when disconnecting. X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alan Grow List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2007 21:10:03 -0000 The following reply was made to PR usb/118098; it has been noted by GNATS. From: Alan Grow To: bug-followup@FreeBSD.org, jpalmer@totaldiver.net Cc: Subject: Re: usb/118098: 6th gen iPod causes problems when disconnecting. Date: Sun, 23 Dec 2007 14:38:42 -0600 I can also reproduce this with 7.0-BETA3 and my 6th gen nano. Anything plugged in to the same usb port fails to mount with IOERRORs; reconnecting a device on a different port renders the port usable again. From owner-freebsd-usb@FreeBSD.ORG Mon Dec 24 09:47:06 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6B5C16A41A; Mon, 24 Dec 2007 09:47:06 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id 4AB0113C474; Mon, 24 Dec 2007 09:47:06 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id E896E1CCC9; Mon, 24 Dec 2007 10:46:42 +0100 (CET) Date: Mon, 24 Dec 2007 10:46:42 +0100 From: Ed Schouten To: freebsd-usb@freebsd.org Message-ID: <20071224094642.GO1169@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zxEKvxCKojqA/Afl" Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: rpaulo@freebsd.org Subject: USB keyboard translation - Apple hardware X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2007 09:47:06 -0000 --zxEKvxCKojqA/Afl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello everyone, One of the things that really made me mad when I got FreeBSD working on my Apple MacBook, was that the Fn button on the keyboard doesn't work. This means that I don't have the Delete, Page-{Up,Down}, Home and End buttons. I took a look at kbdmap(1), but it turned out you can't add any new modifiers, which is needed in this case, because we have a new Fn modifier key. Maybe you could solve this in X, but I also work a lot outside of X, so I really want to have the translation to be performed everywhere. I've written the following patch for ukbd, which adds a method for easily adding translation functions to the driver, to remap keys: http://g-rave.nl/unix/freebsd/freebsd-ukbd-translate.diff I tried to keep the code as clean as possible, so I also put some #ifdef's around it, so that people who dislike it, can just undef it. I've only added the quirks for the Apple MacBook keyboard, but there are some other Apple keyboards that have some strange scancodes. I still have to add those. Any comments so far? --=20 Ed Schouten WWW: http://g-rave.nl/ --zxEKvxCKojqA/Afl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHb4AC52SDGA2eCwURAiJHAJ0e3FLAqv1hKJu/QLCocCxb4b1O/ACcDVEt OOQ59YkhtkehmlnZGDSSWxs= =a7+O -----END PGP SIGNATURE----- --zxEKvxCKojqA/Afl-- From owner-freebsd-usb@FreeBSD.ORG Mon Dec 24 11:07:08 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AF9416A4D8 for ; Mon, 24 Dec 2007 11:07:08 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3FC13C478 for ; Mon, 24 Dec 2007 11:07:08 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBOB788D032107 for ; Mon, 24 Dec 2007 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBOB77e7032103 for freebsd-usb@FreeBSD.org; Mon, 24 Dec 2007 11:07:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 24 Dec 2007 11:07:07 GMT Message-Id: <200712241107.lBOB77e7032103@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-usb@FreeBSD.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2007 11:07:08 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/84750 usb [hang] 6-BETA2 reboot/shutdown with root_fs on externa o usb/91629 usb usbd_abort_pipe() may result in infinite loop 2 problems total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/46176 usb [panic] umass causes kernel panic if device removed be o i386/46371 usb USB controller cannot be initialized on IBM Netfinity o bin/57255 usb usbd and multi-function devices o usb/63621 usb [usb] USB MemoryStick Reader stalls/crashes system o usb/69006 usb [patch] Apple Cinema Display hangs USB ports o usb/71155 usb [usb] misbehaving usb-printer hangs processes, causes o usb/73307 usb [panic] Kernel panics on USB disconnect o usb/74771 usb [umass] mounting write-protected umass device as read/ o usb/75705 usb [panic] da0 attach / Optio S4 (with backtrace) o usb/75797 usb 5.3-STABLE(2005 1/4) detect USB headset, But can not f o usb/76395 usb USB printer does not work, usbdevs says "addr 0 should o usb/77184 usb [panic] kernel panic on USB device disconnect o usb/77294 usb [ulpcom] [panic] ucom + ulpcom panic o usb/79269 usb USB ohci da0 plug/unplug causes crashes and lockups. o usb/79287 usb [uhci] UHCI hang after interrupt transfer o usb/79524 usb printing to Minolta PagePro 1[23]xxW via USB fails wit a usb/79656 usb [usb] RHSC interrupts lost o usb/79722 usb [usb] wrong alignments in ehci.h o usb/80040 usb [hang] Use of sound mixer causes system freeze with ua o usb/80361 usb [patch] mounting of usb-stick fails o usb/80829 usb possible panic when loading USB-modules o usb/80862 usb [patch] USB locking issues: missing some Giant calls o usb/82350 usb [usb] null pointer dereference in USB stack o usb/82520 usb Reboot when USL101 connected s usb/82569 usb [usb] USB mass storage plug/unplug causes system panic o usb/82660 usb [umass] [panic] EHCI: I/O stuck in state 'physrd'/pani o usb/83563 usb [panic] Page Fault while detaching Mpman Usb device o usb/83677 usb [usb] usb controller often not detected (Sun W2100z) o usb/83756 usb [ums] [patch] Microsoft Intellimouse Explorer 4.0A doe o usb/83977 usb [ucom] [panic] ucom1: open bulk out error (addr 2): IN o usb/84326 usb [umass] Panic trying to connect SCSI tape drive via US o usb/84336 usb [usb] [reboot] instant system reboot when unmounting a o usb/86767 usb [usb] [patch] bogus "slice starts beyond end of the di o usb/88743 usb [hang] USB makes kernel hang at boot (regression in 6. o usb/88966 usb [modules] kldunload ucom.ko returns "Device busy" erro o usb/89003 usb LaCie Firewire drive not properly supported under 6.0 o usb/89954 usb [usb] USB Disk driver race condition? o usb/90700 usb [umass] [panic] Kernel panic on connect/mount/use umas o usb/91238 usb [umass] USB tape unit fails to write a second tape fil o usb/91283 usb booting very slow with usb devices connection (regress o usb/91538 usb [ulpt] [patch] Unable to print to EPSON CX3500 o usb/91906 usb [hang] FreeBSD hangs while booting with USB legacy sup o usb/92052 usb [unlpt] usbd causes defunct process with busy file-han o usb/92083 usb [ural] [panic] panic using WPA on ural NIC in 6.0-RELE o usb/92142 usb SET_ADDR_FAILED and SHORT_XFER errors from usb drivers o usb/92171 usb [panic] panic unplugging Vodafone Mobile Connect (UMTS o usb/93155 usb [ulpt] /dev/ulpt0: device busy, USB printer does not w o usb/93408 usb [mouse] hw.acpi.cpu.cx_lowest=C3 on AMD Turion causes o usb/93640 usb [irq] device ehci causes interrupt storm on this MSI a o usb/93828 usb [panic] ohci causes panic on boot (HP Pavillion d4100e o usb/94166 usb btx halted with a flashcard plugged o usb/94384 usb [panic] kernel panic with usb2 hardware o usb/94717 usb [ulpt] Reading from /dev/ulpt can break work of a UHCI o usb/94813 usb [umass] mounting write-protected umass device freezes o usb/94897 usb [panic] Kernel Panic when cleanly unmounting USB disk o usb/95131 usb [install] Boot/setup process does not accept key strok o usb/95348 usb [kbd] USB keyboard unplug causes noise on screen o usb/95562 usb [umass] Write Stress in USB Mass drive causes "vinvalb o usb/95636 usb [boot] 5 minute delay at boot when using VT6205 based o usb/96120 usb [mouse] USB mouse not always detected o usb/96224 usb [usb] mount_msdosfs cause page fault in syncer process o usb/96457 usb [panic] fatback on umass = reboot o usb/97286 usb [mouse] MS Wireless Intellimouse Explorer 2.0 doesn't o usb/99431 usb [kbd] FreeBSD on MSI 6566E (Intel 845E motherboards) d o usb/101096 usb [if_ural] [panic] USB WLAN occasionally causes kernel- o usb/101448 usb [ohci] FBSD 6.1-STABLE/AMD64 crashes under heavy USB/O o usb/101752 usb [umass] [panic] 6.1-RELEASE kernel panic on usb device o usb/102066 usb [ukbd] usb keyboard and multimedia keys don't work o usb/102096 usb [patch] /usr/sbin/usbd does not handle multiple device o usb/103025 usb [usb] wrong detection of USB device for FreeBSD 6.1 an o usb/104292 usb [hang] system lockup on forced umount of usb-storage d o usb/104830 usb [umass] system crashes when copying data to umass devi o usb/105186 usb USB 2.0/ehci on FreeBSD 6.2-PRE/AMD64 crashes box o usb/106615 usb [uftdi] uftdi module does not automatically load with o usb/106648 usb [hang] USB Floppy on D1950 10 min Hang on Insert w/o F o usb/106832 usb USB HP printer is not detected by kernel when ACPI ena o usb/107248 usb [umass] [patch] scsi_da.c quirk for Cowon iAUDIO X5 MP o usb/107446 usb [umass] umass problems (usb and fw disks) o usb/107827 usb [panic] ohci_add_done addr not found o usb/107848 usb [umass] cannot access Samsung flash disk o usb/107924 usb [patch] usbd(8) does not call detach o usb/108513 usb [umass] Creative MuVo TX FM fails in 6.2-RELEASE (regr o usb/109274 usb [usb] MCP55 USB Controller fails to attach in AMD64 Cu o usb/109397 usb [panic] on boot from USB flash o usb/110856 usb [ugen] [patch] interrupt in msgs are truncated when bu o usb/110988 usb [umass] [patch] Handling of quirk IGNORE_RESIDUE is um o usb/111753 usb [uhid] [panic] Replicable system panic involving UHID o usb/112568 usb USB mode may wrong when mounting Playstation Pro o usb/112631 usb [panic] Problem with SONY DSC-S80 camera o usb/112640 usb [usb] [hang] Kernel freezes when writing a file to an o usb/113478 usb [boot] FreeBSD could not start on Core2Duo notebook fr o usb/113629 usb [ukbd] Dropped USB keyboard events on Dell Latitude D6 o usb/113672 usb [ehci] [panic] Kernel panic with AEWIN CB6971 o usb/113851 usb [boot] Unable to boot install cd from USB-CDROM o usb/113977 usb [feature request] Need a way to set mode of USB disk's o usb/114310 usb [panic] USB hub attachment panics kernel during libusb o usb/114682 usb USB media-card reader unusable o kern/114780 usb [uplcom] [panic] Panics while stress testing the uplco o usb/115298 usb Turning off USB printer panics kernel o usb/116561 usb RELENG_6 umodem panic "trying to sleep while sleeping o usb/116947 usb [patch] enable boot protocol on the USB keyboards o usb/117150 usb [zyd] usb zyd device under moderate load panics system o usb/117200 usb [ugen] ugen0 prints strange string on attach if detach o usb/117313 usb [panic] panic on usb camera attachment o usb/117613 usb uhci interrupt storm & USB leaked memory on destroy o usb/117719 usb umass plugging with hald running causes kernel panics o usb/117946 usb D-Link DUB-E100 rev. B1 crashes FreeBSD 7.0-BETA2 o usb/117955 usb plugging minolta dimage a2 crashes os o usb/118140 usb [ucom] [patch] quick hack for ucom to get it behave wi o usb/118141 usb usb serial and nokia phones ucomreadcb ucomreadcb: IOE o usb/118353 usb [panic] [ppp] repeatable kernel panic during ppp(4) se o usb/118391 usb Add uscanner ID for Epson CX4800 o usb/118480 usb Timeout in USB mass storage freezes vfs layer or crash 113 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/30929 usb [usb] [patch] use usbd to initialize USB ADSL modem o usb/40948 usb [usb] USB HP CDW8200 does not work o usb/48342 usb [PATCH] usbd dynamic device list. f usb/51958 usb [urio] [patch] update for urio driver o usb/52026 usb [usb] feature request: umass driver support for InSyst o usb/56095 usb [usb] [patch] QUIRK: Apacer Pen Drive fails to work o usb/59698 usb [kbd] [patch] Rework of ukbd HID to AT code translatio o usb/62257 usb [umass] card reader UCR-61S2B is only half-supported o usb/63837 usb [uhid] [patch] USB: hid_is_collection() only looks for o usb/65769 usb [usb] Call to tcflush(x, TCIFLUSH) stops input on usb- o usb/66547 usb [usb] Palm Tungsten T USB does not initialize correctl o usb/68232 usb [ugen] [patch] ugen(4) isochronous handling correction o usb/70523 usb [usb] [patch] umct sending/receiving wrong characters o usb/71280 usb [aue] aue0 device (linksys usb100tx) doesn't work in 1 o usb/71416 usb [ugen] Cryptoflex e-gate USB token (ugen0) detach is n o usb/71417 usb [ugen] Cryptoflex e-gate USB token (ugen0) communicati o usb/71455 usb [usb] Slow USB umass performance of 5.3 o usb/72380 usb [usb] USB does not work [dual Celeron Abit] o usb/72733 usb Kyocera 7135 Palm OS connection problem. o usb/73056 usb [usb] Sun Microsystems Type 6 USB mouse not working in o usb/74211 usb [umass] USB flash drive causes CAM status 0x4 on 4.10R f usb/74453 usb [patch] Q-lity CD-RW USB ECW-043 (ScanLogic SL11R chip o usb/74557 usb imation 500mb usb key can only be written halfway on f o usb/75764 usb [umass] [patch] "umass0: Phase Error" - no device for o usb/75800 usb [ucom] ucom1: init failed STALLED error in time of syn o usb/75928 usb Cytronix SmartMedia card (SMC) reader has problems whe o usb/76461 usb [umass] disklabel of umass(4)-CAM(4)-da(4) not used by o usb/76653 usb [umass] [patch] Problem with Asahi Optical usb device o usb/76732 usb Mouse problems with USB KVM Switch f usb/78984 usb [patch] Creative MUVO umass failure o usb/79723 usb [usb] prepare for high speed isochronous transfers o usb/80774 usb [patch] have "usbd_find_desc" in line with the other " o usb/80776 usb [udav] UDAV device driver shouldn't use usb_add_task o usb/80777 usb usb_rem_task() should wait for callback to complete? o usb/80854 usb suggestion for new iface-no-probe mechanism o usb/80935 usb [uvisor] [patch] uvisor.c is not work with CLIE TH55. f usb/81621 usb external hd hangs under load on ehci o usb/83863 usb [ugen] Communication problem between opensc/openct via o usb/85067 usb Cannot attach ScanJet 4300C to usb device o usb/85257 usb [boot] BTX boot loader fails on USB CDROM (HP DL145 Op o usb/86298 usb [mouse] Known good USB mouse won't work with correct s o usb/87224 usb Cannot mount USB Zip750 o usb/87648 usb [mouse] Logitech USB-optical mouse problem. o usb/88408 usb [axe] axe0 read PHY failed o usb/91546 usb [umodem] [patch] Nokia 6630 mobile phone does not work o usb/91811 usb Compact Flash in HP Photosmart 2610 return " Medium n o usb/91896 usb Serial Number of USB Memory Sticks is not passed throu o usb/92852 usb [mouse] [patch] Vertical scroll not working properly o o usb/93389 usb [umass] [patch] Digital Camera Pentax S60 don't work o usb/93872 usb [patch] SCSI quirk required for ELTA 8061 OL USB memor o usb/95037 usb [umass] USB disk not recognized on hot-plug. o usb/95173 usb [umass] [patch] cannot mount external usb harddisk VIA o usb/96381 usb [patch] add a quirk table entry for a flash ram usb st o usb/97175 usb [hang] USB cardreader hangs system o usb/97472 usb [patch] add support for Olympus C150,D390 o usb/98343 usb [boot] BBB reset failed errors with Creative Muvo MP3 o usb/99538 usb [kbd] while using USB keyboard default params of atkbd o usb/100746 usb [kbd] system does not boot due to USB keyboard problem o usb/101761 usb [patch] usb.h: increase maximal size of report descrip o usb/101775 usb [libusbhid] [patch] possible error in report descripto o usb/102678 usb [kbd] Dell PowerEdge DRAC5 USB Keyboard does not work o usb/102976 usb [panic] Casio Exilim Digital Camera cause panic o usb/103046 usb [ulpt] [patch] ulpt event driven I/O with select(2) an o usb/103289 usb USB 2.0 problems on AMD LX-800 CPU and CS-5536 chipset o usb/103418 usb [usb] [patch] usbhidctl: add ability to write output a o usb/103917 usb USB driver reports "Addr 0 should never happen" o usb/104290 usb [umass] [patch] quirk: TOSHIBA DVD-RAM drive (libretto o usb/104352 usb [ural] [patch] ural driver doesnt work o usb/104645 usb Rave C-201 MP3 player does not communicate o usb/105065 usb [sata] SATA - USB Bridge f usb/105361 usb [panic] Kernel panic during unmounting mass storage (C o usb/106041 usb FreeBSD does not recognise Mustek BearPaw 2400TA usb s o usb/106621 usb [axe] [patch] DLINK DUB-E100 support broken o usb/106861 usb [usbdevs] [patch]: usbdevs update: Add product ACER Ze o usb/107243 usb [patch] Apacer USB Flash Drive quirk o usb/107388 usb [PATCH] Add utoppy device from NetBSD o usb/107496 usb USB device problem on RELENG_6_2 (SHORT_XFER) (regress o usb/107665 usb [usb] [patch] uscanner support for epson stylus DX5050 o usb/107701 usb [usbd] usbd ignores "detach" o usb/107935 usb [uplcom] [panic] panic while accessing /dev/cuaU0 o usb/108056 usb [ohci] Mouse gets powered off during device probe when o usb/108344 usb [panic] kernel with atausb panics when unplugging USB o usb/108509 usb [hang] FreeBSD hang at startup after ehci0 detected (C o usb/110197 usb [umass] Sony PSP umass device does not detach from EHC s usb/110991 usb [patch] QUIRK: Super Top IDE DEVICE (depends on usb/11 o usb/112461 usb [ehci] ehci USB 2.0 doesn't work on nforce4 o usb/112463 usb problem with Samsung USB DVD writer, libscg and FreeBS o usb/112944 usb [patch] Bi-directional access to HP LaserJet 1010 prin o usb/113060 usb [usbdevs] [patch] Samsung printer not working in bidir o usb/113432 usb WARNING: attempt to net_add_domain(netgraph) after dom o conf/114013 usb [patch] WITHOUT_USB allow to compil a lot of USB stuff o usb/114068 usb [umass] [patch] Problems with connection of the umass p usb/114860 usb if_udav / ShanTou ST268 USB NIC o usb/114916 usb USB Maxtor drive (L300RO) requires quirk. o usb/115080 usb using a Hercules HWGUSB2-54-V2 wifi usb adapter o usb/115197 usb can not install from USB stick drive o usb/115400 usb [ehci] Problem with EHCI on ASUS M2N4-SLI o usb/115737 usb uplcom doesn't identify my Prolific 2303 any more o usb/115933 usb RATOC REX-USB60F (usb serial converter) is working o usb/115935 usb [patch] kernel counterproductively attaches to Cyber P o usb/116282 usb Cannot print on USB HP LJ1018 or LJ1300 o usb/116574 usb [patch] Add device ids for ICH8 USB chipsets o usb/116898 usb panic: sleeping thread while using USB hard drive o usb/117075 usb [scsi_da] [patch] quirk: USB Samsung YP-U3 MP3 o usb/117183 usb USB/fusefs -- Fatal trap 12: page fault while in kerne o usb/117185 usb [patch] [umodem] Add support for UNION interface descr o usb/117205 usb [uscanner] [patch] uscanner support for HP ScanJet 447 o usb/117366 usb USB keyboard status lights not working properly o usb/117546 usb [usbdevs] [patch] Add MaxStream ZigBee product ID to u o usb/117598 usb [uaudio] [patch] Not possible to record with Plantroni o usb/117893 usb Lacie USB DVD writing failing o usb/117911 usb Mouse Gembird MUSWC not work o usb/117938 usb [Patch] Adding support for MS WL Natural and MS WL Opt o usb/118098 usb 6th gen iPod causes problems when disconnecting. o usb/118374 usb Patch to support Option GlobeTrotter Max 3.6 wireless o usb/118479 usb ubsa driver does not recognize AnyDATA ADU-500A o usb/118485 usb Logitech Headset Workaround o usb/118571 usb BTX issues when booting FreeBSD 7 from a USB CD-ROM o usb/118670 usb Razer Copperhead Laser Mouse shows up as keyboard o usb/118686 usb [usbdevs] [patch] teach usbdevs / ubsa(4) about Huawei o usb/118741 usb [PATCH] Support for Nikon D300 digital camera (as USB p usb/118915 usb usbhidctl appears to not report features and write siz 122 problems total. From owner-freebsd-usb@FreeBSD.ORG Mon Dec 24 11:20:03 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0211116A418 for ; Mon, 24 Dec 2007 11:20:03 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.185]) by mx1.freebsd.org (Postfix) with ESMTP id 725DE13C457 for ; Mon, 24 Dec 2007 11:20:02 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by fk-out-0910.google.com with SMTP id b27so2389182fka.11 for ; Mon, 24 Dec 2007 03:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:message-id:from:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:sender; bh=KGvDHGtTzBJy8WeHVFJ+k9ZAVVkKVLDDVFn41r64xBM=; b=MxXzH8Qabtn9ZyYQ0yQXcLW3bXO4oQbxlgTP1L9ECsPOVmzrOWARZeV+6C6/GfMNupm8UR3zRpZpll0e+DXNkCSWMvCCFxRqSylpOULQc1OM7T3P6bqJ0NKNBBxYPYJb+R/pMEAdXAbl6fU8Z0X0ZX8Zxc4kWtnTYQcukAyzsOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:sender; b=e/T0A49/7DoJ0rXSQCGnsj6e5uTXXNOBPr3GdHKPlkA3VzkFCr0HNm39O+PPM2pmAXHxqdsTcl3ek0xbnFemmH0IyzgNCzzQa3GezjF54+5VavYVKRnOjDOS90XZ6YUXgZSETIEAV1UtbyG7gj4bry5ZNwl35l4z/kzoLHCfIJU= Received: by 10.82.105.13 with SMTP id d13mr8144648buc.30.1198493485226; Mon, 24 Dec 2007 02:51:25 -0800 (PST) Received: from epsilon.local.gmail.com ( [83.144.140.64]) by mx.google.com with ESMTPS id z37sm6420029ikz.1.2007.12.24.02.51.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2007 02:51:24 -0800 (PST) Date: Mon, 24 Dec 2007 10:50:52 +0000 Message-ID: <86mys0mkmr.wl%rpaulo@fnop.net> From: Rui Paulo To: Ed Schouten In-Reply-To: <20071224094642.GO1169@hoeg.nl> References: <20071224094642.GO1169@hoeg.nl> User-Agent: Wanderlust/2.15.5 (Almost Unreal) Emacs/22.1 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: Rui Cc: freebsd-usb@freebsd.org Subject: Re: USB keyboard translation - Apple hardware X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2007 11:20:03 -0000 At Mon, 24 Dec 2007 10:46:42 +0100, Ed Schouten wrote: > > [1 ] > Hello everyone, > > One of the things that really made me mad when I got FreeBSD working on > my Apple MacBook, was that the Fn button on the keyboard doesn't work. > This means that I don't have the Delete, Page-{Up,Down}, Home and End > buttons. > > I took a look at kbdmap(1), but it turned out you can't add any new > modifiers, which is needed in this case, because we have a new Fn > modifier key. Maybe you could solve this in X, but I also work a lot > outside of X, so I really want to have the translation to be performed > everywhere. > > I've written the following patch for ukbd, which adds a method for > easily adding translation functions to the driver, to remap keys: > > http://g-rave.nl/unix/freebsd/freebsd-ukbd-translate.diff > > I tried to keep the code as clean as possible, so I also put some > #ifdef's around it, so that people who dislike it, can just undef it. > I've only added the quirks for the Apple MacBook keyboard, but there are > some other Apple keyboards that have some strange scancodes. I still > have to add those. > > Any comments so far? I do like this approach. The Fn key is a special key that needs special handling, but there seems to be a problem with our USB stack. The code code to detect the Fn key is: Index: ukbd.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/ukbd.c,v retrieving revision 1.75 diff -u -p -r1.75 ukbd.c --- ukbd.c 5 Nov 2007 19:51:12 -0000 1.75 +++ ukbd.c 17 Dec 2007 21:24:35 -0000 @@ -110,6 +110,9 @@ struct ukbd_data { typedef struct ukbd_softc { device_t sc_dev; /* base device */ +#define UKBD_FN 0x01 + int sc_flags; + struct hid_location sc_loc_fn; /* location of the Fn key */ } ukbd_softc_t; #define UKBD_CHUNK 128 /* chunk size for read */ @@ -178,6 +181,10 @@ ukbd_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); usbd_interface_handle iface = uaa->iface; usb_interface_descriptor_t *id; + void *desc; + int size; + usbd_status err; + uint32_t flags; keyboard_switch_t *sw; keyboard_t *kbd; @@ -191,6 +198,21 @@ ukbd_attach(device_t self) id = usbd_get_interface_descriptor(iface); + /* + * Locate the Fn key on Apple keyboards. + */ + err = usbd_read_report_desc(uaa->iface, &desc, &size, M_TEMP); + if (err) { + device_printf(self, "could not read report descriptor\n"); + return ENXIO; + } + if (hid_locate(desc, size, HID_USAGE2(HUP_CUSTOM, HUC_FNKEY), + hid_input, &sc->sc_loc_fn, &flags)) { + device_printf(self, "Fn key.\n"); + sc->sc_flags |= UKBD_FN; + } + free(desc, M_TEMP); + arg[0] = (void *)uaa; arg[1] = (void *)ukbd_intr; kbd = NULL; Index: usbhid.h =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usbhid.h,v retrieving revision 1.15 diff -u -p -r1.15 usbhid.h --- usbhid.h 6 Jan 2005 01:43:29 -0000 1.15 +++ usbhid.h 22 Dec 2007 19:18:50 -0000 @@ -94,6 +94,7 @@ typedef struct usb_hid_descriptor { #define HUP_SCALE 0x008c #define HUP_CAMERA_CONTROL 0x0090 #define HUP_ARCADE 0x0091 +#define HUP_CUSTOM 0xffff #define HUP_MICROSOFT 0xff00 /* Usages, generic desktop */ @@ -165,6 +166,9 @@ typedef struct usb_hid_descriptor { #define HUD_ERASER 0x0045 #define HUD_TABLET_PICK 0x0046 +/* Usages custom */ +#define HUC_FNKEY 0x0003 + #define HID_USAGE2(p,u) (((p) << 16) | u) #define UHID_INPUT_REPORT 0x01 But the problem relies in HUP_CUSTOM. Linux seems to be using 0x00ff instead of 0xffff, but with that value, the Fn key is not detected in FreeBSD. Another problem is reading the value of the register. When a ukbd_intr() occurs, we should be able to read the register, but somehow it's always 0. In August, I mailed the original USB stack driver, but he didn't reply. I'll try to find a solution. Regards. -- Rui Paulo From owner-freebsd-usb@FreeBSD.ORG Mon Dec 24 21:20:01 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED58F16A419 for ; Mon, 24 Dec 2007 21:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B80F213C46B for ; Mon, 24 Dec 2007 21:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBOLK1pp072631 for ; Mon, 24 Dec 2007 21:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBOLK1o4072630; Mon, 24 Dec 2007 21:20:01 GMT (envelope-from gnats) Resent-Date: Mon, 24 Dec 2007 21:20:01 GMT Resent-Message-Id: <200712242120.lBOLK1o4072630@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, Steve Franks Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD17A16A417 for ; Mon, 24 Dec 2007 21:16:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id B0E0213C447 for ; Mon, 24 Dec 2007 21:16:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lBOLFwui097455 for ; Mon, 24 Dec 2007 21:15:58 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id lBOLFw0L097454; Mon, 24 Dec 2007 21:15:58 GMT (envelope-from nobody) Message-Id: <200712242115.lBOLFw0L097454@www.freebsd.org> Date: Mon, 24 Dec 2007 21:15:58 GMT From: Steve Franks To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/119002: add "ucp" driver support X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2007 21:20:02 -0000 >Number: 119002 >Category: usb >Synopsis: add "ucp" driver support >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Dec 24 21:20:01 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Steve Franks >Release: 6.2-amd64 >Organization: >Environment: FreeBSD aire.franks-development.dyndns.biz 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #1: Mon Dec 24 11:13:11 MST 2007 steve@aire.franks-development.dyndns.biz:/usr/obj/usr/src/sys/GENERIC amd64 >Description: All the *BSD's except FreeBSD apparently have support for the "ucp" device driver - Silicon Laboratories CP210x USB to UART/rs-232 bridge chip. All pertinent listserv entries are from 2006, so this has been the case for sometime. I am unable to build the module on my system due to being a n00b, so far as I can tell - others have built it successfully, although /sys/dev/usb/usbdevs must be merged manually from the diff file in circulation (http://www.dons.net.au/~darius/ucp-0.01.diff.gz) I was told to submit a PR to add this driver by several users on freebsd-questions (thread: "how to compile and install a new driver"). While the original author of the patch had reservations about the advanced functionality, as an electrical engineer using this part for several years, I find no one uses the advanced features, and the existing diff should make a fully functional driver (if I could get it to build)... >How-To-Repeat: cd /usr/src/sys patch < ucp-0.01.diff cd .. make buildkernel KERNCONF=GENERIC >Fix: unknown. Patch attached with submission follows: Index: modules/ucp/Makefile =================================================================== RCS file: modules/ucp/Makefile diff -N modules/ucp/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/ucp/Makefile 9 May 2006 00:42:24 -0000 @@ -0,0 +1,10 @@ +# $FreeBSD$ + +S= ${.CURDIR}/../.. +.PATH: $S/dev/usb + +KMOD= ucp +SRCS= ucp.c ucpreg.h opt_usb.h device_if.h bus_if.h usbdevs.h + +CFLAGS+=-DUSB_DEBUG +.include Index: dev/usb/ucp.c =================================================================== RCS file: dev/usb/ucp.c diff -N dev/usb/ucp.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dev/usb/ucp.c 9 May 2006 00:44:56 -0000 @@ -0,0 +1,590 @@ +/* + * Silicon Labs CP2101/2102 USB UART driver + * + * Based on the Linux driver written by Craig Shelley + * + * Copyright (C) 2006 Daniel O'Connor + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include "usbdevs.h" + +#include + +#include + + +#ifdef USB_DEBUG +static int ucpdebug = 0; +SYSCTL_NODE(_hw_usb, OID_AUTO, ucp, CTLFLAG_RW, 0, "USB ucp"); +SYSCTL_INT(_hw_usb_ucp, OID_AUTO, debug, CTLFLAG_RW, + &ucpdebug, 0, "ucp debug level"); +#define DPRINTF(x) do { \ + if (ucpdebug) \ + logprintf x; \ + } while (0) + +#define DPRINTFN(n, x) do { \ + if (ucpdebug > (n)) \ + logprintf x; \ + } while (0) + +#else +#define DPRINTF(x) +#define DPRINTFN(n,x) +#endif + +#define UCP_CONFIG_INDEX 0 +#define UCP_IFACE_INDEX 0 + +/* XXX: Pretty sure this is right... */ +#define UCPIBUFSIZE 64 +#define UCPOBUFSIZE 64 + +struct ucp_softc { + struct ucom_softc sc_ucom; + + usbd_interface_handle sc_iface; /* interface */ +}; + +Static int ucp_open(void *sc, int portno); +Static void ucp_close(void *sc, int portno); +Static void ucp_set(void *, int, int, int); +Static int ucp_param(void *, int, struct termios *); +Static void ucp_get_status(void *, int portno, u_char *lsr, u_char *msr); +Static void ucp_break(void *sc, int portno, int onoff); +Static int ucp_set_config(struct ucom_softc *ucom, uint8_t request, uint16_t data); +Static int ucp_get_config(struct ucom_softc *ucom, uint8_t request, uint16_t *data); + +struct ucom_callback ucp_callback = { + .ucom_get_status = ucp_get_status, + .ucom_set = ucp_set, + .ucom_param = ucp_param, + .ucom_open = ucp_open, + .ucom_close = ucp_close, +}; + +static const struct usb_devno ucp_devs[] = { + { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CRUMB128 }, + { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_DEGREE }, + { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_SUUNTO }, + { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_BURNSIDE }, + { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_HELICOM }, + { USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP2102 }, + { USB_VENDOR_PLX, USB_PRODUCT_PLX_NOKIA_CA42 } + +}; + +USB_MATCH(ucp) { + USB_MATCH_START(ucp, uaa); + + DPRINTFN(20,("ucp: vendor=0x%x, product=0x%x\n", + uaa->vendor, uaa->product)); + + if (uaa->iface != NULL) + return UMATCH_NONE; + + return (usb_lookup(ucp_devs, uaa->vendor, uaa->product) != NULL) ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE; +} + +USB_ATTACH(ucp) { + USB_ATTACH_START(ucp, sc, uaa); + usbd_device_handle dev = uaa->device; + usbd_interface_handle iface; + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed; + char *devinfo; + const char *devname; + int i; + usbd_status err; + struct ucom_softc *ucom = &sc->sc_ucom; + + DPRINTFN(10,("\nucp_attach: sc=%p\n", sc)); + devinfo = malloc(1024, M_USBDEV, M_WAITOK); + + ucom->sc_dev = self; + ucom->sc_udev = dev; + + devname = USBDEVNAME(ucom->sc_dev); + + if (uaa->iface == NULL) { + /* Move the device into the configured state. */ + err = usbd_set_config_index(dev, UCP_CONFIG_INDEX, 1); + if (err) { + printf("\n%s: failed to set configuration, err=%s\n", + devname, usbd_errstr(err)); + goto bad; + } + + err = usbd_device2interface_handle(dev, UCP_IFACE_INDEX, &iface); + if (err) { + printf("\n%s: failed to get interface, err=%s\n", + devname, usbd_errstr(err)); + goto bad; + } + } else { + iface = uaa->iface; + } + + usbd_devinfo(dev, 0, devinfo); + /* USB_ATTACH_SETUP;*/ + printf("%s: %s\n", devname, devinfo); + + id = usbd_get_interface_descriptor(iface); + ucom->sc_iface = iface; + ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1; + + for (i = 0; i < id->bNumEndpoints; i++) { + int addr, dir, attr; + ed = usbd_interface2endpoint_descriptor(iface, i); + if (ed == NULL) { + printf("%s: could not read endpoint descriptor\n", + devname); + goto bad; + } + + addr = ed->bEndpointAddress; + dir = UE_GET_DIR(ed->bEndpointAddress); + attr = ed->bmAttributes & UE_XFERTYPE; + if (dir == UE_DIR_IN && attr == UE_BULK) + ucom->sc_bulkin_no = addr; + else if (dir == UE_DIR_OUT && attr == UE_BULK) + ucom->sc_bulkout_no = addr; + else { + printf("%s: unexpected endpoint\n", devname); + goto bad; + } + } + if (ucom->sc_bulkin_no == -1) { + printf("%s: Could not find data bulk in\n", + devname); + goto bad; + } + if (ucom->sc_bulkout_no == -1) { + printf("%s: Could not find data bulk out\n", + devname); + goto bad; + } + ucom->sc_parent = sc; + if (uaa->iface == NULL) + ucom->sc_portno = 0; + + /* bulkin, bulkout set above */ + + ucom->sc_ibufsize = UCPIBUFSIZE; + ucom->sc_obufsize = UCPOBUFSIZE; + ucom->sc_ibufsizepad = UCPIBUFSIZE; + + ucom->sc_callback = &ucp_callback; +#if 0 + usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, ucom->sc_udev, + USBDEV(ucom->sc_dev)); +#endif + DPRINTF(("ucp: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no)); + ucom_attach(&sc->sc_ucom); + free(devinfo, M_USBDEV); + + USB_ATTACH_SUCCESS_RETURN; + +bad: + DPRINTF(("ucp_attach: ATTACH ERROR\n")); + ucom->sc_dying = 1; + free(devinfo, M_USBDEV); + + USB_ATTACH_ERROR_RETURN; +} + +USB_DETACH(ucp) +{ + USB_DETACH_START(ucp, sc); + + int rv = 0; + + DPRINTF(("ucp_detach: sc=%p\n", sc)); + sc->sc_ucom.sc_dying = 1; + rv = ucom_detach(&sc->sc_ucom); + + return rv; +} + +Static int +ucp_open(void *vsc, int portno) { + struct ucp_softc *sc = vsc; + struct ucom_softc *ucom = &sc->sc_ucom; + struct termios t; + + DPRINTF(("ucp_open: sc=%p\n", sc)); + + if (ucom->sc_dying) + return (EIO); + + DPRINTFN(2, ("Enabling UART\n")); + if (ucp_set_config(ucom, CP2101_UART, UART_ENABLE)) { + printf("Unable to enable UART\n"); + return(EIO); + } + + /* Set 9600 baud, 2 stop bits, no parity, 8 bits, RTS/CTS flow control */ + t.c_ospeed = 9600; + t.c_cflag = CSTOPB | CS8 | CRTSCTS; + (void)ucp_param(sc, 0, &t); + + return(0); +} + +Static void +ucp_close(void *vsc, int portno) { + struct ucp_softc *sc = vsc; + struct ucom_softc *ucom = &sc->sc_ucom; + + DPRINTF(("ucp_close: sc=%p\n", sc)); + + if (ucom->sc_dying) + return; + + DPRINTFN(2, ("Disabling UART\n")); + if (ucp_set_config(ucom, CP2101_UART, UART_DISABLE)) { + printf("Unable to disable UART\n"); + return; + } +} + +/* Set DTR/RTS or send a break */ +Static void +ucp_set(void *vsc, int portno, int reg, int onoff) { + struct ucp_softc * sc = vsc; + struct ucom_softc * ucom = &sc->sc_ucom; + uint16_t ctl; + + DPRINTF(("ucp_set: port=%d reg=%d onoff=%d\n", portno, reg, onoff)); + + switch (reg) { + case UCOM_SET_DTR: + DPRINTFN(2, ("Setting DTR\n")); + ctl = CONTROL_WRITE_DTR; + if (onoff) + ctl |= CONTROL_DTR; + else + ctl &= ~CONTROL_DTR; + break; + + case UCOM_SET_RTS: + ctl = 0; +#if 0 + DPRINTFN(2, ("Setting RTS\n")); + ctl = CONTROL_WRITE_RTS; + if (onoff) + ctl |= CONTROL_RTS; + else + ctl &= ~CONTROL_RTS; +#endif + break; + + case UCOM_SET_BREAK: + DPRINTFN(2, ("Setting BREAK\n")); + ucp_break(vsc, portno, onoff); + return; + + default: + return; + } + + (void)ucp_set_config(ucom, CP2101_CONTROL, ctl); +} + +/* Set baud rate, stop/start bits, parity etc */ +Static int +ucp_param(void *vsc, int portno, struct termios *t) { + struct ucp_softc * sc = vsc; + struct ucom_softc * ucom = &sc->sc_ucom; + int i; + uint16_t dat; + uint32_t modem_ctl[4]; +#if 1 + usb_device_request_t req; + usbd_status result; +#endif + + DPRINTF(("ucp_param: sc=%p\n", sc)); + + if (ucom->sc_dying) + return (EIO); + + switch (t->c_ospeed) { + case 300: + case 600: + case 1200: + case 2400: + case 4800: + case 9600: + case 19200: + case 38400: + case 57600: + case 115200: + if (ucp_set_config(ucom, CP2101_BAUDRATE, BAUD_RATE_GEN_FREQ / t->c_ospeed) != 0) + printf("Setting baud rate failed\n"); + + break; + + default: + printf("Invalid baud rate %d\n", t->c_ospeed); + break; + } + + if (ucp_get_config(ucom, CP2101_BITS, &dat) != 0) { + printf("Couldn't read frame format\n"); + return(EIO); + } + DPRINTFN(2,("BITS is 0x%02x\n", dat)); + + dat &= ~BITS_STOP_MASK; + if (ISSET(t->c_cflag, CSTOPB)) + dat |= BITS_STOP_2; + else + dat |= BITS_STOP_1; + + dat &= ~BITS_PARITY_MASK; + if (ISSET(t->c_cflag, PARENB)) { + if (ISSET(t->c_cflag, PARODD)) + dat |= BITS_PARITY_ODD; + else + dat |= BITS_PARITY_EVEN; + } + + dat &= ~BITS_DATA_MASK; + switch (ISSET(t->c_cflag, CSIZE)) { + case CS5: + dat |= BITS_DATA_5; + break; + case CS6: + dat |= BITS_DATA_6; + break; + case CS7: + dat |= BITS_DATA_7; + break; + case CS8: + dat |= BITS_DATA_8; + break; + } + + DPRINTFN(2,("Settings BITS to 0x%02x\n", dat)); + if (ucp_get_config(ucom, CP2101_BITS, &dat) != 0) { + printf("Couldn't set frame format\n"); + } + +#if 1 + req.bmRequestType = UT_READ_VENDOR_INTERFACE; + req.bRequest = CP2101_MODEMCTL + 1; + USETW(req.wIndex, 0); + USETW(req.wValue, 0); + USETW(req.wLength, 16); + + result = usbd_do_request(ucom->sc_udev, &req, modem_ctl); + + if (result != USBD_NORMAL_COMPLETION) { + printf("failed to get modem control registers - %d\n", result); + return(EIO); + } +#endif + for (i = 0; i < 4; i++) + modem_ctl[i] = le32toh(modem_ctl[i]); + + DPRINTFN(2, ("modem_ctl[3..0] => 0x%08x 0x%08x 0x%08x 0x%08x\n", + modem_ctl[3], modem_ctl[2], modem_ctl[1], modem_ctl[0])); + + if (ISSET(t->c_cflag, CRTSCTS)) { + DPRINTFN(2, ("Setting for RTS/CTS\n")); + modem_ctl[0] &= ~0x7B; + modem_ctl[0] |= 0x09; + modem_ctl[1] = 0x80; + } else if (ISSET(t->c_iflag, IXON|IXOFF)) { + DPRINTFN(2, ("Setting for XON/XOFF\n")); + /* XXX: what do I do here? Duplicating 'none' for now */ + modem_ctl[0] &= ~0x7B; + modem_ctl[0] |= 0x01; + modem_ctl[1] |= 0x40; + } else { + DPRINTFN(2, ("Setting for none\n")); + modem_ctl[0] &= ~0x7B; + modem_ctl[0] |= 0x01; + modem_ctl[1] |= 0x40; + } + DPRINTFN(2, ("modem_ctl[3..0] <= 0x%08x 0x%08x 0x%08x 0x%08x\n", + modem_ctl[3], modem_ctl[2], modem_ctl[1], modem_ctl[0])); + + for (i = 0; i < 4; i++) + modem_ctl[i] = htole32(modem_ctl[i]); +#if 1 + req.bmRequestType = UT_WRITE_VENDOR_INTERFACE; + req.bRequest = CP2101_MODEMCTL; + USETW(req.wIndex, 0); + USETW(req.wValue, 0); + USETW(req.wLength, 16); + + result = usbd_do_request(ucom->sc_udev, &req, modem_ctl); + + if (result != USBD_NORMAL_COMPLETION) { + printf("failed to get modem control registers - %d\n", result); + return(EIO); + } +#endif + return (0); +} + +void +ucp_get_status(void *vsc, int portno, u_char *lsr, u_char *msr) { + struct ucp_softc * sc = vsc; + struct ucom_softc * ucom = &sc->sc_ucom; + uint16_t dat; + + if (ucp_get_config(ucom, CP2101_CONTROL, &dat) != 0) { + printf("Couldn't get control information\n"); + } + + /* lsr appears to be unused in ucom */ + *lsr = 0; + *msr = ((dat & CONTROL_DCD) ? SER_DCD : 0) | + ((dat & CONTROL_CTS) ? SER_CTS : 0) | + ((dat & CONTROL_RING) ? SER_RI : 0) | + ((dat & CONTROL_DSR) ? SER_DSR : 0); + + + DPRINTF(("ucp_status: msr=0x%02x lsr=0x%02x\n", + *msr, *lsr)); +} + +/* + * ucp_break + * Set/clear the break condition + */ +void +ucp_break(void *vsc, int portno, int onoff) { + struct ucp_softc * sc = vsc; + struct ucom_softc * ucom = &sc->sc_ucom; + + DPRINTF(("ucp_break: port=%d onoff=%d\n", portno, onoff)); + + if (ucp_set_config(ucom, CP2101_BREAK, onoff ? BREAK_ON : BREAK_OFF)) + printf("Unable to change BREAK status\n"); +} + +/* + * ucp_set_config + * Writes to the CP2101 configuration registers + */ +Static int +ucp_set_config(struct ucom_softc *ucom, uint8_t request, uint16_t data) { + usb_device_request_t req; + usbd_status result; + + DPRINTFN(2,("ucp_set: request = 0x%04x <= 0x%04x\n", req.bRequest, data)); + + req.bmRequestType = UT_WRITE_VENDOR_INTERFACE; + req.bRequest = request; + USETW(req.wIndex, 0); + USETW(req.wValue, data); + USETW(req.wLength, 0); + if ((result = usbd_do_request(ucom->sc_udev, &req, NULL)) != USBD_NORMAL_COMPLETION) { + printf("failed to set config part a - %d\n", result); + return(EIO); + } + + if ((result = usbd_do_request(ucom->sc_udev, &req, NULL)) != USBD_NORMAL_COMPLETION) { + printf("failed to set config part b - %d\n", result); + return(EIO); + } + + return 0; +} + +/* + * ucp_get_config + * Reads from the CP2101 configuration registers + */ +Static int +ucp_get_config(struct ucom_softc *ucom, uint8_t request, uint16_t *data) { + usb_device_request_t req; + usbd_status result; + + req.bmRequestType = UT_READ_VENDOR_INTERFACE; + req.bRequest = request + 1; + USETW(req.wIndex, 0); + USETW(req.wValue, 0); + USETW(req.wLength, 2); + + if ((result = usbd_do_request(ucom->sc_udev, &req, data)) != USBD_NORMAL_COMPLETION) { + printf("failed to get config - %d\n", result); + return(EIO); + } + *data = le16toh(*data); + + DPRINTFN(2,("ucp_get: request = 0x%04x => 0x%04x\n", req.bRequest, *data)); + + return 0; +} + +Static device_method_t ucp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ucp_match), + DEVMETHOD(device_attach, ucp_attach), + DEVMETHOD(device_detach, ucp_detach), + + { 0, 0 } +}; + +Static driver_t ucp_driver = { + "ucom", + ucp_methods, + sizeof (struct ucp_softc) +}; + +DRIVER_MODULE(ucp, uhub, ucp_driver, ucom_devclass, usbd_driver_load, 0); +MODULE_DEPEND(ucp, usb, 1, 1, 1); +MODULE_DEPEND(ucp, ucom,UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ Index: dev/usb/ucpreg.h =================================================================== RCS file: dev/usb/ucpreg.h diff -N dev/usb/ucpreg.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dev/usb/ucpreg.h 9 May 2006 00:35:32 -0000 @@ -0,0 +1,61 @@ +/* $FreeBSD$ */ + +/* + * Definitions for the SI Labs CP 2101/2102 + */ + +/* Config SET requests. To GET, add 1 to the request number */ +#define CP2101_UART 0x00 /* Enable / Disable */ +#define CP2101_BAUDRATE 0x01 /* (BAUD_RATE_GEN_FREQ / baudrate) */ +#define CP2101_BITS 0x03 /* 0x(0)(databits)(parity)(stopbits) */ +#define CP2101_BREAK 0x05 /* On / Off */ +#define CP2101_CONTROL 0x07 /* Flow control line states */ +#define CP2101_MODEMCTL 0x13 /* Modem controls */ +#define CP2101_CONFIG_6 0x19 /* 6 bytes of config data ??? */ + +/* CP2101_UART */ +#define UART_ENABLE 0x0001 +#define UART_DISABLE 0x0000 + +/* CP2101_BAUDRATE */ +#define BAUD_RATE_GEN_FREQ 0x384000 + +/* CP2101_BITS */ +#define BITS_DATA_MASK 0X0f00 +#define BITS_DATA_5 0X0500 +#define BITS_DATA_6 0X0600 +#define BITS_DATA_7 0X0700 +#define BITS_DATA_8 0X0800 +#define BITS_DATA_9 0X0900 + +#define BITS_PARITY_MASK 0x00f0 +#define BITS_PARITY_NONE 0x0000 +#define BITS_PARITY_ODD 0x0010 +#define BITS_PARITY_EVEN 0x0020 +#define BITS_PARITY_MARK 0x0030 +#define BITS_PARITY_SPACE 0x0040 + +#define BITS_STOP_MASK 0x000f +#define BITS_STOP_1 0x0000 +#define BITS_STOP_1_5 0x0001 +#define BITS_STOP_2 0x0002 + +/* CP2101_BREAK */ +#define BREAK_ON 0x0000 +#define BREAK_OFF 0x0001 + +/* CP2101_CONTROL */ +#define CONTROL_DTR 0x0001 +#define CONTROL_RTS 0x0002 +#define CONTROL_CTS 0x0010 +#define CONTROL_DSR 0x0020 +#define CONTROL_RING 0x0040 +#define CONTROL_DCD 0x0080 +#define CONTROL_WRITE_DTR 0x0100 +#define CONTROL_WRITE_RTS 0x0200 + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ Index: dev/usb/usbdevs =================================================================== RCS file: /usr/CVS-Repository/src/sys/dev/usb/usbdevs,v retrieving revision 1.255 diff -u -r1.255 usbdevs --- dev/usb/usbdevs 27 Feb 2006 01:01:27 -0000 1.255 +++ dev/usb/usbdevs 9 May 2006 00:44:27 -0000 @@ -493,6 +493,7 @@ vendor CCYU 0x1065 CCYU vendor PLX 0x10b5 PLX vendor ASANTE 0x10bd Asante +vendor SILABS 0x10c4 SI Labs vendor JRC 0x1145 JRC vendor DELORME 0x1163 DeLorme vendor SERVERWORKS 0x1166 ServerWorks @@ -1360,6 +1361,7 @@ /* PLX products */ product PLX TESTBOARD 0x9060 test board +product PLX NOKIA_CA42 0xac70 Nokia CA-42 USB /* PNY products */ product PNY ATTACHE2 0x0010 USB 2.0 Flash Drive @@ -1478,6 +1480,14 @@ product SIIG WINTERREADER 0x0330 WINTERREADER Reader product SIIG2 US2308 0x0421 Serial +/* SI Labs */ +product SILABS CRUMB128 0x807a Crumb128 board +product SILABS DEGREE 0x80ca Degree Controls Inc +product SILABS SUUNTO 0x80f6 Suunto Sports Instrument +product SILABS BURNSIDE 0x813d Burnside Telecon Deskmobile +product SILABS HELICOM 0x815e Helicomm IP-Link 1220-DVM +product SILABS CP2102 0xea60 SILABS USB UART + /* Silicon Portals Inc. */ product SILICONPORTALS YAPPH_NF 0x0200 YAP Phone (no firmware) product SILICONPORTALS YAPPHONE 0x0201 YAP Phone >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Tue Dec 25 11:26:48 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C74D316A420 for ; Tue, 25 Dec 2007 11:26:48 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id EEE8213C468 for ; Tue, 25 Dec 2007 11:26:47 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id B7DBF74401A; Tue, 25 Dec 2007 13:26:45 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rU40FdpHXUMn; Tue, 25 Dec 2007 13:26:45 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 5E081744004; Tue, 25 Dec 2007 13:26:45 +0200 (EET) Message-ID: <4770E8F4.1020705@icyb.net.ua> Date: Tue, 25 Dec 2007 13:26:44 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: remko@elvandar.org References: <20170.194.74.82.3.1196153704.squirrel@galain.elvandar.org> In-Reply-To: <20170.194.74.82.3.1196153704.squirrel@galain.elvandar.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: 7.0-BETA3 kernel panic when unplugging USB stick X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2007 11:26:48 -0000 on 27/11/2007 10:55 Remko Lodder said the following: > [snip] > >> Just in case: >> the reader - Trust CR-1420P >> the card - SanDisk SDSDM-2048 > > The above information is not really informative for me , can you send a > dmesg -v and pciconf -vl so that we might trick it into getting supported > by the current drivers? :) >From usbdevs -vd: Controller /dev/usb1: addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), nVidia(0x0000), rev 1.00 uhub1 ... port 4 addr 2: high speed, power 100 mA, config 1, product 0x6362(0x6362), vendor 0x058f(0x058f), rev 1.26 umass0 >From dmesg: umass0: Generic Mass Storage Device, rev 2.00/1.26, addr 2 umass0: BBB reset failed, IOERROR umass0: BBB bulk-in clear stall failed, IOERROR umass0: BBB bulk-out clear stall failed, IOERROR umass0: BBB reset failed, IOERROR umass0: BBB bulk-in clear stall failed, IOERROR umass0: BBB bulk-out clear stall failed, IOERROR umass0: BBB reset failed, IOERROR umass0: BBB bulk-in clear stall failed, IOERROR umass0: BBB bulk-out clear stall failed, IOERROR umass0: BBB reset failed, IOERROR umass0: BBB bulk-in clear stall failed, IOERROR umass0: BBB bulk-out clear stall failed, IOERROR umass0: BBB reset failed, IOERROR umass0: BBB bulk-in clear stall failed, IOERROR umass0: BBB bulk-out clear stall failed, IOERROR umass0: BBB reset failed, IOERROR umass0: BBB bulk-in clear stall failed, IOERROR umass0: BBB bulk-out clear stall failed, IOERROR (da0:umass-sim0:0:0:0): got CAM status 0x4 (da0:umass-sim0:0:0:0): fatal error, failed to attach to device (da0:umass-sim0:0:0:0): lost device >From pciconf- lv: ehci0@pci0:11:1: class=0x0c0320 card=0x81c01043 chip=0x026e10de rev=0xa3 hdr=0x00 vendor = 'NVIDIA Corporation' class = serial bus subclass = USB >From camcontrol devlist -v: scbus6 on umass-sim0 bus 0: at scbus6 target 0 lun 0 (da0,pass2) < > at scbus6 target 0 lun 2 (probe0) < > at scbus6 target -1 lun -1 () -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 25 11:28:45 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FA0416A418 for ; Tue, 25 Dec 2007 11:28:45 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id CF58613C467 for ; Tue, 25 Dec 2007 11:28:44 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 39F08744009 for ; Tue, 25 Dec 2007 13:04:00 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PgRFATYh27YB for ; Tue, 25 Dec 2007 13:04:00 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id D0CCF744004 for ; Tue, 25 Dec 2007 13:03:59 +0200 (EET) Message-ID: <4770E39E.8050402@icyb.net.ua> Date: Tue, 25 Dec 2007 13:03:58 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: unnoticed disconnect X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2007 11:28:45 -0000 I have a strange problem - when I disconnect a certain USB card reader its umass* and da* devices are not removed, there is complete silence in the system log and usbdevs -vd still shows it as connected. Restarting usbd and/or running usbd -e doesn't change anything. If I reconnect the device there is zero reaction as well and da* devices are unusable (any access produces several BBB ... IOERROR). But if attach another USB device (e.g. USB flash drive) while the reader is disconnected then the system notices that it's actually gone and performs all the necessary disconnect actions. This is quite weird for me. My question if this is something most likely caused by software or something caused by the hardware. And if the latter - what is most likely at fault: the reader, connecting cable, physical port, hub ? -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 25 11:45:25 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1848716A41B for ; Tue, 25 Dec 2007 11:45:25 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id D64B213C45B for ; Tue, 25 Dec 2007 11:45:24 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 9561574400C for ; Tue, 25 Dec 2007 13:13:00 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JJvB2b8qmeRG for ; Tue, 25 Dec 2007 13:13:00 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 541E1744004 for ; Tue, 25 Dec 2007 13:13:00 +0200 (EET) Message-ID: <4770E5BB.4090100@icyb.net.ua> Date: Tue, 25 Dec 2007 13:12:59 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: freebsd-usb@freebsd.org References: <4770E39E.8050402@icyb.net.ua> In-Reply-To: <4770E39E.8050402@icyb.net.ua> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: unnoticed disconnect X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2007 11:45:25 -0000 on 25/12/2007 13:03 Andriy Gapon said the following: > I have a strange problem - when I disconnect a certain USB card reader > its umass* and da* devices are not removed, there is complete silence in > the system log and usbdevs -vd still shows it as connected. > Restarting usbd and/or running usbd -e doesn't change anything. > If I reconnect the device there is zero reaction as well and da* devices > are unusable (any access produces several BBB ... IOERROR). > But if attach another USB device (e.g. USB flash drive) while the reader > is disconnected then the system notices that it's actually gone and > performs all the necessary disconnect actions. > > This is quite weird for me. My question if this is something most likely > caused by software or something caused by the hardware. And if the > latter - what is most likely at fault: the reader, connecting cable, > physical port, hub ? > Additional fact: it seems that I can produce the effect with ~80% on port 1 and port 2 of hub 1 and so far I couldn't reproduce it at all on port 8 of the same hub. This is after about the same number of attempts on all three ports. The only difference is that port 1 and port 2 are at the rear panel and port 8 is at the front. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Tue Dec 25 23:00:02 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E60416A41A for ; Tue, 25 Dec 2007 23:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3457F13C465 for ; Tue, 25 Dec 2007 23:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBPN02kR074946 for ; Tue, 25 Dec 2007 23:00:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBPN02D2074945; Tue, 25 Dec 2007 23:00:02 GMT (envelope-from gnats) Resent-Date: Tue, 25 Dec 2007 23:00:02 GMT Resent-Message-Id: <200712252300.lBPN02D2074945@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, Ivan Good Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0448916A417 for ; Tue, 25 Dec 2007 22:59:17 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id DCEBD13C459 for ; Tue, 25 Dec 2007 22:59:16 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lBPMwgEt056357 for ; Tue, 25 Dec 2007 22:58:42 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id lBPMwgb6056356; Tue, 25 Dec 2007 22:58:42 GMT (envelope-from nobody) Message-Id: <200712252258.lBPMwgb6056356@www.freebsd.org> Date: Tue, 25 Dec 2007 22:58:42 GMT From: Ivan Good To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/119018: HP ScanJet 4300C found as knowndev but not recognized by any driver, Olympus C350 also doesn't work X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2007 23:00:02 -0000 >Number: 119018 >Category: usb >Synopsis: HP ScanJet 4300C found as knowndev but not recognized by any driver, Olympus C350 also doesn't work >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Dec 25 23:00:01 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Ivan Good >Release: 7.0-BETA4 >Organization: TU Berlin >Environment: FreeBSD sub.ruller.net 7.0-BETA4 FreeBSD 7.0-BETA4 #4: Tue Dec 25 23;02:08 UTC 2007 root@sub.ruller.net:/usr/obj/usr/src/sys/NOTEBOOK i386 Notebook is "Dell Latitude C840" >Description: Dear Friends! I have noticed some inconsistencies in usb-device-handling. My main Problem (0) was: if I connect my usb-scanner "HP ScanJet 4300C" (officially listed in uscanner(4) as supported device), it is recognized as known device, but usbd fails to attach it with the following message (kernel option USB_DEBUG is set): usbd_new_device bus=0xc25e1000 port=1 depth=1 speed=2 usbd_new_device: adding unig addr=2, rev=100, class=0, subclass=0, protocol=0, maxpacket=8, len=18, speed=2 usbd_new_device: new dev (addr 2), dev=0xc286c480, parent=0xc259bb80 //value of devinfo after calling usbd_devinfo(dev,1,devinfo) is: //"Hewlett Packard Scanjet 4300C, class 0/0, rev 1.00/0.00, addr 2" usbd_probe_and_attach: no device specific driver found usbd_probe_and_attach: looping over 1 configurations uhub0: port 1, set config at addr 2 failed, error=STALLED usbd_remove_device: 0xc286c480 uhub_explore: usb_new_device failed, error=STALLED uhub0: device problem (STALLED), disabling port 1 ------------- 1)I have compiled my usb_subr.c with -DUSBVERBOSE set and there were some more problems to review: CHICONY2 and AIPTEK2 vendors were not declared! ------------- 2)And the last one: as I plugged my "Olympus C-350" digital camera, it caused a kernel panic (page fault while in kernel mode, code = "supervisor read, page not present"). If the camera is plugged in before the start, system refuses to boot. ------------- Many people would be thankful if the problems would be fixed in the next version ;-) Best regards, Ivan Good >How-To-Repeat: 0)Ask the developer of the 4300C-interface to connect the scanner and try to work with it. 1)Try to compile /usr/src/sys/dev/usb/usb_subr.c with defined USBVERBOSE option. 2)Connect the C-350 Olympus camera. >Fix: No known fixes available. The problem seems to be rather old as I found many unanswered questions about it in several forums on the net. >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 00:10:05 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07F8016A421 for ; Wed, 26 Dec 2007 00:10:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C532A13C45D for ; Wed, 26 Dec 2007 00:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBQ0A4hA024103 for ; Wed, 26 Dec 2007 00:10:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBQ0A4uO024101; Wed, 26 Dec 2007 00:10:04 GMT (envelope-from gnats) Date: Wed, 26 Dec 2007 00:10:04 GMT Message-Id: <200712260010.lBQ0A4uO024101@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: "Steve Franks" Cc: Subject: Re: usb/119002: add "ucp" driver support X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Steve Franks List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 00:10:05 -0000 The following reply was made to PR usb/119002; it has been noted by GNATS. From: "Steve Franks" To: bug-followup@freebsd.org Cc: Subject: Re: usb/119002: add "ucp" driver support Date: Tue, 25 Dec 2007 16:44:17 -0700 Oh, in the interest of being a good Samaritan, I have lots of boards with this chipset in my scrap pile - if an official FreeBSD developer needs one for testing, please contact me, and I'll get it in your hands asap. Steve From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 00:10:06 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D0D816A419 for ; Wed, 26 Dec 2007 00:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE7513C442 for ; Wed, 26 Dec 2007 00:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBQ0A6am024150 for ; Wed, 26 Dec 2007 00:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBQ0A6TM024149; Wed, 26 Dec 2007 00:10:06 GMT (envelope-from gnats) Date: Wed, 26 Dec 2007 00:10:06 GMT Message-Id: <200712260010.lBQ0A6TM024149@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: "Steve Franks" Cc: Subject: Re: usb/119002: add "ucp" driver support X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Steve Franks List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 00:10:06 -0000 The following reply was made to PR usb/119002; it has been noted by GNATS. From: "Steve Franks" To: bug-followup@FreeBSD.org, stevefranks@ieee.org Cc: Subject: Re: usb/119002: add "ucp" driver support Date: Tue, 25 Dec 2007 16:41:10 -0700 Sucess! I have built and proven that the ucp.ko driver works with all my various work and hobby projects using the Silicon Laboratories CP2101, CP2102, and CP2103 devices. There are alot of other off-the-shelf OEM devices using this chipset, which allow for different VID's & PID's (see the patch file) - I was obviously unable to test them as I only have the manufacturer's reference design style hardware, but there is no way to modify the operation of the chipset except for the VID & PID, so I assume they will work fine if FreeBSD recognizes the VID & PID - not a usb expert. Test was performed with Minicom talking to /dev/cuaU0; after kldload ucp, plugging in a CP210x yields "ucom0" in dmesg, and cuaU0 in /dev. I think my earlier problem was due to the patch mucking the system - if run from /usr/src/sys, it doesn't create the modules/ucp folder like it should, don't know why. Here's what I did that worked: 1. /usr/src/sys/dev/usb# patch < ~/ucp-0.01.diff 2. /usr/src/sys/dev/usb# mkdir /usr/src/sys/modules/ucp 3. /usr/src/sys/dev/usb# mv Makefile /usr/src/sys/modules/ucp 3a. Once you have proven it works, you might want to remove the -DEBUG line from this makefile (I did up front, never tested with debug symbols/code on my system) 4. manually edit /usr/src/sys/dev/usb/usbdevs to fix the patch collision and add all the new lines (specifically vendor SILABS 0x10c4 Silicon labs) 5. manually edit /usr/src/sys/modules/Makefile to add the line: ucp \ after the line ucom \ 6. build & install kernel Incidentally, since I cvsup'd to clean up my previous mess, I am now on 6.3-xxx, but I don't think that was a factor in making it work. Also, note that step 5 is not in the diff file at all for some reason, as opposed to step 4 which simply didn't patch in automatically. Best, Steve From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 03:04:31 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFE6C16A419 for ; Wed, 26 Dec 2007 03:04:31 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by mx1.freebsd.org (Postfix) with ESMTP id 4836B13C44B for ; Wed, 26 Dec 2007 03:04:31 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so1838100uge.37 for ; Tue, 25 Dec 2007 19:04:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:message-id:from:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:sender; bh=UCxwe7+n6kCj9baE3qu0CoBVSLrxNDb9HCRqGkUSvDQ=; b=JGtekD1NZ+iwYGAcglWBNMUOMZRaUse5zY25+V1EDn5L713cDLuljM7AH0QRaibgAUjVbIL0o1tLzYC5rW15Paj1ybeSOGWhsLxvrw/Bz4+oq+pxY00tNCmTJqMn69bDtI7H0V+/l/B2SqBSCuYEj/3iXlRsgI2ZlJWxSzdEpaQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:sender; b=mh4eeHenGp7cmeqaPsDgQ01Mmrn60zG9zns2i522Eb6zpYSJFJV68y37f7ChSNQLnZZxJkAtwZZBOkQjzSbaYDjdNhpLHtWXAV++1+1yWZZBmIBOJGbwaXxEh/IRXyHg3Sa4HXpgX7CyoKDeffb7GbVeLr2EyzZBR++BfLsgfyU= Received: by 10.67.21.11 with SMTP id y11mr4304301ugi.10.1198638269508; Tue, 25 Dec 2007 19:04:29 -0800 (PST) Received: from epsilon.local.gmail.com ( [83.144.140.64]) by mx.google.com with ESMTPS id c24sm2589387ika.10.2007.12.25.19.04.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Dec 2007 19:04:28 -0800 (PST) Date: Wed, 26 Dec 2007 03:03:52 +0000 Message-ID: <86wsr2rwbr.wl%rpaulo@fnop.net> From: Rui Paulo To: Ed Schouten In-Reply-To: <86mys0mkmr.wl%rpaulo@fnop.net> References: <20071224094642.GO1169@hoeg.nl> <86mys0mkmr.wl%rpaulo@fnop.net> User-Agent: Wanderlust/2.15.5 (Almost Unreal) Emacs/22.1 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: Rui Cc: freebsd-usb@freebsd.org Subject: Re: USB keyboard translation - Apple hardware X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 03:04:31 -0000 At Mon, 24 Dec 2007 10:50:52 +0000, Rui Paulo wrote: > > At Mon, 24 Dec 2007 10:46:42 +0100, > Ed Schouten wrote: > > > > [1 ] > > Hello everyone, > > > > One of the things that really made me mad when I got FreeBSD working on > > my Apple MacBook, was that the Fn button on the keyboard doesn't work. > > This means that I don't have the Delete, Page-{Up,Down}, Home and End > > buttons. > > > > I took a look at kbdmap(1), but it turned out you can't add any new > > modifiers, which is needed in this case, because we have a new Fn > > modifier key. Maybe you could solve this in X, but I also work a lot > > outside of X, so I really want to have the translation to be performed > > everywhere. > > > > I've written the following patch for ukbd, which adds a method for > > easily adding translation functions to the driver, to remap keys: > > > > http://g-rave.nl/unix/freebsd/freebsd-ukbd-translate.diff > > > > I tried to keep the code as clean as possible, so I also put some > > #ifdef's around it, so that people who dislike it, can just undef it. > > I've only added the quirks for the Apple MacBook keyboard, but there are > > some other Apple keyboards that have some strange scancodes. I still > > have to add those. > > > > Any comments so far? > > I do like this approach. Oops, I mean "I don't like this approach" Sorry. -- Rui Paulo From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 05:38:13 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3E2D16A41B; Wed, 26 Dec 2007 05:38:13 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.freebsd.org (Postfix) with ESMTP id 9750413C47E; Wed, 26 Dec 2007 05:38:13 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.14.1/8.14.1) with ESMTP id lBQ5cCdb001790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Dec 2007 00:38:12 -0500 (EST) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by aldan.algebra.com (8.14.1/8.14.1/Submit) id lBQ5cBUf001789; Wed, 26 Dec 2007 00:38:11 -0500 (EST) (envelope-from mi+kde@aldan.algebra.com) From: Mikhail Teterin To: Mike Tancsa Date: Wed, 26 Dec 2007 00:38:11 -0500 User-Agent: KMail/1.9.7 References: <200712212341.44308@aldan> <200712221313.lBMDDx5M036478@lava.sentex.ca> In-Reply-To: <200712221313.lBMDDx5M036478@lava.sentex.ca> X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Cc: stable@freebsd.org, freebsd-usb@freebsd.org Subject: Re: usb/umass, devfs: this sucks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 05:38:14 -0000 On =D3=D5=C2=CF=D4=C1 22 =C7=D2=D5=C4=C5=CE=D8 2007, Mike Tancsa wrote: =3D Perhaps its the one card reader you are using is particularly=20 =3D problematic ? I have been using the multi-type cheapo reader below=20 =3D for some time Perhaps. But /nothing/ excuses devfs hanging for 25 minutes. Nothing. It=20 should be more resilient to such problems. It should be possible to interru= pt=20 a hung operation too. =3D We go through the following steps when using it. =9AWe always plug the= =20 =3D reader in without a card. Then we put the card in and do a =3D cat /dev/null > /dev/da1 =3D ... or whatever the device is. =9AIts been quite reliable this way for = us. =3D The other caveat is never to pull the card or reader when its mounted. Yes, I go through these steps too and am also aware of the caveat(s). And i= t=20 sucks (see Subject), that one has to keep all of this in mind in order to=20 perform a trivial operation: transfer a few pictures from a media card to=20 their home directory. If we want people to give FreeBSD a try in good faith, it is both profoundl= y=20 stupid and dishonest on our part to claim, we have a working USB-system... = It=20 does not matter, how great our buffer-sharing VM is, if a home user can't=20 process their photos with a FreeBSD-powered computer. -mi From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 07:36:20 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87CD316A420; Wed, 26 Dec 2007 07:36:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 52B9E13C46E; Wed, 26 Dec 2007 07:36:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBQ7VNGm021122; Wed, 26 Dec 2007 00:31:23 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 26 Dec 2007 00:35:47 -0700 (MST) Message-Id: <20071226.003547.-932932005.imp@bsdimp.com> To: mi+kde@aldan.algebra.com From: "M. Warner Losh" In-Reply-To: <200712260038.11546@aldan> References: <200712212341.44308@aldan> <200712221313.lBMDDx5M036478@lava.sentex.ca> <200712260038.11546@aldan> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org, freebsd-usb@freebsd.org Subject: Re: usb/umass, devfs: this sucks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 07:36:20 -0000 In message: <200712260038.11546@aldan> Mikhail Teterin writes: : If we want people to give FreeBSD a try in good faith, it is both profoundly : stupid and dishonest on our part to claim, we have a working USB-system... It : does not matter, how great our buffer-sharing VM is, if a home user can't : process their photos with a FreeBSD-powered computer. In an ideal world, it would be perfect. However, all the USB hardware I've recently purchased actually does work without a hitch on my FreeBSD system. Older card readers are more problematic. Rather than complain about the system, how about merging RELENG_7's usb stack to RELENG_6? Or fixing a few bugs from the PRs that are filed? I did my time in a big push for 7.0, maybe some other people can help out a little too? Warner From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 15:33:51 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A382516A479 for ; Wed, 26 Dec 2007 15:33:51 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 3046F13C50A for ; Wed, 26 Dec 2007 15:33:51 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id C12CB74400D; Wed, 26 Dec 2007 17:33:49 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d5eEUNOPYtcm; Wed, 26 Dec 2007 17:33:49 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 3BC60744004; Wed, 26 Dec 2007 17:33:49 +0200 (EET) Message-ID: <4772745A.6030508@icyb.net.ua> Date: Wed, 26 Dec 2007 17:33:46 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: remko@elvandar.org References: <20170.194.74.82.3.1196153704.squirrel@galain.elvandar.org> <4770E8F4.1020705@icyb.net.ua> In-Reply-To: <4770E8F4.1020705@icyb.net.ua> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: 7.0-BETA3 kernel panic when unplugging USB stick X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 15:33:51 -0000 Below was info when the reader was connected already with the troublesome SD card inserted. Here's info when the same reader is connected without any media: demsg: umass0: Generic Mass Storage Device, rev 2.00/1.26, addr 2 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 40.000MB/s transfers da0: Attempt to query device size failed: NOT READY, Medium not present Opened disk da0 -> 6 da1 at umass-sim0 bus 0 target 0 lun 1 da1: Removable Direct Access SCSI-0 device da1: 40.000MB/s transfers da1: Attempt to query device size failed: NOT READY, Medium not present Opened disk da1 -> 6 da2 at umass-sim0 bus 0 target 0 lun 2 da2: Removable Direct Access SCSI-0 device da2: 40.000MB/s transfers da2: Attempt to query device size failed: NOT READY, Medium not present Opened disk da2 -> 6 da3 at umass-sim0 bus 0 target 0 lun 3 da3: Removable Direct Access SCSI-0 device da3: 40.000MB/s transfers da3: Attempt to query device size failed: NOT READY, Medium not present Opened disk da3 -> 6 camcontrol: scbus6 on umass-sim0 bus 0: at scbus6 target 0 lun 0 (da0,pass2) at scbus6 target 0 lun 1 (da1,pass3) at scbus6 target 0 lun 2 (da2,pass4) at scbus6 target 0 lun 3 (da3,pass5) usbdevs: port 4 addr 2: high speed, power 100 mA, config 1, Mass Storage Device(0x6362), Generic(0x058f), rev 1.26 on 25/12/2007 13:26 Andriy Gapon said the following: > on 27/11/2007 10:55 Remko Lodder said the following: >> [snip] >> >>> Just in case: >>> the reader - Trust CR-1420P >>> the card - SanDisk SDSDM-2048 >> The above information is not really informative for me , can you send a >> dmesg -v and pciconf -vl so that we might trick it into getting supported >> by the current drivers? :) > > From usbdevs -vd: > Controller /dev/usb1: > addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), > nVidia(0x0000), rev 1.00 > uhub1 > ... > port 4 addr 2: high speed, power 100 mA, config 1, product > 0x6362(0x6362), vendor 0x058f(0x058f), rev 1.26 > umass0 > > From dmesg: > umass0: Generic Mass Storage Device, rev 2.00/1.26, addr 2 > umass0: BBB reset failed, IOERROR > umass0: BBB bulk-in clear stall failed, IOERROR > umass0: BBB bulk-out clear stall failed, IOERROR > umass0: BBB reset failed, IOERROR > umass0: BBB bulk-in clear stall failed, IOERROR > umass0: BBB bulk-out clear stall failed, IOERROR > umass0: BBB reset failed, IOERROR > umass0: BBB bulk-in clear stall failed, IOERROR > umass0: BBB bulk-out clear stall failed, IOERROR > umass0: BBB reset failed, IOERROR > umass0: BBB bulk-in clear stall failed, IOERROR > umass0: BBB bulk-out clear stall failed, IOERROR > umass0: BBB reset failed, IOERROR > umass0: BBB bulk-in clear stall failed, IOERROR > umass0: BBB bulk-out clear stall failed, IOERROR > umass0: BBB reset failed, IOERROR > umass0: BBB bulk-in clear stall failed, IOERROR > umass0: BBB bulk-out clear stall failed, IOERROR > (da0:umass-sim0:0:0:0): got CAM status 0x4 > (da0:umass-sim0:0:0:0): fatal error, failed to attach to device > (da0:umass-sim0:0:0:0): lost device > > From pciconf- lv: > ehci0@pci0:11:1: class=0x0c0320 card=0x81c01043 chip=0x026e10de > rev=0xa3 hdr=0x00 > vendor = 'NVIDIA Corporation' > class = serial bus > subclass = USB > > From camcontrol devlist -v: > scbus6 on umass-sim0 bus 0: > at scbus6 target 0 lun 0 (da0,pass2) > < > at scbus6 target 0 lun 2 (probe0) > < > at scbus6 target -1 lun -1 () > -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 17:35:05 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9EE916A41A; Wed, 26 Dec 2007 17:35:05 +0000 (UTC) (envelope-from henrik@gulbra.net) Received: from av12-1-sn2.hy.skanova.net (av12-1-sn2.hy.skanova.net [81.228.8.185]) by mx1.freebsd.org (Postfix) with ESMTP id 1934A13C442; Wed, 26 Dec 2007 17:35:05 +0000 (UTC) (envelope-from henrik@gulbra.net) Received: by av12-1-sn2.hy.skanova.net (Postfix, from userid 502) id 2808838D02; Wed, 26 Dec 2007 18:16:51 +0100 (CET) Received: from smtp4-1-sn2.hy.skanova.net (smtp4-1-sn2.hy.skanova.net [81.228.8.92]) by av12-1-sn2.hy.skanova.net (Postfix) with ESMTP id 11BB438C90; Wed, 26 Dec 2007 18:16:51 +0100 (CET) Received: from [192.168.0.2] (81-235-156-87-no29.tbcn.telia.com [81.235.156.87]) by smtp4-1-sn2.hy.skanova.net (Postfix) with ESMTP id 7DDFB37E44; Wed, 26 Dec 2007 18:16:48 +0100 (CET) From: Henrik Gulbrandsen To: "M. Warner Losh" , Mikhail Teterin In-Reply-To: <20071226.003547.-932932005.imp@bsdimp.com> References: <200712212341.44308@aldan> <200712221313.lBMDDx5M036478@lava.sentex.ca> <200712260038.11546@aldan> <20071226.003547.-932932005.imp@bsdimp.com> Content-Type: text/plain Date: Wed, 26 Dec 2007 18:15:16 +0100 Message-Id: <1198689316.1119.382.camel@Particle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org, freebsd-usb@freebsd.org Subject: Re: usb/umass, devfs: this sucks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 17:35:05 -0000 On Wed, 2007-12-26 at 00:35 -0700, M. Warner Losh wrote: > In message: <200712260038.11546@aldan> > Mikhail Teterin writes: > : If we want people to give FreeBSD a try in good faith, it is both profoundly > : stupid and dishonest on our part to claim, we have a working USB-system... It > : does not matter, how great our buffer-sharing VM is, if a home user can't > : process their photos with a FreeBSD-powered computer. > > In an ideal world, it would be perfect. > > However, all the USB hardware I've recently purchased actually does > work without a hitch on my FreeBSD system. Older card readers are > more problematic. > > Rather than complain about the system, how about merging RELENG_7's > usb stack to RELENG_6? Or fixing a few bugs from the PRs that are > filed? I did my time in a big push for 7.0, maybe some other people > can help out a little too? Fixing and merging are good, but it seems to me (as an occasional patch contributor without commit privileges) that the bottleneck for USB is still in the handling of incoming patches. At the moment, there are 162 USB PRs to close. Out of these, 103 are marked with "[patch]", but only 42 of those are actually in "patched" state. Almost all of the latter were apparently handled as part of Warner's summer push. The USB stack has to deal with many third-party devices, most of which will not be immediately available for testing by FreeBSD developers. This means that we are more or less forced to rely on external patch contributors (such as myself) to provide workarounds for the problems caused by various hardware peculiarities. Usually, it shouldn't take more than a basic code review to accept these patches, so this would be a good place to start if you want to improve USB handling in FreeBSD. Look at it from my perspective: I would be happy to complete my fix for the infamous five-year-old usb/46176, so people can finally detach umass devices without having to manually unmount them first. However, it will undoubtedly take a non-trivial amount of time to reproduce and eliminate the remaining issues. I'm more likely to put in that effort if I believe that my patches may actually end up in CURRENT, but if a one-line fix such as that in usb/78984 has not been applied after more than a year, how long will it take for patches that involve multiple subsystems? /Henrik From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 18:37:34 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD89A16A419; Wed, 26 Dec 2007 18:37:34 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (lefty.soaustin.net [66.135.55.46]) by mx1.freebsd.org (Postfix) with ESMTP id A9E9D13C467; Wed, 26 Dec 2007 18:37:34 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: by mail.soaustin.net (Postfix, from userid 502) id A5CEC8C0E7; Wed, 26 Dec 2007 12:04:15 -0600 (CST) Date: Wed, 26 Dec 2007 12:04:15 -0600 To: Henrik Gulbrandsen Message-ID: <20071226180415.GA27409@soaustin.net> References: <200712212341.44308@aldan> <200712221313.lBMDDx5M036478@lava.sentex.ca> <200712260038.11546@aldan> <20071226.003547.-932932005.imp@bsdimp.com> <1198689316.1119.382.camel@Particle> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1198689316.1119.382.camel@Particle> User-Agent: Mutt/1.5.13 (2006-08-11) From: linimon@lonesome.com (Mark Linimon) Cc: freebsd-usb@freebsd.org, stable@freebsd.org, Mikhail Teterin , freebsd-bugbusters@FreeBSD.org Subject: PR backlog [was: Re: usb/umass, devfs: this sucks] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 18:37:35 -0000 On Wed, Dec 26, 2007 at 06:15:16PM +0100, Henrik Gulbrandsen wrote: > Fixing and merging are good, but it seems to me (as an occasional patch > contributor without commit privileges) that the bottleneck for USB is > still in the handling of incoming patches [...] if a one-line fix > such as that in usb/78984 has not been applied after more than a year, > how long will it take for patches that involve multiple subsystems? I'll put on my bugmeister hat for a moment. First, I share your frustration. Second, unfortunately, it's not just USB. We suffer from this problem in several other areas, notably, patches for the userland utilities ("bin"). There are two interrelated problems that create a chicken-and-egg situation: - the PR tool is insufficient for our needs; - there's not a "culture" of going and fixing bugs outside of the code one usually works on. As for 1), once the releases are out, I intend to start working on defining what "our needs" are. As I've stated before in other places, until we understand those, and get community buy-in to define an actual "process" rather than just a particular PR system, it's unwise just to change the PR system. (IMHO, there's no reason to further automate a process that doesn't work correctly.) I hope to have something concrete to present at BSDCan in May. As for 2), I've scratched my head for what to do about that for a while, and not been able to make much progress. Here's what we've tried: - The creation of a weekly posting "bugs the bugmeister team thinks are ready for commit". This doesn't seem to have attracted the desired attention. Perhaps this is a problem of "push" not being the right solution here; perhaps it just hasn't been publicized enough. - The creation of a hack for classifying PRs, the "[tag]" convention. This is simply working around the weakness of the tool. However, it is sufficient to be able to generate weekly email sorting the PRs by tag, and another email showing only PRs with patches, also sorted by tag. If you are a committer, it's also possible to run queries via: ~gnats/tools/showwithtag to get a summary. - Trying to get more traffic on the freebsd-bugbusters@ mailing list. - Trying to create some interest in #freebsd-bugbusters on EFNet on IRC. This has not attracted enough committers to be viable yet. - Holding some "bugathons" (idea stolen from NetBSD) where we try to get committers to come onto the IRC channel at particular weekends to try to interactively work through PRs. This had some success, but we have not done one in a while. The odd thing is that for ports, the existing PR system -- plus, most importantly, the hacks we've added on top of it -- works reasonably well. - Each port has an explicit "maintainer" field (even though many of the entries are null). Most of the src codebase does not, therefore no one in particular "owns" it. - We've taken advantage of that to layer a PR auto-assigner on top, that also sets things to 'feedback'. - portsmon is also able to track PRs by the port they affect, and semi- weekly reminder emails are sent out. But the first of these items is really particular to ports. Also, more ports PRs than src PRs are upgrades/bugfixes, rather than true bug reports that need substantial investigation (in fact, the ratio is probably exactly reversed). This means we can clear a proportionally larger number of ports PRs. All of this has helped get the port PR count down over the last several years, to the point where it no longer seems as overwhelming as the backlog in the other areas. The size of the backlog creates a substantial disincentive to try to fix a handful -- thus perpeturating the cycle. What we all need to understand is that the PR count will never be at zero; if we can instead settle for a steady-state, where the most concrete PRs can be worked on as they arrive, then I'll feel we've have made great progress. Unfortunately I don't have any brilliant insights as to how to make the work more interesting; most of my ideas have the focus of simply making it less frustrating. I'll throw the floor open for brainstorming at this point. mcl From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 18:43:01 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7224616A419; Wed, 26 Dec 2007 18:43:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3A38C13C46B; Wed, 26 Dec 2007 18:43:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBQIbsJE033930; Wed, 26 Dec 2007 11:37:54 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 26 Dec 2007 11:42:24 -0700 (MST) Message-Id: <20071226.114224.-432836428.imp@bsdimp.com> To: linimon@lonesome.com From: "M. Warner Losh" In-Reply-To: <20071226180415.GA27409@soaustin.net> References: <20071226.003547.-932932005.imp@bsdimp.com> <1198689316.1119.382.camel@Particle> <20071226180415.GA27409@soaustin.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org, freebsd-usb@freebsd.org, mi+kde@aldan.algebra.com, freebsd-bugbusters@freebsd.org Subject: Re: PR backlog X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 18:43:01 -0000 Mark and Henrik make a number of good points here. Rather than reply to the details, I'm going to make a couple of quick observations. As a project we're not leveraging the community sufficiently when it comes to contributions. The current system of patch review and submission is very hap-hazard. If you happen to get the attention of the right person at the right time, then it goes in. If not, patches can languish a long time in the PR system. The PR system is also the wrong tool for the job. While Mark touches on the cultural issues in play, they are exacerbated by the misapplication of a problem system to be a patch submission and tracking system. Maybe we need to adopt a practice from the Linux community. At least for arm kernel patches, there is a two step process: submit it to a mailing list for review and refinement, with the second step being submitting it into a queue. I'm not sure the details we need to be successful in the FreeBSD project. Many of the USB patches in the PR system I left alone because I didn't have the time and/or knowledge to evaluate them for inclusion, or I saw something obviously wrong in the patch. When I was trying to just get through the obviously trivial patches. Warner From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 18:48:44 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26F3E16A419; Wed, 26 Dec 2007 18:48:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E61C213C474; Wed, 26 Dec 2007 18:48:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBQIhfWD034032; Wed, 26 Dec 2007 11:43:41 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 26 Dec 2007 11:48:12 -0700 (MST) Message-Id: <20071226.114812.1649771240.imp@bsdimp.com> To: henrik@gulbra.net From: "M. Warner Losh" In-Reply-To: <1198689316.1119.382.camel@Particle> References: <200712260038.11546@aldan> <20071226.003547.-932932005.imp@bsdimp.com> <1198689316.1119.382.camel@Particle> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: stable@FreeBSD.org, freebsd-usb@FreeBSD.org, mi+kde@aldan.algebra.com Subject: Re: usb/umass, devfs: this sucks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 18:48:44 -0000 In message: <1198689316.1119.382.camel@Particle> Henrik Gulbrandsen writes: : Look at it from my perspective: I would be happy to complete my fix for : the infamous five-year-old usb/46176, so people can finally detach umass : devices without having to manually unmount them first. However, it will : undoubtedly take a non-trivial amount of time to reproduce and eliminate : the remaining issues. There's no patches in this bug. : I'm more likely to put in that effort if I believe : that my patches may actually end up in CURRENT, but if a one-line fix : such as that in usb/78984 has not been applied after more than a year, : how long will it take for patches that involve multiple subsystems? The patch in this bug is wrong. There are devices that are an odd number of sectors. This is one of the places where the obvious patch isn't necessarily right. Warner From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 20:42:54 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A8F16A419 for ; Wed, 26 Dec 2007 20:42:54 +0000 (UTC) (envelope-from r.neese@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id 8D81413C44B for ; Wed, 26 Dec 2007 20:42:54 +0000 (UTC) (envelope-from r.neese@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so4810541pyb.3 for ; Wed, 26 Dec 2007 12:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; bh=jTdumm6m1wJKAk5cvw2DWv8SCyxF9QsuKiHd7yVO0M8=; b=LkSvrY4L9aiZ2sqjprM3sAGas/80/+atZX/2qj4aY2AZIBja9SwQGfUxdSI2F0ThD9K/5doTEJWQGZQtrZJPe5qju98J5OS/fooUC88ZFSuBVo6Gd3Dr3A5a3cAoPNFYedXZeNvyqChLIZ/rBpOKhaZ36X/1lrQPFS4GrFJoTtA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=GAm9cmF6s4MXcEwz88jO+hjI3HqukwTSVL+yItpKHvV+l9uZN98TDvSUOmS9EpiGunegyWNWRDCZ83Q4EkMY7Mw2wMTovdWr6d6Rvvw0gZmtA/dZoYOvA/sRakCHSxZIypjv5fEdzU2G8nwJmbJdCMHlr+4MG81pwYEW9x7+rkQ= Received: by 10.142.102.5 with SMTP id z5mr2139582wfb.15.1198701772699; Wed, 26 Dec 2007 12:42:52 -0800 (PST) Received: from laptop.deamonswitch.org ( [69.234.208.201]) by mx.google.com with ESMTPS id h18sm28007727wxd.18.2007.12.26.12.42.50 (version=SSLv3 cipher=OTHER); Wed, 26 Dec 2007 12:42:52 -0800 (PST) From: Richard Neese To: freebsd-usb@freebsd.org Date: Wed, 26 Dec 2007 12:43:06 -0800 User-Agent: KMail/1.9.7 References: <20071226.003547.-932932005.imp@bsdimp.com> <20071226180415.GA27409@soaustin.net> <20071226.114224.-432836428.imp@bsdimp.com> In-Reply-To: <20071226.114224.-432836428.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712261243.08351.r.neese@gmail.com> Cc: linimon@lonesome.com, stable@freebsd.org, mi+kde@aldan.algebra.com, freebsd-bugbusters@freebsd.org Subject: Re: PR backlog X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: r.neese@gmail.com List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 20:42:54 -0000 I agree with this and there is also the 2nd issue of commiters not responding to those working on updating ports. Point and Fax I have emaile Sobomax about fixing and updating the asterisk ports. and have sent patches but never got a reply in 9 months. If your going to be a maintainer you need to respond to those working on projects already in ports. On December 26, 2007 10:42:24 am M. Warner Losh wrote: > Mark and Henrik make a number of good points here. Rather than reply > to the details, I'm going to make a couple of quick observations. > > As a project we're not leveraging the community sufficiently when it > comes to contributions. The current system of patch review and > submission is very hap-hazard. If you happen to get the attention of > the right person at the right time, then it goes in. If not, patches > can languish a long time in the PR system. > > The PR system is also the wrong tool for the job. While Mark touches > on the cultural issues in play, they are exacerbated by the > misapplication of a problem system to be a patch submission and > tracking system. Maybe we need to adopt a practice from the Linux > community. At least for arm kernel patches, there is a two step > process: submit it to a mailing list for review and refinement, with > the second step being submitting it into a queue. I'm not sure the > details we need to be successful in the FreeBSD project. > > Many of the USB patches in the PR system I left alone because I didn't > have the time and/or knowledge to evaluate them for inclusion, or I > saw something obviously wrong in the patch. When I was trying to just > get through the obviously trivial patches. > > 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" -- Welcome to the World. An the World gets smaller. From owner-freebsd-usb@FreeBSD.ORG Wed Dec 26 23:58:17 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8530716A417; Wed, 26 Dec 2007 23:58:17 +0000 (UTC) (envelope-from henrik@gulbra.net) Received: from av9-2-sn2.hy.skanova.net (av9-2-sn2.hy.skanova.net [81.228.8.180]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9BE13C447; Wed, 26 Dec 2007 23:58:17 +0000 (UTC) (envelope-from henrik@gulbra.net) Received: by av9-2-sn2.hy.skanova.net (Postfix, from userid 502) id 808EF37ED4; Thu, 27 Dec 2007 00:58:15 +0100 (CET) Received: from smtp4-2-sn2.hy.skanova.net (smtp4-2-sn2.hy.skanova.net [81.228.8.93]) by av9-2-sn2.hy.skanova.net (Postfix) with ESMTP id 6ADC737E64; Thu, 27 Dec 2007 00:58:15 +0100 (CET) Received: from [192.168.0.2] (81-235-156-87-no29.tbcn.telia.com [81.235.156.87]) by smtp4-2-sn2.hy.skanova.net (Postfix) with ESMTP id CDF1337E44; Thu, 27 Dec 2007 00:58:14 +0100 (CET) From: Henrik Gulbrandsen To: "M. Warner Losh" In-Reply-To: <20071226.114812.1649771240.imp@bsdimp.com> References: <200712260038.11546@aldan> <20071226.003547.-932932005.imp@bsdimp.com> <1198689316.1119.382.camel@Particle> <20071226.114812.1649771240.imp@bsdimp.com> Content-Type: text/plain Date: Thu, 27 Dec 2007 00:56:43 +0100 Message-Id: <1198713403.1119.414.camel@Particle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: stable@FreeBSD.org, freebsd-usb@FreeBSD.org, mi+kde@aldan.algebra.com Subject: Re: usb/umass, devfs: this sucks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 23:58:17 -0000 On Wed, 2007-12-26 at 11:48 -0700, M. Warner Losh wrote: > In message: <1198689316.1119.382.camel@Particle> > Henrik Gulbrandsen writes: > : Look at it from my perspective: I would be happy to complete my fix for > : the infamous five-year-old usb/46176, so people can finally detach umass > : devices without having to manually unmount them first. However, it will > : undoubtedly take a non-trivial amount of time to reproduce and eliminate > : the remaining issues. > > There's no patches in this bug. Correct. I was hoping to have a complete fix before making any official announcements, especially since the approach may be a bit controversial. Fixing underlying issues one by one is not necessarily as clean as doing a complete redesign, but it's pretty efficient and good for merging too. The patches to CURRENT were described in this post to the USB list: http://lists.freebsd.org/pipermail/freebsd-usb/2007-November/004127.html > : I'm more likely to put in that effort if I believe > : that my patches may actually end up in CURRENT, but if a one-line fix > : such as that in usb/78984 has not been applied after more than a year, > : how long will it take for patches that involve multiple subsystems? > > The patch in this bug is wrong. There are devices that are an odd > number of sectors. This is one of the places where the obvious patch > isn't necessarily right. You're right. I realized that myself right after I sent the first email. The patch was already two years old when I submitted it, and I guess I must have focused a little too much on solid-state devices with "large" megabytes, where the sector count is very likely to be a power of two. The patch can be written as a quirk fix for this specific umass device, but (as I've mentioned elsewhere) I'd prefer something that handles the entire category of problems at once. Perhaps an extra line containing "if (is_power_of_two(maxsector))" could be a working compromise, but this can be discussed in a smaller setting than the current one. /Henrik From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 00:45:44 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB8E716A41A; Thu, 27 Dec 2007 00:45:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 808B213C468; Thu, 27 Dec 2007 00:45:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBR0em5f039673; Wed, 26 Dec 2007 17:40:48 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 26 Dec 2007 17:45:23 -0700 (MST) Message-Id: <20071226.174523.1326317191.imp@bsdimp.com> To: henrik@gulbra.net From: "M. Warner Losh" In-Reply-To: <1198713403.1119.414.camel@Particle> References: <1198689316.1119.382.camel@Particle> <20071226.114812.1649771240.imp@bsdimp.com> <1198713403.1119.414.camel@Particle> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: stable@FreeBSD.org, freebsd-usb@FreeBSD.org, mi+kde@aldan.algebra.com Subject: Re: usb/umass, devfs: this sucks X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 00:45:44 -0000 In message: <1198713403.1119.414.camel@Particle> Henrik Gulbrandsen writes: : On Wed, 2007-12-26 at 11:48 -0700, M. Warner Losh wrote: : > In message: <1198689316.1119.382.camel@Particle> : > Henrik Gulbrandsen writes: : > : Look at it from my perspective: I would be happy to complete my fix for : > : the infamous five-year-old usb/46176, so people can finally detach umass : > : devices without having to manually unmount them first. However, it will : > : undoubtedly take a non-trivial amount of time to reproduce and eliminate : > : the remaining issues. : > : > There's no patches in this bug. : : Correct. I was hoping to have a complete fix before making any official : announcements, especially since the approach may be a bit controversial. : Fixing underlying issues one by one is not necessarily as clean as doing : a complete redesign, but it's pretty efficient and good for merging too. : : The patches to CURRENT were described in this post to the USB list: : http://lists.freebsd.org/pipermail/freebsd-usb/2007-November/004127.html These patches look good on their surface, but I want to analyse them in more detail. I had recalled seeing something like this, but I couldn't turn it up in my searching of PR database recently. I'd forgotten it was in the usb list... There's problems even when you just pop the flash card out of the adapter.. I'll see if these fix those or not... : > : I'm more likely to put in that effort if I believe : > : that my patches may actually end up in CURRENT, but if a one-line fix : > : such as that in usb/78984 has not been applied after more than a year, : > : how long will it take for patches that involve multiple subsystems? : > : > The patch in this bug is wrong. There are devices that are an odd : > number of sectors. This is one of the places where the obvious patch : > isn't necessarily right. : : You're right. I realized that myself right after I sent the first email. : The patch was already two years old when I submitted it, and I guess I : must have focused a little too much on solid-state devices with "large" : megabytes, where the sector count is very likely to be a power of two. : : The patch can be written as a quirk fix for this specific umass device, : but (as I've mentioned elsewhere) I'd prefer something that handles the : entire category of problems at once. Perhaps an extra line containing : "if (is_power_of_two(maxsector))" could be a working compromise, but : this can be discussed in a smaller setting than the current one. There's already a quirk for this problem that has been applied to the few devices that it affects. Maybe we need to add one more to the list? There was also talk of forcing a read to the last sector if the sector count was odd, but it never got past talk. Interestingly enough, I found the fact that FreeBSD's dd worked while Linux's didn't at a NIST analysis of forensic tools presented at a conference years ago. Warner From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 00:58:59 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B57B16A41B; Thu, 27 Dec 2007 00:58:59 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (lefty.soaustin.net [66.135.55.46]) by mx1.freebsd.org (Postfix) with ESMTP id E28F313C448; Thu, 27 Dec 2007 00:58:58 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: by mail.soaustin.net (Postfix, from userid 502) id 5DA858C126; Wed, 26 Dec 2007 18:58:58 -0600 (CST) Date: Wed, 26 Dec 2007 18:58:58 -0600 To: Richard Neese Message-ID: <20071227005858.GA7902@soaustin.net> References: <20071226.003547.-932932005.imp@bsdimp.com> <20071226180415.GA27409@soaustin.net> <20071226.114224.-432836428.imp@bsdimp.com> <200712261243.08351.r.neese@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200712261243.08351.r.neese@gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: linimon@lonesome.com (Mark Linimon) Cc: stable@freebsd.org, mi+kde@aldan.algebra.com, freebsd-bugbusters@freebsd.org, freebsd-usb@freebsd.org, linimon@lonesome.com Subject: Re: PR backlog X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 00:58:59 -0000 On Wed, Dec 26, 2007 at 12:43:06PM -0800, Richard Neese wrote: > Point and Fax I have emaile Sobomax about fixing and updating the asterisk > ports. and have sent patches but never got a reply in 9 months. For situations like this you need to email portmgr@. We already have defined parameters for resetting inactive maintainers. mcl From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 09:01:04 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EDEB16A420; Thu, 27 Dec 2007 09:01:04 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from galain.elvandar.org (galain.elvandar.org [217.148.169.56]) by mx1.freebsd.org (Postfix) with ESMTP id 0666A13C457; Thu, 27 Dec 2007 09:01:03 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from localhost.we-dare.net ([127.0.0.1] helo=galain.elvandar.org) by galain.elvandar.org with esmtpa (Exim 4.67) (envelope-from ) id 1J7oKa-000O13-06; Thu, 27 Dec 2007 09:43:08 +0100 Received: from 194.74.82.3 (SquirrelMail authenticated user remko) by galain.elvandar.org with HTTP; Thu, 27 Dec 2007 09:43:08 +0100 (CET) Message-ID: <18754.194.74.82.3.1198744988.squirrel@galain.elvandar.org> In-Reply-To: <20071226.114224.-432836428.imp@bsdimp.com> References: <20071226.003547.-932932005.imp@bsdimp.com> <1198689316.1119.382.camel@Particle> <20071226180415.GA27409@soaustin.net> <20071226.114224.-432836428.imp@bsdimp.com> Date: Thu, 27 Dec 2007 09:43:08 +0100 (CET) From: "Remko Lodder" To: "M. Warner Losh" User-Agent: SquirrelMail/1.4.13 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: stable@freebsd.org, freebsd-usb@freebsd.org, freebsd-bugbusters@freebsd.org, mi+kde@aldan.algebra.com, linimon@lonesome.com Subject: Re: PR backlog X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: remko@elvandar.org List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 09:01:04 -0000 Hello Warner et all, On Wed, December 26, 2007 7:42 pm, M. Warner Losh wrote: > Mark and Henrik make a number of good points here. Rather than reply > to the details, I'm going to make a couple of quick observations. > > As a project we're not leveraging the community sufficiently when it > comes to contributions. The current system of patch review and > submission is very hap-hazard. If you happen to get the attention of > the right person at the right time, then it goes in. If not, patches > can languish a long time in the PR system. Indeed, I am one of the persons trying to find these relatively easy things which I can do along side my other projects and things, but I dont see them all (eventhough I try to keep track of them as much as possible); but what will happen is that I learn more and more about the system and at some point in time I will "stop" working on these easy PR's and seeking more difficult ones to fix, at that point someone else has to step up to fill in the gap that gets created; this might be a problematic part :-) Though for everyone having simple fixes, please send them to me so that I can evaluate them and (together with Warner in this case (As my mentor)) I will try to get them in as correctly and quickly as possible :-) (keeping up with the high standards of FreeBSD ofcourse). > > The PR system is also the wrong tool for the job. While Mark touches > on the cultural issues in play, they are exacerbated by the > misapplication of a problem system to be a patch submission and > tracking system. Maybe we need to adopt a practice from the Linux > community. At least for arm kernel patches, there is a two step > process: submit it to a mailing list for review and refinement, with > the second step being submitting it into a queue. I'm not sure the > details we need to be successful in the FreeBSD project. > > Many of the USB patches in the PR system I left alone because I didn't > have the time and/or knowledge to evaluate them for inclusion, or I > saw something obviously wrong in the patch. When I was trying to just > get through the obviously trivial patches. > > Warner Some things that I think need to be done by the bugbuster/bugmeister team and additional people is a constant effort to keep track of the incoming tickets; Mark does a great job at that, and I try to helpout as much as possible there, but we are all busy every now and then and then a backlog on processing the incoming tickets gets created and we loose the "battle" :-) This is where you (the reader) can get in and try to help us with that, so that we can properly assign the tickets, and try to keep track of them so that they can get resolved as soon as possible. Though, some complains are that we are not fast enough etc, I think we need to make sure that everyone keeps understanding that we are a Voluntary project, and that we have resources at unknown times and dates, a committer can be active the one day, and remain inactive the rest of the week; that's a side effect on the project being based on volunteers; we did a good job so far with that, but every now and then something slips in between. What we should do at that point is not ranting around as I see happen sometimes, but instead try to get the bugbusters / bugmeister team involved so that we can see what other options are available, sometimes we can succeed in and sometimes we cannot; but dont keep the problem to yourself and the "assigned" person because that might not work :-) Just my E 0,02 :-) -- /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 15:00:55 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C406B16A474; Thu, 27 Dec 2007 15:00:55 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.freebsd.org (Postfix) with ESMTP id 6CC2E13C4FA; Thu, 27 Dec 2007 15:00:55 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.14.1/8.14.1) with ESMTP id lBRF0p4t078039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Dec 2007 10:00:52 -0500 (EST) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by aldan.algebra.com (8.14.1/8.14.1/Submit) id lBRF0pAo078038; Thu, 27 Dec 2007 10:00:51 -0500 (EST) (envelope-from mi+kde@aldan.algebra.com) From: Mikhail Teterin To: "M. Warner Losh" Date: Thu, 27 Dec 2007 10:00:50 -0500 User-Agent: KMail/1.9.7 References: <20071226.003547.-932932005.imp@bsdimp.com> <20071226180415.GA27409@soaustin.net> <20071226.114224.-432836428.imp@bsdimp.com> In-Reply-To: <20071226.114224.-432836428.imp@bsdimp.com> X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Cc: stable@freebsd.org, freebsd-bugbusters@freebsd.org, freebsd-usb@freebsd.org Subject: Re: PR backlog X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 15:00:55 -0000 On =D3=C5=D2=C5=C4=C1 26 =C7=D2=D5=C4=C5=CE=D8 2007, M. Warner Losh wrote: =3D As a project we're not leveraging the community sufficiently when it =3D comes to contributions. =9AThe current system of patch review and =3D submission is very hap-hazard. =9AIf you happen to get the attention of =3D the right person at the right time, then it goes in. =9AIf not, patches =3D can languish a long time in the PR system. This is /generally/ true, and has been for years. However, the USB-part of= =20 =46reeBSD is in a /particularly/ bad shape, so something USB-specific may b= e in=20 order. There is talk about a "whole new" USB reimplementation, and somebody is=20 working in the Perforce nirvana-land on it. Maybe, that work needs a closer= =20 look by other experts so as to bring it to the FreeBSD masses faster... -mi From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 15:55:10 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C877416A419; Thu, 27 Dec 2007 15:55:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6C213C474; Thu, 27 Dec 2007 15:55:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBRFmLMU053735; Thu, 27 Dec 2007 08:48:21 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 27 Dec 2007 08:52:47 -0700 (MST) Message-Id: <20071227.085247.1723236220.imp@bsdimp.com> To: mi+kde@aldan.algebra.com From: "M. Warner Losh" In-Reply-To: <200712271000.50995@aldan> References: <20071226180415.GA27409@soaustin.net> <20071226.114224.-432836428.imp@bsdimp.com> <200712271000.50995@aldan> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: base64 Cc: stable@freebsd.org, freebsd-bugbusters@freebsd.org, freebsd-usb@freebsd.org Subject: Re: PR backlog X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 15:55:10 -0000 SW4gbWVzc2FnZTogPDIwMDcxMjI3MTAwMC41MDk5NUBhbGRhbj4NCiAgICAgICAgICAgIE1pa2hh aWwgVGV0ZXJpbiA8bWkra2RlQGFsZGFuLmFsZ2VicmEuY29tPiB3cml0ZXM6DQo6IE9uINGB0LXR gNC10LTQsCAyNiDQs9GA0YPQtNC10L3RjCAyMDA3LCBNLiBXYXJuZXIgTG9zaCB3cm90ZToNCjog PSBBcyBhIHByb2plY3Qgd2UncmUgbm90IGxldmVyYWdpbmcgdGhlIGNvbW11bml0eSBzdWZmaWNp ZW50bHkgd2hlbiBpdA0KOiA9IGNvbWVzIHRvIGNvbnRyaWJ1dGlvbnMuIO+/vVRoZSBjdXJyZW50 IHN5c3RlbSBvZiBwYXRjaCByZXZpZXcgYW5kDQo6ID0gc3VibWlzc2lvbiBpcyB2ZXJ5IGhhcC1o YXphcmQuIO+/vUlmIHlvdSBoYXBwZW4gdG8gZ2V0IHRoZSBhdHRlbnRpb24gb2YNCjogPSB0aGUg cmlnaHQgcGVyc29uIGF0IHRoZSByaWdodCB0aW1lLCB0aGVuIGl0IGdvZXMgaW4uIO+/vUlmIG5v dCwgcGF0Y2hlcw0KOiA9IGNhbiBsYW5ndWlzaCBhIGxvbmcgdGltZSBpbiB0aGUgUFIgc3lzdGVt Lg0KOiANCjogVGhpcyBpcyAvZ2VuZXJhbGx5LyB0cnVlLCBhbmQgaGFzIGJlZW4gZm9yIHllYXJz LiBIb3dldmVyLCB0aGUgVVNCLXBhcnQgb2YgDQo6IEZyZWVCU0QgaXMgaW4gYSAvcGFydGljdWxh cmx5LyBiYWQgc2hhcGUsIHNvIHNvbWV0aGluZyBVU0Itc3BlY2lmaWMgbWF5IGJlIGluIA0KOiBv cmRlci4NCg0KVXN1YWxseSB0aGF0J3MgY2FsbGVkIGEgbWFpbnRhaW5lciwgYnV0IHdlIGhhdmVu J3QgaGFkIGEgcmVhbCBvbmUgaW4gYQ0KbG9uZyB0aW1lLiAgT3IgZXZlbiBhIGZha2Ugb25lLiAg VGhhdCdzIHdoYXQgaXQgd291bGQgdGFrZSB0byBzb2x2ZQ0KdGhlIHByb2JsZW0uDQoNCjogVGhl cmUgaXMgdGFsayBhYm91dCBhICJ3aG9sZSBuZXciIFVTQiByZWltcGxlbWVudGF0aW9uLCBhbmQg c29tZWJvZHkgaXMgDQo6IHdvcmtpbmcgaW4gdGhlIFBlcmZvcmNlIG5pcnZhbmEtbGFuZCBvbiBp dC4gTWF5YmUsIHRoYXQgd29yayBuZWVkcyBhIGNsb3NlciANCjogbG9vayBieSBvdGhlciBleHBl cnRzIHNvIGFzIHRvIGJyaW5nIGl0IHRvIHRoZSBGcmVlQlNEIG1hc3NlcyBmYXN0ZXIuLi4NCg0K Tm93IHlvdSBhcmUgYmVpbmcgaW5zdWx0aW5nIGhlcmUuICBUaGVyZSBhcmUgcGVvcGxlIGxvb2tp bmcgYXQgSGFucycNCm5ldyBzdGFjaywgYW5kIGhhdmUgaWRlbnRpZmllZCBhIGZldyBpc3N1ZXMg d2l0aCBpdC4gIEhhbnMnIGlzIHdvcmtpbmcNCm9uIHRoZSBpc3N1ZXMgaWRlbnRpZmllZCwgYW5k IGV2ZW4gcHJvdmlkZXMgc25hcHNob3RzIGZyb20gdGltZSB0bw0KdGltZSBmb3IgcGVvcGxlIHRv IHRyeS4NCg0KV2FybmVyDQo= From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 16:40:03 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7943F16A41A for ; Thu, 27 Dec 2007 16:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6E65113C448 for ; Thu, 27 Dec 2007 16:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBRGe3TF014896 for ; Thu, 27 Dec 2007 16:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBRGe3Is014895; Thu, 27 Dec 2007 16:40:03 GMT (envelope-from gnats) Date: Thu, 27 Dec 2007 16:40:03 GMT Message-Id: <200712271640.lBRGe3Is014895@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: dfilter@FreeBSD.org (dfilter service) Cc: Subject: Re: usb/46176: commit references a PR X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 16:40:03 -0000 The following reply was made to PR usb/46176; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: usb/46176: commit references a PR Date: Thu, 27 Dec 2007 16:38:34 +0000 (UTC) imp 2007-12-27 16:38:29 UTC FreeBSD src repository Modified files: sys/kern vfs_bio.c vfs_mount.c Log: A partial solution to some of the 'pull the umass device with a mounted FS' problems. These are more along the lines of 'avoiding an avoidable panic' than a complete solution to removable devices. We now close the barn door after the horse has gotten lose and has been hit by a truck, as it were. The barn no longer catches fire in this case, but the horse is still dead :-). The vfs_bio.c fix causes us not to put a failed write back into the dirty pool if the error returned was ENXIO. In that case, the buffer is treated like any other clean buffer that's being retured. ENXIO means the device isn't there anymore and will never be there again in the future, so retrying is futile. The vfs_mount.c fix treats 'ENXIO' as success for unmounting a file system. If the device is gone, retrying later won't help and we'll never be able to unmount the device. These two are part of a larger patch set submitted by the author. The other patches will be forth coming. I added comments to these two patches. Submitted by: Henrik Gulbrandsen Reviewed by: phk@ PR: usb/46176 (partial) Revision Changes Path 1.531 +4 -0 src/sys/kern/vfs_bio.c 1.269 +7 -2 src/sys/kern/vfs_mount.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 17:34:00 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F343B16A41B; Thu, 27 Dec 2007 17:33:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B899713C465; Thu, 27 Dec 2007 17:33:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBRHSv9S054884; Thu, 27 Dec 2007 10:28:57 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 27 Dec 2007 10:33:27 -0700 (MST) Message-Id: <20071227.103327.-749251578.imp@bsdimp.com> To: mi+mill@aldan.algebra.com From: "M. Warner Losh" In-Reply-To: <200712271216.22436.mi+mill@aldan.algebra.com> References: <200712271000.50995@aldan> <20071227.085247.1723236220.imp@bsdimp.com> <200712271216.22436.mi+mill@aldan.algebra.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable Cc: stable@FreeBSD.org, freebsd-usb@FreeBSD.org, mi+kde@aldan.algebra.com, freebsd-bugbusters@FreeBSD.org Subject: Re: USB issues (not just Re: PR backlog) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 17:34:00 -0000 In message: <200712271216.22436.mi+mill@aldan.algebra.com> Mikhail Teterin writes: : =DE=C5=D4=D7=C5=D2 27 =C7=D2=D5=C4=C5=CE=D8 2007 10:52 =C4=CF, M. War= ner Losh =F7=C9 =CE=C1=D0=C9=D3=C1=CC=C9: : > Usually that's called a maintainer, but we haven't had a real one i= n a : > long time. Or even a fake one. : = : Well, you responded to me earlier suggesting, I take it upon myself t= o merge = : USB-advancements from 7.x to 6.x. That implied, somebody did somethin= g for = : 7.x, did not it? Can that body (whoever they are) not put on the vaca= nt = : USB-maintainer hat and push the fixes/improvements into 6.x (preferab= ly -- = : before the 6.3 is released unto the world)? If not that same person, = then, = : maybe, the people, whom you mention below as "looking at Hans' new st= ack", = : can do the merging? I did the bulk of the work for the 7.0 stuff, at least getting things into the tree. Since I did the work, my last job got totally insane and then I switched jobs. I don't have the time needed to do this. : But if somebody is, indeed, working on a new USB stack, that's : terrific news. It also implies, we might get a USB-maintainer some : time soon. I just want it soon/er/, because it has been far too long : already... We can all agree that this is long overdue. But we need to make sure of a few critical details so we don't create another mess for ourselves down the line. Warner From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 17:43:08 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0316D16A419 for ; Thu, 27 Dec 2007 17:43:08 +0000 (UTC) (envelope-from mi+mill@aldan.algebra.com) Received: from mail3.sea5.speakeasy.net (mail3.sea5.speakeasy.net [69.17.117.5]) by mx1.freebsd.org (Postfix) with ESMTP id C2DE813C4D1 for ; Thu, 27 Dec 2007 17:43:07 +0000 (UTC) (envelope-from mi+mill@aldan.algebra.com) Received: (qmail 4524 invoked from network); 27 Dec 2007 17:16:27 -0000 Received: from aldan.algebra.com (HELO aldan-mlp) ([216.254.65.224]) (envelope-sender ) by mail3.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 27 Dec 2007 17:16:26 -0000 From: Mikhail Teterin To: "M. Warner Losh" Date: Thu, 27 Dec 2007 12:16:20 -0500 User-Agent: KMail/1.7.1 References: <20071226180415.GA27409@soaustin.net> <200712271000.50995@aldan> <20071227.085247.1723236220.imp@bsdimp.com> In-Reply-To: <20071227.085247.1723236220.imp@bsdimp.com> Organization: Virtual Estates, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200712271216.22436.mi+mill@aldan.algebra.com> Cc: stable@freebsd.org, freebsd-usb@freebsd.org, mi+kde@aldan.algebra.com, freebsd-bugbusters@freebsd.org Subject: USB issues (not just Re: PR backlog) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 17:43:08 -0000 =D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80 27 =D0=B3=D1=80=D1=83=D0=B4=D0=B5=D0= =BD=D1=8C 2007 10:52 =D0=B4=D0=BE, M. Warner Losh =D0=92=D0=B8 =D0=BD=D0=B0= =D0=BF=D0=B8=D1=81=D0=B0=D0=BB=D0=B8: > Usually that's called a maintainer, but we haven't had a real one in a > long time. Or even a fake one. Well, you responded to me earlier suggesting, I take it upon myself to merg= e=20 USB-advancements from 7.x to 6.x. That implied, somebody did something for= =20 7.x, did not it? Can that body (whoever they are) not put on the vacant=20 USB-maintainer hat and push the fixes/improvements into 6.x (preferably --= =20 before the 6.3 is released unto the world)? If not that same person, then,= =20 maybe, the people, whom you mention below as "looking at Hans' new stack",= =20 can do the merging? > : There is talk about a "whole new" USB reimplementation, and somebody is > : working in the Perforce nirvana-land on it. Maybe, that work needs a > : closer look by other experts so as to bring it to the FreeBSD masses > : faster... > Now you are being insulting here. =C2=A0There are people looking at Hans' > new stack, and have identified a few issues with it. =C2=A0Hans' is worki= ng > on the issues identified, and even provides snapshots from time to > time for people to try. I sure hope, you were joking about the "insulting" part. I don't see anythi= ng=20 in my words, that's in any way disparaging or insulting. What troubles me,= =20 however, is that this new work is being done in that ivory tower called=20 "perforce". Nothing against that particular revision-control system, but th= e =20 =46reeBSD work "in perforce" in the past tended to take /years/ to be merge= d=20 into the project's official repository -- CVS. Probably, because the actual= =20 development is far more thrilling, than the mundane merging from on=20 repository to another... But if somebody is, indeed, working on a new USB stack, that's terrific new= s.=20 It also implies, we might get a USB-maintainer some time soon. I just want = it=20 soon/er/, because it has been far too long already... I am with FreeBSD since early ninetees (and don't need refreshers on how we= =20 are a volunteer project). But I can't remember another case of a subsystem= =20 being so broken for so long -- through so many releases. -mi From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 17:54:47 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADE3616A419; Thu, 27 Dec 2007 17:54:47 +0000 (UTC) (envelope-from mteterin@mlp.com) Received: from outbound-mail.mlp.com (outbound-mail.mlp.com [204.212.175.37]) by mx1.freebsd.org (Postfix) with ESMTP id 4148B13C442; Thu, 27 Dec 2007 17:54:47 +0000 (UTC) (envelope-from mteterin@mlp.com) Received: from misha (Not Verified[10.5.105.98]) by outbound-mail.mlp.com with MailMarshal (v6, 1, 5, 586) id ; Thu, 27 Dec 2007 12:39:24 -0500 From: Mikhail Teterin To: "M. Warner Losh" Date: Thu, 27 Dec 2007 12:39:21 -0500 User-Agent: KMail/1.7.1 References: <200712271000.50995@aldan> <200712271216.22436.mi+mill@aldan.algebra.com> <20071227.103327.-749251578.imp@bsdimp.com> In-Reply-To: <20071227.103327.-749251578.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200712271239.23558.mteterin@mlp.com> Cc: stable@freebsd.org, freebsd-usb@freebsd.org, mi+kde@aldan.algebra.com, freebsd-bugbusters@freebsd.org Subject: Re: USB issues (not just Re: PR backlog) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 17:54:47 -0000 =DE=C5=D4=D7=C5=D2 27 =C7=D2=D5=C4=C5=CE=D8 2007 12:33 =D0=CF, M. Warner = Losh =F7=C9 =CE=C1=D0=C9=D3=C1=CC=C9: > I did the bulk of the work for the 7.0 stuff, at least getting things > into the tree. =9ASince I did the work, my last job got totally insane > and then I switched jobs. As the old Russian saying went: if vodka interferes with your job, you ha= ve to=20 stop working. > We can all agree that this is long overdue. But we need to make sure > of a few critical details so we don't create another mess for > ourselves down the line. Seriosly, thank you and do get back to it whenever you can. =20-mi ###################################################################### The information contained in this communication is confidential and may contain information that is privileged or exempt from disclosure under applicable law. If you are not a named addressee, please notify the sender immediately and delete this email from your system. If you have received this communication, and are not a named recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. ###################################################################### From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 19:14:43 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6651016A41A for ; Thu, 27 Dec 2007 19:14:43 +0000 (UTC) (envelope-from henrik@gulbra.net) Received: from av7-2-sn3.vrr.skanova.net (av7-2-sn3.vrr.skanova.net [81.228.9.182]) by mx1.freebsd.org (Postfix) with ESMTP id 02AD313C46E for ; Thu, 27 Dec 2007 19:14:42 +0000 (UTC) (envelope-from henrik@gulbra.net) Received: by av7-2-sn3.vrr.skanova.net (Postfix, from userid 502) id 3CC20387EB; Thu, 27 Dec 2007 19:45:20 +0100 (CET) Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av7-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 2436338139; Thu, 27 Dec 2007 19:45:20 +0100 (CET) Received: from [192.168.0.2] (81-235-156-87-no29.tbcn.telia.com [81.235.156.87]) by smtp3-2-sn3.vrr.skanova.net (Postfix) with ESMTP id A691137E4F; Thu, 27 Dec 2007 19:47:57 +0100 (CET) From: Henrik Gulbrandsen To: "M. Warner Losh" In-Reply-To: <20071226.174523.1326317191.imp@bsdimp.com> References: <1198689316.1119.382.camel@Particle> <20071226.114812.1649771240.imp@bsdimp.com> <1198713403.1119.414.camel@Particle> <20071226.174523.1326317191.imp@bsdimp.com> Content-Type: text/plain Date: Thu, 27 Dec 2007 19:46:25 +0100 Message-Id: <1198781185.1119.478.camel@Particle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-usb@FreeBSD.org Subject: READ_CAPACITY_OFFBY1 [was: Re: usb/umass, devfs: this sucks] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 19:14:43 -0000 I'm dropping the stable list and continuing discussion on the USB list. On Wed, 2007-12-26 at 11:48 -0700, M. Warner Losh wrote: > The patch in [usb/78984] is wrong. There are devices that are an odd > number of sectors. This is one of the places where the obvious patch > isn't necessarily right. On Wed, 2007-12-26 at 17:45 -0700, M. Warner Losh wrote: > There's already a quirk for this problem that has been applied to the > few devices that it affects. That would be the new READ_CAPACITY_OFFBY1, which you checked in about five months after my patch submission :-) > Maybe we need to add one more to the list? There was also talk of > forcing a read to the last sector if the sector count was odd, but it > never got past talk. Well, there are at least three ways of handling this, but none of them seems particularly good to me. It all boils down to a trade-off: a) Using the quirk flag. This is the obvious solution, now when it has been added to the umass.c file. The problem with quirks in general is highlighted by your check-in comment: "...there are a host of other devices with this issue, including iPods and some popular cameras". Each of these will be separately debugged and added to the list, and since the link between cause and effect can be less than obvious in this case, that can take hours of work per device. b) Reading from the last sector. This is an interesting solution, but worries me, because that sector will technically be out-of-range in the devices that we're interested in. If they can't get the sector count right, how will they handle a read from an invalid sector? I'm not a bit surprised if there are devices out there that would block indefinitely, convert the read to a write in the first sector and corrupt the file system, or generally burn the barn... c) Using heuristics. This is what I did when I assumed that there should typically be an even number of sectors. While that is obviously a bit too optimistic, perhaps there are other sufficiently good algorithms for detecting the incorrect cases with a negligible number of false positives. It may be due to a lack of imagination, but I find it hard to think of any reason why somebody would put exactly 256001 512-byte sectors on a umass device, unless that's an off-by-one error in itself. For my own personal use, solution (a) is good enough, but I'd prefer a more general solution, so we can use scarce developer time in a more useful way than for identifying this quirk over and over again. /Henrik From owner-freebsd-usb@FreeBSD.ORG Thu Dec 27 20:27:16 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0D9916A420 for ; Thu, 27 Dec 2007 20:27:16 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 4FDAA13C442 for ; Thu, 27 Dec 2007 20:27:16 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id lBRKFQcn068883; Thu, 27 Dec 2007 21:15:26 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id lBRKFHdx058608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Dec 2007 21:15:18 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id lBRKFHZp036025; Thu, 27 Dec 2007 21:15:17 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id lBRKFGR7036024; Thu, 27 Dec 2007 21:15:16 +0100 (CET) (envelope-from ticso) Date: Thu, 27 Dec 2007 21:15:16 +0100 From: Bernd Walter To: Henrik Gulbrandsen Message-ID: <20071227201515.GC31522@cicely12.cicely.de> References: <1198689316.1119.382.camel@Particle> <20071226.114812.1649771240.imp@bsdimp.com> <1198713403.1119.414.camel@Particle> <20071226.174523.1326317191.imp@bsdimp.com> <1198781185.1119.478.camel@Particle> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1198781185.1119.478.camel@Particle> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on cicely12.cicely.de Cc: freebsd-usb@freebsd.org Subject: Re: READ_CAPACITY_OFFBY1 [was: Re: usb/umass, devfs: this sucks] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 20:27:16 -0000 On Thu, Dec 27, 2007 at 07:46:25PM +0100, Henrik Gulbrandsen wrote: > I'm dropping the stable list and continuing discussion on the USB list. > > On Wed, 2007-12-26 at 11:48 -0700, M. Warner Losh wrote: > > The patch in [usb/78984] is wrong. There are devices that are an odd > > number of sectors. This is one of the places where the obvious patch > > isn't necessarily right. > > On Wed, 2007-12-26 at 17:45 -0700, M. Warner Losh wrote: > > There's already a quirk for this problem that has been applied to the > > few devices that it affects. > > That would be the new READ_CAPACITY_OFFBY1, which you checked in about > five months after my patch submission :-) > > > Maybe we need to add one more to the list? There was also talk of > > forcing a read to the last sector if the sector count was odd, but it > > never got past talk. > > Well, there are at least three ways of handling this, but none of them > seems particularly good to me. It all boils down to a trade-off: > > a) Using the quirk flag. This is the obvious solution, now when it has > been added to the umass.c file. The problem with quirks in general > is highlighted by your check-in comment: "...there are a host of > other devices with this issue, including iPods and some popular > cameras". Each of these will be separately debugged and added to > the list, and since the link between cause and effect can be less > than obvious in this case, that can take hours of work per device. > > b) Reading from the last sector. This is an interesting solution, but > worries me, because that sector will technically be out-of-range in > the devices that we're interested in. If they can't get the sector > count right, how will they handle a read from an invalid sector? > I'm not a bit surprised if there are devices out there that would > block indefinitely, convert the read to a write in the first sector > and corrupt the file system, or generally burn the barn... > > c) Using heuristics. This is what I did when I assumed that there should > typically be an even number of sectors. While that is obviously a bit > too optimistic, perhaps there are other sufficiently good algorithms > for detecting the incorrect cases with a negligible number of false > positives. It may be due to a lack of imagination, but I find it hard > to think of any reason why somebody would put exactly 256001 512-byte > sectors on a umass device, unless that's an off-by-one error in itself. This is my cellphone with a 2GB micro-SD: da9 at umass-sim3 bus 3 target 0 lun 0 da9: < > Removable Direct Access SCSI-0 device da9: 1.000MB/s transfers da9: 1950MB (3994377 512 byte sectors: 255H 63S/T 248C) It offers not the complete media - it offers the slice as the whole media, so theoretically I can adjust the drive size by any number of blocks. And of course you shouldn't forget that umass can also be any kind of HDD attached to an USB converter. I assume part of the problem is that if the media is announced wrong noone has to care about it as long as all sectors can be read, which means that the driver shouldn't truncate to the media size and we don't partition the media ourself, which is most likely true for cameras and such, where most people let the camera partition the media. -- B.Walter http://www.bwct.de http://www.fizon.de bernd@bwct.de info@bwct.de support@fizon.de From owner-freebsd-usb@FreeBSD.ORG Fri Dec 28 18:10:02 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B37A816A419 for ; Fri, 28 Dec 2007 18:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 88FA213C461 for ; Fri, 28 Dec 2007 18:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBSIA2Wn020797 for ; Fri, 28 Dec 2007 18:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBSIA2Xc020796; Fri, 28 Dec 2007 18:10:02 GMT (envelope-from gnats) Date: Fri, 28 Dec 2007 18:10:02 GMT Message-Id: <200712281810.lBSIA2Xc020796@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Jase Thew Cc: Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jase Thew List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2007 18:10:02 -0000 The following reply was made to PR usb/118670; it has been noted by GNATS. From: Jase Thew To: bug-followup@FreeBSD.org, Uwe@Grohnwaldt.eu, Warner Losh Cc: Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard Date: Fri, 28 Dec 2007 17:39:53 +0000 This is a multi-part message in MIME format. --------------090006030803070408040407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The Razer Copperhead is a compound device having both a mouse and programmable keyboard component (so that mouse buttons can be programmed to emulate keypresses), hence it previously attaching to both ums and ukbd. The problem with it no longer attaching to ums is due to changes made in ums.c version 1.94 - specifically (snippet taken from ums.c v1.97) : 201: if (id->bInterfaceClass == UICLASS_HID && 202: id->bInterfaceSubClass == UISUBCLASS_BOOT && 203: id->bInterfaceProtocol == UIPROTO_MOUSE) 204: ret = UMATCH_IFACECLASS; 205: else 206: ret = UMATCH_NONE; As the mouse device is Class 3 (HID), SubClass 0 (No SubClass), Protocol 2 (Mouse), it fails to match and hence will not attach. The attached patch, which applies against ums.c v1.97, changes the check to match either SubClass 0 (No SubClass) or SubClass 1 (Boot device) and defines the appropriate identifier in usb.h . After applying the patch, the mouse attaches successfully and works correctly. This shouldn't affect any mice that use the Boot subclass - it will just allow mice that have no subclass to work correctly. I would love to see this committed before 7.0-RELEASE is cut, but I understand if it's not, as it is rather late in the testing cycle. --------------090006030803070408040407 Content-Type: text/plain; name="patch-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-1.diff" --- sys/dev/usb/ums.c.orig 2007-12-28 17:07:33.000000000 +0000 +++ sys/dev/usb/ums.c 2007-12-28 17:09:19.000000000 +0000 @@ -198,7 +198,8 @@ return (UMATCH_NONE); if (id->bInterfaceClass == UICLASS_HID && - id->bInterfaceSubClass == UISUBCLASS_BOOT && + (id->bInterfaceSubClass == UISUBCLASS_NONE || + id->bInterfaceSubClass == UISUBCLASS_BOOT) && id->bInterfaceProtocol == UIPROTO_MOUSE) ret = UMATCH_IFACECLASS; else --- sys/dev/usb/usb.h.orig 2007-12-28 17:09:26.000000000 +0000 +++ sys/dev/usb/usb.h 2007-12-28 17:10:05.000000000 +0000 @@ -433,6 +433,7 @@ #define UIPROTO_CDC_AT 1 #define UICLASS_HID 0x03 +#define UISUBCLASS_NONE 0 #define UISUBCLASS_BOOT 1 #define UIPROTO_BOOT_KEYBOARD 1 #define UIPROTO_MOUSE 2 --------------090006030803070408040407-- From owner-freebsd-usb@FreeBSD.ORG Fri Dec 28 19:40:02 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C46A816A508 for ; Fri, 28 Dec 2007 19:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF9B13C474 for ; Fri, 28 Dec 2007 19:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBSJe2Ks003382 for ; Fri, 28 Dec 2007 19:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBSJe2vf003381; Fri, 28 Dec 2007 19:40:02 GMT (envelope-from gnats) Date: Fri, 28 Dec 2007 19:40:02 GMT Message-Id: <200712281940.lBSJe2vf003381@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Jase Thew Cc: Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jase Thew List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2007 19:40:02 -0000 The following reply was made to PR usb/118670; it has been noted by GNATS. From: Jase Thew To: bug-followup@FreeBSD.org, Uwe@Grohnwaldt.eu, Warner Losh Cc: Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard Date: Fri, 28 Dec 2007 19:34:43 +0000 Sorry, the patch got munged with my previous follow-up. For reference in this PR, the patch can be downloaded from http://beastie.beardz.net/~bazerka/fbsd/copperhead.patch-1.diff Also, a slight correction to my previous follow-up, the patch applies to ums.c,v 1.96 2007/07/25 06:43:06 imp (which is the latest version of ums.c in RELENG_7, as of posting). Regards, Jase. From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 01:08:16 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2A0B16A41A for ; Sat, 29 Dec 2007 01:08:16 +0000 (UTC) (envelope-from gdt@ir.bbn.com) Received: from fnord.ir.bbn.com (fnord.ir.bbn.com [192.1.100.210]) by mx1.freebsd.org (Postfix) with ESMTP id 69E3013C45D for ; Sat, 29 Dec 2007 01:08:16 +0000 (UTC) (envelope-from gdt@ir.bbn.com) Received: by fnord.ir.bbn.com (Postfix, from userid 10853) id 79E5952E9; Fri, 28 Dec 2007 19:50:37 -0500 (EST) X-Hashcash: 1:20:071229:usb@freebsd.org::42xo+Z4ts4TJ2axM:004+s2 From: Greg Troxel To: usb@freebsd.org Date: Fri, 28 Dec 2007 19:50:37 -0500 Message-ID: User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Subject: lpt(4) and non-blocking read X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 01:08:16 -0000 --=-=-= I didn't cross-post because I am guessing that wouldn't be appreciated, but I wanted to ask for advice here too. The NetBSD and FreeBSD ulpt(4) code is nearly identical, modulo os-adaptation issues, so the message applies equally to FreeBSD. --=-=-= Content-Type: message/rfc822 Content-Disposition: inline From: Greg Troxel To: tech-kern@netbsd.org Subject: ulpt(4) and non-blocking read Date: Fri, 28 Dec 2007 19:48:19 -0500 Message-ID: MIME-Version: 1.0 The USB printer driver supports reading, but doesn't support nonblocking IO, which means it doesn't work with gutenprint. I have posted a similar note to the gutenprint list. Does anyone feel ownership of src/sys/dev/ulpt.c? Invoking a bulk transfer on an input endpoint can have side effects on some devices, so some drivers avoid such reads unless a read operation has been invoked. On other devices, queuing a read transfer is normal. So: on USB printers, is it ok to start a read bulk transfer just because the device is open? There are two approaches: 1) On a read system call, if there is any data already read, return it. If not, invoke a read bulk transfer, and if it completes very quickly return the data. If not, return EWOULDBLOCK. This perhaps fudges a bit on non-blocking vs fast. 2) On open, start a read transfer, and as each transfer completes, if there is room in the input buffer, start a new one. On a read system call, return whatever data is already in the buffer (and therefore start a read transfer if space is newly freed). Besides non-blocking reads, there's the issue of select/poll for read. To make this work, I think approach #2 is needed, because if no read transfer has been done, there's no way to know if there's data. Linux's drivers/usb/class/usblp.c seems to do a blend of these, starting a transfer on read, and restarting one on completion, but not starting one on the open call. NetBSD and FreeBSD both fail to support nonblocking read at all. OpenBSD seems to have an older ulpt that does not support reading at all. Opensolaris appears not to support nonblocking reads, but I could be wrong as I am not familiar with the codebase. Option 1 is easier, and could probably be done by modifying the existing loop to return after the first iteration whether the transfer succeeds or not. So I'll probably try that first. Any comments on the approach, or pointing out any confusion on my part, would be appreciated. --=-=-=-- From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 01:27:00 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDE0616A417 for ; Sat, 29 Dec 2007 01:27:00 +0000 (UTC) (envelope-from uwe@grohnwaldt.eu) Received: from server02.lando.cc (server02-01.lando.cc [87.106.141.202]) by mx1.freebsd.org (Postfix) with ESMTP id 204C913C465 for ; Sat, 29 Dec 2007 01:26:59 +0000 (UTC) (envelope-from uwe@grohnwaldt.eu) Received: (qmail 12511 invoked from network); 29 Dec 2007 02:26:58 +0100 Received: from p57bc56ab.dip.t-dialin.net (HELO Winter) (87.188.86.171) by server02-01.lando.cc with (DHE-RSA-AES256-SHA encrypted) SMTP; 29 Dec 2007 02:26:57 +0100 Date: Sat, 29 Dec 2007 02:26:24 +0100 From: Uwe Grohnwaldt To: bug-followup@FreeBSD.org Message-ID: <20071229022624.2c1f7a18@Winter> X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.3; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Jase Thew , imp@FreeBSD.org, freebsd-usb@FreeBSD.org Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 01:27:00 -0000 Hi, I tried your patch on my FreeBSD-Current and it works great for me, although the file-version differs from the fbsd7 one. :) Thanks, -- Uwe Grohnwaldt Max-Planck-Str 2A, 1.03.2 18059 Rostock E-Mail : Uwe@Grohnwaldt.de ICQ : 149348486 * Skype : lando_calr * nur nach vorheriger Vereinbarung From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 01:28:33 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30A5516A417 for ; Sat, 29 Dec 2007 01:28:33 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe11.swipnet.se [212.247.155.65]) by mx1.freebsd.org (Postfix) with ESMTP id 9491513C43E for ; Sat, 29 Dec 2007 01:28:32 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.3] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe11.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 579121766 for freebsd-usb@freebsd.org; Sat, 29 Dec 2007 02:13:31 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sat, 29 Dec 2007 02:14:15 +0100 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200712290214.15919.hselasky@c2i.net> Subject: FreeBSD P4 USB project - precompiled kernels available for download X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 01:28:33 -0000 Hi, I took the time today to crossbuild a couple of kernels based on the FreeBSD P4 USB Project using the "GENERIC" kernel config so that people can try how it works. The P4 USB Project is currently based on FreeBSD 8.x. I have not tested if the precompiled kernels work on FreeBSD 6.x or FreeBSD 7.x, but I presume yes. Things that I want you to try out: 1) Connect full-speed devices through a high-speed USB HUB and see how they work. Especially USB sound devices. You might need to run "kldload snd_uaudio" first. 2) Benchmark Mass-storage devices. You might need to run "kldload umass" first. Use "time dd if=/dev/da0 of=/dev/null bs=131072" for example. Vary the parameters and make a comparison. 3) For those of you that have a KB9202B ARM board, try the precompiled ARM kernel. 4) The USB CDC ethernet driver is now using full HW accelleration when transferring ethernet frames in both directions. There should be a noticable transfer rate increase. NOTE: USB dongles that support the new HW accelerated protocol on the downlink do not yet exist, except when using the KB9202B ARM based board with a FreeBSD kernel! Only upload HW acceleration will work regardless of USB dongle type. Here is a short summary of the most important changes during the last three months: o Support for multi sub-framing (EHCI alt_next) o Support for loading of buffers directly into DMA o Cache synch cleanup o Support for "on the go USB solutions" (Device and Host side in one) o Performance improvements Known issues: o Don't un-plug mass storage and sound devices while they are mounted or in use. o if_ural and if_rum has a LOR when you run ioctls on the interface which is to be fixed. List of pre-compiled architectures: arm i386 sparc64 amd64 Checksums: MD5 (releases/arm__01-01-43__29-12-2007.tar.bz2) = 3c86d3a7993e0bfbbf153b4bbbe03944 SHA256 (releases/arm__01-01-43__29-12-2007.tar.bz2) = f3c77a699c84aacd6b664a58cf3e9596e70fc300b810661bbd925e421a58276c MD5 (releases/i386__01-01-43__29-12-2007.tar.bz2) = 7429b978ac413c0026dbb4b2ab3ac157 SHA256 (releases/i386__01-01-43__29-12-2007.tar.bz2) = 4d78bf5159639e2cacdec3d3482050aeb8771df21f455efd71ac54a0b7a07eb2 MD5 (releases/sparc64__01-01-43__29-12-2007.tar.bz2) = fa376c89c58b086cd0ee5273e298710e SHA256 (releases/sparc64__01-01-43__29-12-2007.tar.bz2) = 7b15012150fdb902aadcb41054ad5b466ff53ec8ef02695a05a7b91cc586eb55 MD5 (releases/amd64__01-01-43__29-12-2007.tar.bz2) = f8241a23cd0ca46e01aace89f7b79454 SHA256 (releases/amd64__01-01-43__29-12-2007.tar.bz2) = 5ec008860dfc432b3e785b1cb26f79dbaff6a235b637415948f4b1ec87ab8e45 Download location: http://www.selasky.org/hans_petter/usb4bsd/snapshots/ List of USB modules that are functional: sys/modules/ata/atausb/Makefile sys/modules/aue/Makefile sys/modules/axe/Makefile sys/modules/cdce/Makefile sys/modules/cue/Makefile sys/modules/if_ndis/Makefile sys/modules/kue/Makefile sys/modules/ndis/Makefile sys/modules/netgraph/bluetooth/ubt/Makefile sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile sys/modules/rue/Makefile sys/modules/rum/Makefile sys/modules/sound/driver/uaudio/Makefile sys/modules/uark/Makefile sys/modules/uark/Makefile sys/modules/ubsa/Makefile sys/modules/ubser/Makefile sys/modules/ubser/Makefile sys/modules/ucom/Makefile sys/modules/ucycom/Makefile sys/modules/udav/Makefile sys/modules/udbp/Makefile sys/modules/ufm/Makefile sys/modules/ufoma/Makefile sys/modules/uftdi/Makefile sys/modules/ugen/Makefile sys/modules/ugensa/Makefile sys/modules/ugensa/Makefile sys/modules/uhid/Makefile sys/modules/uhid/Makefile sys/modules/uipaq/Makefile sys/modules/ukbd/Makefile sys/modules/ulpt/Makefile sys/modules/umass/Makefile sys/modules/umct/Makefile sys/modules/umodem/Makefile sys/modules/umoscom/Makefile sys/modules/ums/Makefile sys/modules/uplcom/Makefile sys/modules/ural/Makefile sys/modules/urio/Makefile sys/modules/usb/Makefile sys/modules/uscanner/Makefile sys/modules/uvisor/Makefile sys/modules/uvscom/Makefile List of non-functional USB Modules: sys/modules/zyd/Makefile sys/modules/slhci/Makefile sys/modules/uchcom/Makefile Please don't hesitate giving feedback either on the list or off the list. Have Fun ! --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 02:00:07 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E30BE16A418 for ; Sat, 29 Dec 2007 02:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BF71513C44B for ; Sat, 29 Dec 2007 02:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBT207sc075204 for ; Sat, 29 Dec 2007 02:00:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBT207wh075197; Sat, 29 Dec 2007 02:00:07 GMT (envelope-from gnats) Date: Sat, 29 Dec 2007 02:00:07 GMT Message-Id: <200712290200.lBT207wh075197@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Uwe Grohnwaldt Cc: Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Uwe Grohnwaldt List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 02:00:08 -0000 The following reply was made to PR usb/118670; it has been noted by GNATS. From: Uwe Grohnwaldt To: bug-followup@FreeBSD.org Cc: Jase Thew , , freebsd-usb@FreeBSD.org Subject: Re: usb/118670: Razer Copperhead Laser Mouse shows up as keyboard Date: Sat, 29 Dec 2007 02:26:24 +0100 Hi, I tried your patch on my FreeBSD-Current and it works great for me, although the file-version differs from the fbsd7 one. :) Thanks, -- Uwe Grohnwaldt Max-Planck-Str 2A, 1.03.2 18059 Rostock E-Mail : Uwe@Grohnwaldt.de ICQ : 149348486 * Skype : lando_calr * nur nach vorheriger Vereinbarung From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 05:30:55 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B382B16A418 for ; Sat, 29 Dec 2007 05:30:55 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id C618213C447 for ; Sat, 29 Dec 2007 05:30:53 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id lBT2GgCg006790 for ; Sat, 29 Dec 2007 13:16:42 +1100 Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id lBT2Gcns011280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Dec 2007 13:16:39 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id lBT2GcN9020431; Sat, 29 Dec 2007 13:16:38 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id lBT2GbV6020430; Sat, 29 Dec 2007 13:16:37 +1100 (EST) (envelope-from peter) Date: Sat, 29 Dec 2007 13:16:37 +1100 From: Peter Jeremy To: Greg Troxel Message-ID: <20071229021637.GV40785@server.vk2pj.dyndns.org> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hTiIB9CRvBOLTyqY" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: usb@freebsd.org Subject: Re: lpt(4) and non-blocking read X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 05:30:55 -0000 --hTiIB9CRvBOLTyqY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 28, 2007 at 07:50:37PM -0500, Greg Troxel wrote: >1) On a read system call, if there is any data already read, return it. >If not, invoke a read bulk transfer, and if it completes very quickly >return the data. If not, return EWOULDBLOCK. This perhaps fudges a bit >on non-blocking vs fast. > >2) On open, start a read transfer, and as each transfer completes, if >there is room in the input buffer, start a new one. On a read system >call, return whatever data is already in the buffer (and therefore start >a read transfer if space is newly freed). Option 1 would seem to be the safest and easiest. >Besides non-blocking reads, there's the issue of select/poll for read. >To make this work, I think approach #2 is needed, because if no read >transfer has been done, there's no way to know if there's data. An alternative approach would be to have poll/select-for-read initiate a read transfer if there is no data available (ie if the poll/select would block). Note that, at present, ulpt(4) on FreeBSD doesn't support any read buffering. I've been bitten by this and there's a patch in PR usb/91538 to implement read buffering. --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --hTiIB9CRvBOLTyqY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHda4F/opHv/APuIcRAhK3AJ9QD9XD7Hvcz4LOUlhyb9lDD7O5jgCfe3jA si7Kxme2/Zq/bTO1ciDuoZU= =4Z8+ -----END PGP SIGNATURE----- --hTiIB9CRvBOLTyqY-- From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 06:33:27 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F14A816A419 for ; Sat, 29 Dec 2007 06:33:27 +0000 (UTC) (envelope-from bkelly@vadev.org) Received: from mail8.sea5.speakeasy.net (mail8.sea5.speakeasy.net [69.17.117.10]) by mx1.freebsd.org (Postfix) with ESMTP id D251813C458 for ; Sat, 29 Dec 2007 06:33:27 +0000 (UTC) (envelope-from bkelly@vadev.org) Received: (qmail 16548 invoked from network); 29 Dec 2007 06:33:26 -0000 Received: from vadev.org (HELO ianto.vadev.org) ([66.92.166.151]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Dec 2007 06:33:26 -0000 Received: from [10.0.1.2] ([192.168.1.97]) (authenticated bits=0) by ianto.vadev.org (8.14.2/8.14.2) with ESMTP id lBT3WCU4069148 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 29 Dec 2007 03:32:13 GMT (envelope-from bkelly@vadev.org) In-Reply-To: <200712290214.15919.hselasky@c2i.net> References: <200712290214.15919.hselasky@c2i.net> Mime-Version: 1.0 (Apple Message framework v753) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <08127556-0DC2-41E2-9C22-EB9C07333629@vadev.org> Content-Transfer-Encoding: 7bit From: Ben Kelly Date: Fri, 28 Dec 2007 22:32:07 -0500 To: Hans Petter Selasky X-Mailer: Apple Mail (2.753) X-Spam-Score: -1.44 () ALL_TRUSTED X-Scanned-By: MIMEDefang 2.63 on 192.168.1.110 Cc: freebsd-usb@freebsd.org Subject: Re: FreeBSD P4 USB project - precompiled kernels available for download X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 06:33:28 -0000 On Dec 28, 2007, at 8:14 PM, Hans Petter Selasky wrote: > I took the time today to crossbuild a couple of kernels based on > the FreeBSD > P4 USB Project using the "GENERIC" kernel config so that people can > try how it > works. The P4 USB Project is currently based on FreeBSD 8.x. I have > not > tested if the precompiled kernels work on FreeBSD 6.x or FreeBSD > 7.x, but I > presume yes. Things that I want you to try out: Do these images match the current code in the subversion repository referenced at the following page? http://www.selasky.org/hans_petter/usb4bsd/index.html It didn't look like there had been any USB changes in there recently. Has the USB development moved completely to p4? I would like to try the new stack, but I am guessing I will need to patch it for usb/95173 in order to use my umass device. Thanks for working on this! - Ben From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 08:37:48 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59E1B16A418 for ; Sat, 29 Dec 2007 08:37:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id E985113C45A for ; Sat, 29 Dec 2007 08:37:47 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.3] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe01.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 728905168; Sat, 29 Dec 2007 09:37:45 +0100 From: Hans Petter Selasky To: Ben Kelly Date: Sat, 29 Dec 2007 09:38:30 +0100 User-Agent: KMail/1.9.7 References: <200712290214.15919.hselasky@c2i.net> <08127556-0DC2-41E2-9C22-EB9C07333629@vadev.org> In-Reply-To: <08127556-0DC2-41E2-9C22-EB9C07333629@vadev.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712290938.31371.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: FreeBSD P4 USB project - precompiled kernels available for download X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 08:37:48 -0000 Hi Ben, On Saturday 29 December 2007, Ben Kelly wrote: > On Dec 28, 2007, at 8:14 PM, Hans Petter Selasky wrote: > > I took the time today to crossbuild a couple of kernels based on > > the FreeBSD > > P4 USB Project using the "GENERIC" kernel config so that people can > > try how it > > works. The P4 USB Project is currently based on FreeBSD 8.x. I have > > not > > tested if the precompiled kernels work on FreeBSD 6.x or FreeBSD > > 7.x, but I > > presume yes. Things that I want you to try out: > > Do these images match the current code in the subversion repository > referenced at the following page? > > http://www.selasky.org/hans_petter/usb4bsd/index.html No, my SVN repo has not been updated for a while because the USB code has been under heavily development. I will do an update once the USB code stabilises. > > It didn't look like there had been any USB changes in there > recently. Has the USB development moved completely to p4? Just for the time being. I will update my SVN repo soon so that you can get the source code and compile for yourself. > > I would like to try the new stack, but I am guessing I will need to > patch it for usb/95173 in order to use my umass device. Usually it is best if patches go into FreeBSD current first, because else I will have to keep track of the patches I take in. Regarding your patch, it looks OK, except it would be nice if the patch could be modified so that it automatically detects these quirks. Because adding quirks is a bad solution in the long run. Maybe you have another USB mass storage device you can test ? > > Thanks for working on this! > --HPS From owner-freebsd-usb@FreeBSD.ORG Sat Dec 29 20:40:58 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1941A16A417 for ; Sat, 29 Dec 2007 20:40:58 +0000 (UTC) (envelope-from bkelly@vadev.org) Received: from mail6.sea5.speakeasy.net (mail6.sea5.speakeasy.net [69.17.117.8]) by mx1.freebsd.org (Postfix) with ESMTP id E47A113C44B for ; Sat, 29 Dec 2007 20:40:57 +0000 (UTC) (envelope-from bkelly@vadev.org) Received: (qmail 32480 invoked from network); 29 Dec 2007 20:40:57 -0000 Received: from vadev.org (HELO ianto.vadev.org) ([66.92.166.151]) (envelope-sender ) by mail6.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Dec 2007 20:40:57 -0000 Received: from [10.0.1.2] ([192.168.1.97]) (authenticated bits=0) by ianto.vadev.org (8.14.2/8.14.2) with ESMTP id lBTKes7W085247 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 29 Dec 2007 20:40:54 GMT (envelope-from bkelly@vadev.org) In-Reply-To: <200712290938.31371.hselasky@c2i.net> References: <200712290214.15919.hselasky@c2i.net> <08127556-0DC2-41E2-9C22-EB9C07333629@vadev.org> <200712290938.31371.hselasky@c2i.net> Mime-Version: 1.0 (Apple Message framework v753) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Ben Kelly Date: Sat, 29 Dec 2007 15:40:49 -0500 To: Hans Petter Selasky X-Mailer: Apple Mail (2.753) X-Spam-Score: -1.44 () ALL_TRUSTED X-Scanned-By: MIMEDefang 2.63 on 192.168.1.110 Cc: freebsd-usb@freebsd.org Subject: Re: FreeBSD P4 USB project - precompiled kernels available for download X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 20:40:58 -0000 On Dec 29, 2007, at 3:38 AM, Hans Petter Selasky wrote: > On Saturday 29 December 2007, Ben Kelly wrote: >> It didn't look like there had been any USB changes in there >> recently. Has the USB development moved completely to p4? > > Just for the time being. I will update my SVN repo soon so that you > can get > the source code and compile for yourself. Thanks! >> I would like to try the new stack, but I am guessing I will need to >> patch it for usb/95173 in order to use my umass device. > > Usually it is best if patches go into FreeBSD current first, > because else I > will have to keep track of the patches I take in. Regarding your > patch, it > looks OK, except it would be nice if the patch could be modified so > that it > automatically detects these quirks. Because adding quirks is a bad > solution > in the long run. I agree that quirks are not the best solution. Unfortunately, though, I don't think it will be possible to detect the problem and dynamically disable sync'ing. At least this particular USB-to-disk controller seems to lockup when the sync command is issued. It requires a power cycle to recover the device. It did occur to me, however, that perhaps it would make sense to disable sync'ing for all umass devices by default and then add a quirk to enable the feature on devices where its known to be beneficial. This is based on the (perhaps dubious) theory that most umass devices probably do not do a lot of caching because of the risk of being disconnected at any time. I didn't pursue this option, though, since I thought it would be more controversial and harder to get applied to the tree. > Maybe you have another USB mass storage device you can test ? I think I can probably find one. Eventually I would like to test my hard drive enclosure, though, since I use it the most often currently. I probably won't be able to run the tests until after the new year. Thanks again. - Ben