Re: page fault on device disconnect

2011-01-22 Thread Marcin Wisnicki
On Sat, Jan 22, 2011 at 16:01, Hans Petter Selasky  wrote:
> On Wednesday 19 January 2011 21:44:01 Marcin Wisnicki wrote:
>> I've accidentally cut power to my self-powered USB hdd enclosure with
>> UFS+gjournal on GELI.
> [snip]
> Could you show more dmesg?

Full dmesg captured after restart is in attachment to this message [dmesg.log].
What I've pasted however is everything that happened after
disconnection until kernel dump, previous messages are from many hours
or days earlier.

> Also try to build a kernel with the following options:
>

Unfortunately that panic is not reproducible, it's the first time I've seen it.

Trying to reproduce it I get the usual UFS panic:

# brace for impact
> sync;sync;sync

# cut the power for 1s
ugen3.2:  at usbus3 (disconnected)
uhub4: at uhub3, port 1, addr 2 (disconnected)
ugen3.3:  at usbus3 (disconnected)
umass0: at uhub4, port 1, addr 3 (disconnected)
(da0:umass-sim0:0:0:0): lost device
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0xa, scsi
status == 0x0
(da0:umass-sim0:0:0:0): removing device entry
GEOM_JOURNAL: Lost provider label/ghost_tank2_enc.eli.
ugen3.4:  at usbus3 (disconnected)
umass1: at uhub4, port 3, addr 4 (disconnected)
GEOM_JOURNAL: Cannot destroy journal label/ghost_tank2_enc.eli
(error=16). Destroy it manually after last close.
(da1:umass-sim1:1:0:0): lost device
(da1:umass-sim1:1:0:0): removing device entry
ugen3.2:  at usbus3
uhub4:  on usbus3
uhub4: 4 ports with 4 removable, self powered
ugen3.3:  at usbus3
umass0:  on usbus3
ugen3.4:  at usbus3
umass1:  on usbus3
da0 at umass-sim1 bus 1 scbus3 target 0 lun 0
da0:  Removable Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 3872MB (7929856 512 byte sectors: 255H 63S/T 493C)
da1 at umass-sim0 bus 0 scbus2 target 0 lun 0
da1:  Fixed Direct Access SCSI-2 device
da1: 40.000MB/s transfers
da1: 953869MB (1953525168 512 byte sectors: 255H 63S/T 121601C)

> ls /dev/label/
boot0   boot0g
boot0a  boot0h
boot0b  ghost_tank2_enc
boot0d  ghost_tank2_enc.eli.journal
boot0e  ghost_tank2_key
boot0f

# couple of minutes later
GEOM_JOURNAL: Error while reading data from label/ghost_tank2_enc.eli (error=6).
panic: ufs_dirbad: /vol/store/tank2: bad dir ino 2 at offset 0: mangled entry
cpuid = 0
KDB: stack backtrace:
db_trace_self_wrapper(c076c1d5,a0d79,e678f848,c0576f82,d7f2bc20,...)
at db_trace_self_wrapper+0x26
kdb_backtrace(c078804a,0,c077fb99,e678f89c,0,...) at kdb_backtrace+0x2a
panic(c077fb99,c46a3464,2,0,c077fc57,...) at panic+0x117
ufs_dirbad(c46843a0,0,c077fc57,0,e678f948,...) at ufs_dirbad+0x46
ufs_lookup_(0,e678f970,c0748612,e678f990,e678f9b0,...) at ufs_lookup_+0x37a
ufs_lookup(e678f990,e678f9b0,c0578ea2,c07b8c00,e678f990,...) at ufs_lookup+0x1e
VOP_CACHEDLOOKUP_APV(c07b8c00,e678f990,e678fb58,e678fb44,c8818b80,...)
at VOP_CACHEDLOOKUP_APV+0x42
vfs_cache_lookup(e678fa18,e678f9c8,20,e678fb58,e678fa38,...) at
vfs_cache_lookup+0xd2
VOP_LOOKUP_APV(c07b8c00,e678fa18,e678fb58,1f6,848,...) at VOP_LOOKUP_APV+0x46
lookup(e678fb2c,c4ed7400,400,e678fb4c,e678fa60,...) at lookup+0x6be
namei(e678fb2c,c04e85fd,0,1000,e678fae0,...) at namei+0x633
kern_statat_vnhook(c4f29870,0,ff9c,21c6d430,0,...) at
kern_statat_vnhook+0x72
kern_statat(c4f29870,0,ff9c,21c6d430,0,...) at kern_statat+0x3c
kern_stat(c4f29870,21c6d430,0,e678fbe8,c46bd754,...) at kern_stat+0x36
stat(c4f29870,e678fcec,e678fd28,b,21c93000,...) at stat+0x2f
syscallenter(c4f29870,e678fce4,e678fce4,0,c4f29870,...) at syscallenter+0x329
syscall(e678fd28) at syscall+0x34
Xint0x80_syscall() at Xint0x80_syscall+0x21
--- syscall (188, FreeBSD ELF32, stat), eip = 0x21bb0e43, esp =
0xbfbfdf9c, ebp = 0xbfbfdfb8 ---
Uptime: 3d5h10m44s
Physical memory: 1007 MB
Dumping 201 MB: 186 170 154 138 122 106 90 74 58 42 26 10
Dump complete
Automatic reboot in 15 seconds - press a key on the console to abort
Rebooting...

But that's expected :(


dmesg.log
Description: Binary data
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: libusb performance on 8.1

2011-01-22 Thread Daniel O'Connor

On 23/01/2011, at 24:03, Hans Petter Selasky wrote:
>> While doing some speed testing I find that FreeBSD does ~4Mb/sec, but Linux
>> does 17Mb/sec & OS X does 8-10Mb/sec.
> 
> You need to change the way you buffer the data. FreeBSD does not queue more 
> than 2 URB's at any time, and the turnaround time varies from 1ms to 125us 
> due 
> to hardware IRQ restrictions. Linux queues up all it can get, which leads to 
> other kind of problems. The current internal buffer limit is 16Kbyte 8000 
> times per second which gives a MAX of 128 MByte/second.
> 
> In general during hardware design:
> 
> 1) Avoid short packets.
> 2) Make sure transfer buffers are matched between host and device.
> 
> From my experience it is very possible to reach +30Mbyte/second with LibUSB 
> under FreeBSD 8.2+, given the buffering is optimal for the kernel.
> 

Hmm... I am transferring fixed size packets of 512 bytes, so there shouldn't be 
any short packets (unless I misunderstand what you mean).

Ahh, I I see what you mean now.. I was transferring a single packet at a time 
because I didn't realise you could transfer more at once.

If I switch to transferring 2k at once it goes up to 16Mb/sec.

Thanks :)

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: da(4) not attaching to USB drive

2011-01-22 Thread Matthias Apitz

and if I pull out the USB cable and plug it into my EeePC sitting next
to the Acer, da(4) attaches fine ... but all the other laptops are
running a 8.x version;

matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e  - w http://www.unixarea.de/
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: da(4) not attaching to USB drive

2011-01-22 Thread Matthias Apitz
El día Saturday, January 22, 2011 a las 04:03:01PM +0100, Hans Petter Selasky 
escribió:

> > > Is the HDD supplied with external power?
> > 
> > Yes.
> > 
> > matthias
> 
> Have you tried a:
> 
> camcontrol rescan all

yes:

# usbconfig -u 4 -a 3 dump_device_desc
ugen4.3:  at usbus4, cfg=0 md=HOST
spd=HIGH (480Mbps) pwr=ON

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x 
  bDeviceSubClass = 0x 
  bDeviceProtocol = 0x 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x07ab 
  idProduct = 0xfc8e 
  bcdDevice = 0x0108 
  iManufacturer = 0x0002  
  iProduct = 0x0003  
  iSerialNumber = 0x0001  
  bNumConfigurations = 0x0001 

# camcontrol rescan all
Re-scan of bus 0 was successful

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e  - w http://www.unixarea.de/
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: da(4) not attaching to USB drive

2011-01-22 Thread Hans Petter Selasky
On Saturday 22 January 2011 16:00:28 Matthias Apitz wrote:
> El día Saturday, January 22, 2011 a las 02:49:36PM +0100, Hans Petter 
Selasky escribió:
> > On Saturday 22 January 2011 11:42:39 Matthias Apitz wrote:
> > > Drive XS 1.00> Fixed Direct Access SCSI-2 device Jan 22 09:23:11
> > > tinyCurrent kernel: da0: 40.000MB/s transfers
> > > Jan 22 09:23:11 tinyCurrent kernel: da0: 1430799MB (2930277168 512 byte
> > > sectors: 255H 63S/T 182401C)
> > > 
> > > The kernel is 9-CURRENT r21 (October 2010). Any ideas?
> > > 
> > >   matthias
> > 
> > Is the HDD supplied with external power?
> 
> Yes.
> 
>   matthias

Have you tried a:

camcontrol rescan all

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: page fault on device disconnect

2011-01-22 Thread Hans Petter Selasky
On Wednesday 19 January 2011 21:44:01 Marcin Wisnicki wrote:
> I've accidentally cut power to my self-powered USB hdd enclosure with
> UFS+gjournal on GELI.
> The enclosure also acts as a hub and has single usb memory stick plugged
> in but not mounted.
> 
> I kind of expected to have panic in VFS as is typical in such situations
> but instead it happened earlier in the stack:
> 
> ugen3.2:  at usbus3 (disconnected)
> uhub4: at uhub3, port 1, addr 2 (disconnected)
> 
> 
> Fatal trap 12: page fault while in kernel mode
> cpuid = 0; apic id = 00
> fault virtual address   = 0xea7820aa
> fault code  = supervisor read, page not present
> instruction pointer = 0x20:0xc0710d64
> stack pointer   = 0x28:0xe4239afc
> frame pointer   = 0x28:0xe4239b0c
> code segment= base 0x0, limit 0xf, type 0x1b
> = DPL 0, pres 1, def32 1, gran 1
> processor eflags= interrupt enabled, resume, IOPL = 0
> current process = 15 (usbus3)
> trap number = 12
> panic: page fault
> cpuid = 0
> KDB: stack backtrace:
> db_trace_self_wrapper(c076c1d5,d31206e,2c66000a,70797420,78302065,...) at
> db_trace_self_wrapper+0x26
> kdb_backtrace(c078804a,0,c075dd75,e42399a8,0,...) at kdb_backtrace+0x2a
> panic(c075dd75,c0788d33,c3e43438,1,1,...) at panic+0x117
> trap_fatal(c119,ea782000,1,0,c3e432d0,...) at trap_fatal+0x325
> trap_pfault(0,0,9ed23521,c3e432d0,c3d82000,...) at trap_pfault+0x250
> trap(e4239abc) at trap+0x453
> calltrap() at calltrap+0x6
> --- trap 0xc, eip = 0xc0710d64, esp = 0xe4239afc, ebp = 0xe4239b0c ---
> bus_dma_tag_destroy(ea78207a,c44767d0,c4476400,c44c10a0,e4239b44,...) at
> bus_dma_tag_destroy+0x14
> usb_dma_tag_unsetup(c4476400,0,c09cc592,491,c44764b0,...) at
> usb_dma_tag_unsetup+0x3e
> usbd_transfer_unsetup_sub(c3e60dd4,0,c09cc592,4f0,0,...) at
> usbd_transfer_unsetup_sub+0xa0
> usbd_transfer_unsetup(c44c10a0,1,c44c1200,1,0,...) at
> usbd_transfer_unsetup+0x1ad
> uhub_detach(c44c1200,c3d8f860,c079b618,e4239bc4,c0527199,...) at
> uhub_detach+0x3a device_detach(c44c1200,c09cbde6,c4466bd0,1,2,...) at
> device_detach+0x68 usb_detach_device(c447d000,ff,2,c447d0f0,c447d000,...)
> at usb_detach_device+0x3f
> usb_unconfigure(c44c9600,c09bb1f0,c3fda440,7f2,c3e60c78,...) at
> usb_unconfigure+0x36 usb_free_device(c447d000,0,1,10,c3e60dd4,...) at
> usb_free_device+0x18a uhub_explore(c3eba400,0,c09cb510,f7,c3e60d5c,...) at
> uhub_explore+0x128
> usb_bus_explore(c3e60d5c,c3e60dd4,c09cc4e1,6c,c3e60d0c,...) at
> usb_bus_explore+0xb8
> usb_process(c3e60cfc,e4239d28,492,18080458,3019040,...) at
> usb_process+0xaa fork_exit(c09c5890,c3e60cfc,e4239d28) at fork_exit+0x90
> fork_trampoline() at fork_trampoline+0x8
> --- trap 0, eip = 0, esp = 0xe4239d60, ebp = 0 ---
> Uptime: 30d19h59m54s
> (da0:umass-sim0:0:0:0): SYNCHRONIZE CACHE(10). CDB: 35 0 0 0 0 0 0 0 0 0
> (da0:umass-sim0:0:0:0): SCSI sense: Error code 0x3e
> 

Could you show more dmesg?

Also try to build a kernel with the following options:

> options KDB
> options BREAK_TO_DEBUGGER
> options DDB
> makeoptions DEBUG=-g
> options INVARIANTS
> options INVARIANT_SUPPORT
> options WITNESS
> options DEBUG_LOCKS
> options DEBUG_VFS_LOCKS
> options DIAGNOSTIC
> options SW_WATCHDOG
> options KTRACE  # ktrace(1) support
> options SOCKBUF_DEBUG
> options DEBUG_MEMGUARD
>

> 
> # FreeBSD 8.2-PRERELEASE #0: Sun Dec 19 19:59:25 CET 2010
> 
> It's not really important to me but if someone wants to work on it
> I can provide more info.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: da(4) not attaching to USB drive

2011-01-22 Thread Matthias Apitz
El día Saturday, January 22, 2011 a las 02:49:36PM +0100, Hans Petter Selasky 
escribió:

> On Saturday 22 January 2011 11:42:39 Matthias Apitz wrote:

> > Drive XS 1.00> Fixed Direct Access SCSI-2 device Jan 22 09:23:11
> > tinyCurrent kernel: da0: 40.000MB/s transfers
> > Jan 22 09:23:11 tinyCurrent kernel: da0: 1430799MB (2930277168 512 byte
> > sectors: 255H 63S/T 182401C)
> > 
> > The kernel is 9-CURRENT r21 (October 2010). Any ideas?
> > 
> > matthias
> 
> Is the HDD supplied with external power?

Yes.

matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e  - w http://www.unixarea.de/
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Thiemo Nordenholz
The following reply was made to PR usb/154192; it has been noted by GNATS.

From: Thiemo Nordenholz 
To: Hans Petter Selasky 
Cc: freebsd-usb@freebsd.org, freebsd-gnats-sub...@freebsd.org
Subject: Re: usb/154192: In Garmin Oregon GPS, only the first umass device is 
visible since upgrade of 9.0-current
Date: Sat, 22 Jan 2011 15:43:27 +0100

 > Can you build the kernel with "options USB_DEBUG" and post new dmesg? Maybe 
 > your device is quirked while it should not.
 
 It says quirks=0:
 
 ugen0.2:  at usbus0
 umass0:  on 
usbus0
 umass0:  SCSI over Bulk-Only; quirks = 0x
 umass0:2:0:-1: Attached to scbus2
 da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
 da0:  Removable Direct Access SCSI-5 device 
 da0: 1.000MB/s transfers
 da0: 3906MB (7999488 512 byte sectors: 255H 63S/T 497C)
 
 Regards,
   Thiemo
   
 -- 
 Query a PGP key server (e.g. http://www.pgp.net/) for my public key 41068629.
 Strange sender address? Please see http://www.thiemo.net/misc/list-mail.shtml
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Thiemo Nordenholz
> Can you build the kernel with "options USB_DEBUG" and post new dmesg? Maybe 
> your device is quirked while it should not.

It says quirks=0:

ugen0.2:  at usbus0
umass0:  on 
usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x
umass0:2:0:-1: Attached to scbus2
da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
da0:  Removable Direct Access SCSI-5 device 
da0: 1.000MB/s transfers
da0: 3906MB (7999488 512 byte sectors: 255H 63S/T 497C)

Regards,
  Thiemo
  
-- 
Query a PGP key server (e.g. http://www.pgp.net/) for my public key 41068629.
Strange sender address? Please see http://www.thiemo.net/misc/list-mail.shtml
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: da(4) not attaching to USB drive

2011-01-22 Thread Hans Petter Selasky
On Saturday 22 January 2011 11:42:39 Matthias Apitz wrote:
> Hello,
> 
> I have the problem with my new laptop Acer Aspire One that an USB disk
> is not attaching most of the time; the disk itself works in 3 other
> laptops without any problem; here is a (normal) bad and one positive
> example from messages:
> 
> 
> Jan 22 09:22:44 tinyCurrent root: Unknown USB device: vendor 0x07ab product
> 0xfc8e bus uhub4 Jan 22 09:22:44 tinyCurrent kernel: ugen4.3:  at
> usbus4
> Jan 22 09:22:44 tinyCurrent kernel: umass0:  on usbus4
> Jan 22 09:22:44 tinyCurrent kernel: umass0:  SCSI over Bulk-Only; quirks =
> 0x Jan 22 09:22:45 tinyCurrent kernel: umass0:0:0:-1: Attached to
> scbus0 Jan 22 09:22:57 tinyCurrent kernel: ugen4.3:  at usbus4
> (disconnected) Jan 22 09:22:57 tinyCurrent kernel: umass0: at uhub4, port
> 1, addr 3 (disconnected) Jan 22 09:22:57 tinyCurrent kernel:
> (probe0:umass-sim0:0:0:0): AutoSense failed
> 
> 
> Jan 22 09:23:10 tinyCurrent root: Unknown USB device: vendor 0x07ab product
> 0xfc8e bus uhub4 Jan 22 09:23:10 tinyCurrent kernel: ugen4.3:  at
> usbus4
> Jan 22 09:23:10 tinyCurrent kernel: umass0:  on usbus4
> Jan 22 09:23:10 tinyCurrent kernel: umass0:  SCSI over Bulk-Only; quirks =
> 0x Jan 22 09:23:11 tinyCurrent kernel: umass0:0:0:-1: Attached to
> scbus0 Jan 22 09:23:11 tinyCurrent kernel: da0 at umass-sim0 bus 0 scbus0
> target 0 lun 0 Jan 22 09:23:11 tinyCurrent kernel: da0:  Drive XS 1.00> Fixed Direct Access SCSI-2 device Jan 22 09:23:11
> tinyCurrent kernel: da0: 40.000MB/s transfers
> Jan 22 09:23:11 tinyCurrent kernel: da0: 1430799MB (2930277168 512 byte
> sectors: 255H 63S/T 182401C)
> 
> The kernel is 9-CURRENT r21 (October 2010). Any ideas?
> 
>   matthias

Is the HDD supplied with external power?

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Hans Petter Selasky
The following reply was made to PR usb/154192; it has been noted by GNATS.

From: Hans Petter Selasky 
To: Thiemo Nordenholz 
Cc: freebsd-usb@freebsd.org,
 freebsd-gnats-sub...@freebsd.org
Subject: Re: usb/154192: In Garmin Oregon GPS, only the first umass device is 
visible since upgrade of 9.0-current
Date: Sat, 22 Jan 2011 14:36:47 +0100

 On Saturday 22 January 2011 13:17:04 Thiemo Nordenholz wrote:
 > > Try to upgrade USB code to the latest. There I a know issue affecting
 > > device enumeration.
 > 
 > Just cvsup'ed and tested again with the same result:
 > > uname -a
 > 
 > FreeBSD feynman 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sat Jan 22 12:53:38 CET
 > 2011 thiemo@feynman:/usr/obj/usr/src.new/sys/FEYNMAN  i386
 > 
 > Jan 22 13:10:59 feynman root: Unknown USB device: vendor 0x091e product
 > 0x231b bus uhub0 Jan 22 13:10:59 feynman kernel: ugen0.2: 
 > at usbus0 Jan 22 13:10:59 feynman kernel: umass0:  0x231b, class 0/0, rev 1.10/5.09, addr 2> on usbus0 Jan 22 13:11:00
 > feynman kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 Jan 22
 > 13:11:00 feynman kernel: da0:  Removable Direct
 > Access SCSI-5 device Jan 22 13:11:00 feynman kernel: da0: 1.000MB/s
 > transfers
 > Jan 22 13:11:00 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H
 > 63S/T 497C) [ unplugging device here ]
 > Jan 22 13:11:34 feynman kernel: ugen0.2:  at usbus0
 > (disconnected) Jan 22 13:11:34 feynman kernel: umass0: at uhub0, port 1,
 > addr 2 (disconnected) Jan 22 13:11:34 feynman kernel:
 > (da0:umass-sim0:0:0:0): lost device Jan 22 13:11:34 feynman kernel:
 > (da0:umass-sim0:0:0:0): removing device entry
 > 
 > > camcontrol reportluns da0
 > 
 
 Can you build the kernel with "options USB_DEBUG" and post new dmesg? Maybe 
 your device is quirked while it should not.
 
 --HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Hans Petter Selasky
On Saturday 22 January 2011 13:17:04 Thiemo Nordenholz wrote:
> > Try to upgrade USB code to the latest. There I a know issue affecting
> > device enumeration.
> 
> Just cvsup'ed and tested again with the same result:
> > uname -a
> 
> FreeBSD feynman 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sat Jan 22 12:53:38 CET
> 2011 thiemo@feynman:/usr/obj/usr/src.new/sys/FEYNMAN  i386
> 
> Jan 22 13:10:59 feynman root: Unknown USB device: vendor 0x091e product
> 0x231b bus uhub0 Jan 22 13:10:59 feynman kernel: ugen0.2: 
> at usbus0 Jan 22 13:10:59 feynman kernel: umass0:  0x231b, class 0/0, rev 1.10/5.09, addr 2> on usbus0 Jan 22 13:11:00
> feynman kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 Jan 22
> 13:11:00 feynman kernel: da0:  Removable Direct
> Access SCSI-5 device Jan 22 13:11:00 feynman kernel: da0: 1.000MB/s
> transfers
> Jan 22 13:11:00 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H
> 63S/T 497C) [ unplugging device here ]
> Jan 22 13:11:34 feynman kernel: ugen0.2:  at usbus0
> (disconnected) Jan 22 13:11:34 feynman kernel: umass0: at uhub0, port 1,
> addr 2 (disconnected) Jan 22 13:11:34 feynman kernel:
> (da0:umass-sim0:0:0:0): lost device Jan 22 13:11:34 feynman kernel:
> (da0:umass-sim0:0:0:0): removing device entry
> 
> > camcontrol reportluns da0
> 

Can you build the kernel with "options USB_DEBUG" and post new dmesg? Maybe 
your device is quirked while it should not.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: libusb performance on 8.1

2011-01-22 Thread Hans Petter Selasky
On Thursday 20 January 2011 07:37:32 Daniel O'Connor wrote:
> [re-sent from the correct address]
> 
> Hi,
> I am building a USB interface to a radar data acquisition chassis based on
> the Cypress CY7C68013A.
> 
> While doing some speed testing I find that FreeBSD does ~4Mb/sec, but Linux
> does 17Mb/sec & OS X does 8-10Mb/sec.

Hi,

You need to change the way you buffer the data. FreeBSD does not queue more 
than 2 URB's at any time, and the turnaround time varies from 1ms to 125us due 
to hardware IRQ restrictions. Linux queues up all it can get, which leads to 
other kind of problems. The current internal buffer limit is 16Kbyte 8000 
times per second which gives a MAX of 128 MByte/second.

In general during hardware design:

1) Avoid short packets.
2) Make sure transfer buffers are matched between host and device.

From my experience it is very possible to reach +30Mbyte/second with LibUSB 
under FreeBSD 8.2+, given the buffering is optimal for the kernel.

Hint: The libusb20 API has features to transfer multi-short packets in a more 
optimised way, which are not exposed in the libusb10 API.

> 
> It is using libusb-1.0 with the async API in a threaded app. I spawn a
> thread which sites in the following loop:
> 

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Thiemo Nordenholz
The following reply was made to PR usb/154192; it has been noted by GNATS.

From: Thiemo Nordenholz 
To: Hans Petter Selasky 
Cc: freebsd-usb@freebsd.org, freebsd-gnats-sub...@freebsd.org
Subject: Re: usb/154192: In Garmin Oregon GPS, only the first umass device is 
visible since upgrade of 9.0-current
Date: Sat, 22 Jan 2011 13:17:04 +0100

 > Try to upgrade USB code to the latest. There I a know issue affecting device 
 > enumeration.
 
 Just cvsup'ed and tested again with the same result:
 
 > uname -a
 FreeBSD feynman 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sat Jan 22 12:53:38 CET 
2011 thiemo@feynman:/usr/obj/usr/src.new/sys/FEYNMAN  i386
 
 Jan 22 13:10:59 feynman root: Unknown USB device: vendor 0x091e product 0x231b 
bus uhub0
 Jan 22 13:10:59 feynman kernel: ugen0.2:  at usbus0
 Jan 22 13:10:59 feynman kernel: umass0:  on usbus0
 Jan 22 13:11:00 feynman kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
 Jan 22 13:11:00 feynman kernel: da0:  Removable 
Direct Access SCSI-5 device 
 Jan 22 13:11:00 feynman kernel: da0: 1.000MB/s transfers
 Jan 22 13:11:00 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H 
63S/T 497C)
 [ unplugging device here ]
 Jan 22 13:11:34 feynman kernel: ugen0.2:  at usbus0 
(disconnected)
 Jan 22 13:11:34 feynman kernel: umass0: at uhub0, port 1, addr 2 (disconnected)
 Jan 22 13:11:34 feynman kernel: (da0:umass-sim0:0:0:0): lost device
 Jan 22 13:11:34 feynman kernel: (da0:umass-sim0:0:0:0): removing device entry
 
 > camcontrol reportluns da0
 2 LUNs found
 0
 0
 
 Cheers,
   Thiemo
 
 -- 
 Query a PGP key server (e.g. http://www.pgp.net/) for my public key 41068629.
 Strange sender address? Please see http://www.thiemo.net/misc/list-mail.shtml
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Thiemo Nordenholz
> Try to upgrade USB code to the latest. There I a know issue affecting device 
> enumeration.

Just cvsup'ed and tested again with the same result:

> uname -a
FreeBSD feynman 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sat Jan 22 12:53:38 CET 
2011 thiemo@feynman:/usr/obj/usr/src.new/sys/FEYNMAN  i386

Jan 22 13:10:59 feynman root: Unknown USB device: vendor 0x091e product 0x231b 
bus uhub0
Jan 22 13:10:59 feynman kernel: ugen0.2:  at usbus0
Jan 22 13:10:59 feynman kernel: umass0:  on usbus0
Jan 22 13:11:00 feynman kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
Jan 22 13:11:00 feynman kernel: da0:  Removable 
Direct Access SCSI-5 device 
Jan 22 13:11:00 feynman kernel: da0: 1.000MB/s transfers
Jan 22 13:11:00 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H 
63S/T 497C)
[ unplugging device here ]
Jan 22 13:11:34 feynman kernel: ugen0.2:  at usbus0 
(disconnected)
Jan 22 13:11:34 feynman kernel: umass0: at uhub0, port 1, addr 2 (disconnected)
Jan 22 13:11:34 feynman kernel: (da0:umass-sim0:0:0:0): lost device
Jan 22 13:11:34 feynman kernel: (da0:umass-sim0:0:0:0): removing device entry

> camcontrol reportluns da0
2 LUNs found
0
0

Cheers,
  Thiemo

-- 
Query a PGP key server (e.g. http://www.pgp.net/) for my public key 41068629.
Strange sender address? Please see http://www.thiemo.net/misc/list-mail.shtml
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


da(4) not attaching to USB drive

2011-01-22 Thread Matthias Apitz

Hello,

I have the problem with my new laptop Acer Aspire One that an USB disk
is not attaching most of the time; the disk itself works in 3 other
laptops without any problem; here is a (normal) bad and one positive example
from messages:


Jan 22 09:22:44 tinyCurrent root: Unknown USB device: vendor 0x07ab product 
0xfc8e bus uhub4
Jan 22 09:22:44 tinyCurrent kernel: ugen4.3:  at usbus4
Jan 22 09:22:44 tinyCurrent kernel: umass0:  on usbus4
Jan 22 09:22:44 tinyCurrent kernel: umass0:  SCSI over Bulk-Only; quirks = 
0x
Jan 22 09:22:45 tinyCurrent kernel: umass0:0:0:-1: Attached to scbus0
Jan 22 09:22:57 tinyCurrent kernel: ugen4.3:  at usbus4 (disconnected)
Jan 22 09:22:57 tinyCurrent kernel: umass0: at uhub4, port 1, addr 3 
(disconnected)
Jan 22 09:22:57 tinyCurrent kernel: (probe0:umass-sim0:0:0:0): AutoSense failed


Jan 22 09:23:10 tinyCurrent root: Unknown USB device: vendor 0x07ab product 
0xfc8e bus uhub4
Jan 22 09:23:10 tinyCurrent kernel: ugen4.3:  at usbus4
Jan 22 09:23:10 tinyCurrent kernel: umass0:  on usbus4
Jan 22 09:23:10 tinyCurrent kernel: umass0:  SCSI over Bulk-Only; quirks = 
0x
Jan 22 09:23:11 tinyCurrent kernel: umass0:0:0:-1: Attached to scbus0
Jan 22 09:23:11 tinyCurrent kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
Jan 22 09:23:11 tinyCurrent kernel: da0:  Fixed 
Direct Access SCSI-2 device 
Jan 22 09:23:11 tinyCurrent kernel: da0: 40.000MB/s transfers
Jan 22 09:23:11 tinyCurrent kernel: da0: 1430799MB (2930277168 512 byte 
sectors: 255H 63S/T 182401C)

The kernel is 9-CURRENT r21 (October 2010). Any ideas?

matthias
-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e  - w http://www.unixarea.de/
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Hans Petter Selasky
The following reply was made to PR usb/154192; it has been noted by GNATS.

From: Hans Petter Selasky 
To: freebsd-usb@freebsd.org
Cc: Thiemo Nordenholz ,
 freebsd-gnats-sub...@freebsd.org
Subject: Re: usb/154192: In Garmin Oregon GPS, only the first umass device is 
visible since upgrade of 9.0-current
Date: Sat, 22 Jan 2011 11:33:32 +0100

 On Friday 21 January 2011 14:48:53 Thiemo Nordenholz wrote:
 > >Number: 154192
 > >Category:   usb
 > >Synopsis:   In Garmin Oregon GPS, only the first umass device is
 > >visible since upgrade of 9.0-current Confidential:   no
 > >Severity:   non-critical
 > >Priority:   medium
 > >Responsible:freebsd-usb
 > >State:  open
 > >Quarter:
 > >Keywords:
 > >Date-Required:
 > >Class:  sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Fri Jan 21 13:50:07 UTC 2011
 > >Closed-Date:
 > >Last-Modified:
 > >Originator: Thiemo Nordenholz
 > >Release:9-current
 > >Organization:
 > 
 > >Environment:
 > FreeBSD feynman 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Thu Jan 20 16:26:22 CET
 > 2011 thiemo@feynman:/usr/obj/usr/src.new/sys/FEYNMAN  i386
 > 
 > >Description:
 > After upgrading from 9.0-CURRENT as of Jun 08, 2010, to the state csup'ed
 > on Sep 29, 2010, I am missing the SD card in my GPS receiver usually
 > accessible as USB mass storage. The internal (first) storage in the
 > receiver is still visible to fBSD.
 > 
 > Before the upgrade, the "working" output after attaching the GPS looked
 > like this:
 > 
 > Sep 20 11:57:13 feynman root: Unknown USB device: vendor 0x091e product
 > 0x231b bus uhub0 Sep 20 11:57:13 feynman kernel: ugen0.2: 
 > at usbus0 Sep 20 11:57:13 feynman kernel: umass0:  0x231b, class 0/0, rev 1.10/5.09, addr 2> on usbus0 Sep 20 11:57:13
 > feynman kernel: umass0:  SCSI over Bulk-Only; quirks = 0x Sep 20
 > 11:57:14 feynman kernel: umass0:2:0:-1: Attached to scbus2
 > Sep 20 11:57:14 feynman kernel: da0 at umass-sim0 bus 0 target 0 lun 0
 > Sep 20 11:57:14 feynman kernel: da0:  Removable
 > Direct Access SCSI-5 device Sep 20 11:57:14 feynman kernel: da0: 1.000MB/s
 > transfers
 > Sep 20 11:57:14 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H
 > 63S/T 497C) Sep 20 11:57:14 feynman kernel: da1 at umass-sim0 bus 0 target
 > 0 lun 1 Sep 20 11:57:14 feynman kernel: da1: 
 > Removable Direct Access SCSI-5 device Sep 20 11:57:14 feynman kernel: da1:
 > 1.000MB/s transfers
 > Sep 20 11:57:14 feynman kernel: da1: 7580MB (15523840 512 byte sectors:
 > 255H 63S/T 966C)
 > 
 > Today (in the meantime upgraded to the fBSD revision as cited above in the
 > uname -a output, csup'ed yesterday), the da1 device is missing:
 > 
 > Jan 21 14:27:25 feynman kernel: ugen0.2:  at usbus0
 > Jan 21 14:27:25 feynman kernel: umass0:  class 0/0, rev 1.10/5.09, addr 2> on usbus0 Jan 21 14:27:25 feynman root:
 > Unknown USB device: vendor 0x091e product 0x231b bus uhub0 Jan 21 14:27:26
 > feynman kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 Jan 21
 > 14:27:26 feynman kernel: da0:  Removable Direct
 > Access SCSI-5 device Jan 21 14:27:26 feynman kernel: da0: 1.000MB/s
 > transfers
 > Jan 21 14:27:26 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H
 > 63S/T 497C)
 > 
 > When attaching the GPS to a system running Solaris, both mass storage
 > devices are visible and working, so I assume the device itself is okay...
 > 
 
 Try to upgrade USB code to the latest. There I a know issue affecting device 
 enumeration.
 
 --HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: usb/154192: In Garmin Oregon GPS, only the first umass device is visible since upgrade of 9.0-current

2011-01-22 Thread Hans Petter Selasky
On Friday 21 January 2011 14:48:53 Thiemo Nordenholz wrote:
> >Number: 154192
> >Category:   usb
> >Synopsis:   In Garmin Oregon GPS, only the first umass device is
> >visible since upgrade of 9.0-current Confidential:   no
> >Severity:   non-critical
> >Priority:   medium
> >Responsible:freebsd-usb
> >State:  open
> >Quarter:
> >Keywords:
> >Date-Required:
> >Class:  sw-bug
> >Submitter-Id:   current-users
> >Arrival-Date:   Fri Jan 21 13:50:07 UTC 2011
> >Closed-Date:
> >Last-Modified:
> >Originator: Thiemo Nordenholz
> >Release:9-current
> >Organization:
> 
> >Environment:
> FreeBSD feynman 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Thu Jan 20 16:26:22 CET
> 2011 thiemo@feynman:/usr/obj/usr/src.new/sys/FEYNMAN  i386
> 
> >Description:
> After upgrading from 9.0-CURRENT as of Jun 08, 2010, to the state csup'ed
> on Sep 29, 2010, I am missing the SD card in my GPS receiver usually
> accessible as USB mass storage. The internal (first) storage in the
> receiver is still visible to fBSD.
> 
> Before the upgrade, the "working" output after attaching the GPS looked
> like this:
> 
> Sep 20 11:57:13 feynman root: Unknown USB device: vendor 0x091e product
> 0x231b bus uhub0 Sep 20 11:57:13 feynman kernel: ugen0.2: 
> at usbus0 Sep 20 11:57:13 feynman kernel: umass0:  0x231b, class 0/0, rev 1.10/5.09, addr 2> on usbus0 Sep 20 11:57:13
> feynman kernel: umass0:  SCSI over Bulk-Only; quirks = 0x Sep 20
> 11:57:14 feynman kernel: umass0:2:0:-1: Attached to scbus2
> Sep 20 11:57:14 feynman kernel: da0 at umass-sim0 bus 0 target 0 lun 0
> Sep 20 11:57:14 feynman kernel: da0:  Removable
> Direct Access SCSI-5 device Sep 20 11:57:14 feynman kernel: da0: 1.000MB/s
> transfers
> Sep 20 11:57:14 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H
> 63S/T 497C) Sep 20 11:57:14 feynman kernel: da1 at umass-sim0 bus 0 target
> 0 lun 1 Sep 20 11:57:14 feynman kernel: da1: 
> Removable Direct Access SCSI-5 device Sep 20 11:57:14 feynman kernel: da1:
> 1.000MB/s transfers
> Sep 20 11:57:14 feynman kernel: da1: 7580MB (15523840 512 byte sectors:
> 255H 63S/T 966C)
> 
> Today (in the meantime upgraded to the fBSD revision as cited above in the
> uname -a output, csup'ed yesterday), the da1 device is missing:
> 
> Jan 21 14:27:25 feynman kernel: ugen0.2:  at usbus0
> Jan 21 14:27:25 feynman kernel: umass0:  class 0/0, rev 1.10/5.09, addr 2> on usbus0 Jan 21 14:27:25 feynman root:
> Unknown USB device: vendor 0x091e product 0x231b bus uhub0 Jan 21 14:27:26
> feynman kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 Jan 21
> 14:27:26 feynman kernel: da0:  Removable Direct
> Access SCSI-5 device Jan 21 14:27:26 feynman kernel: da0: 1.000MB/s
> transfers
> Jan 21 14:27:26 feynman kernel: da0: 3906MB (7999488 512 byte sectors: 255H
> 63S/T 497C)
> 
> When attaching the GPS to a system running Solaris, both mass storage
> devices are visible and working, so I assume the device itself is okay...
> 

Try to upgrade USB code to the latest. There I a know issue affecting device 
enumeration.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"