Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Feb 2002 12:02:48 +0100
From:      Paul van der Zwan <paulz@trantor.xs4all.nl>
To:        "Brian F. Feldman" <green@FreeBSD.ORG>
Cc:        Riccardo Torrini <riccardo@torrini.org>, current@FreeBSD.ORG
Subject:   Re: USB detach crashes possibly fixed 
Message-ID:  <200202171102.g1HB2m146727@trantor.xs4all.nl>
In-Reply-To: Your message of "Sat, 16 Feb 2002 20:28:13 EST." <200202170128.g1H1SDY03195@green.bikeshed.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Fcc: outbox
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
--------
> > > 
> > > and I got a small tune on attach but nothing on detach.
> > > Now I am unable to play notes on /dev/speaker.  Any hint?
> 
> As Terry notes, shouldn't possibly be related.
> 
> > I have no crashes but the detach action is never executed when I switch off
> > my Sony camera ( it has never worked as far as I know)
> > Attach actions are executed fine..
> 
> Have you tried compiling in all available USB debugging support or seeing if 
> anyone else is using one like yours?


No, but if I run usbd in the foreground and with some -v flags it never 
reports seeing a detach event even though the device driver reports it.
It looks like usbd just doesn't get it...

This is what the kernel logs when switching the camera on and off.

Feb 17 11:57:44 <kern.crit> trantor kernel: umass0: Sony Sony DSC, rev 1.00/2.10, addr 2
Feb 17 11:57:44 <kern.crit> trantor kernel: da0 at umass-sim0 bus 0 target 0 lun 0
Feb 17 11:57:44 <kern.crit> trantor kernel: da0: <Sony Sony DSC 2.10> Removable Direct Access SCSI-0 device 
Feb 17 11:57:44 <kern.crit> trantor kernel: da0: 150KB/s transfers
Feb 17 11:57:44 <kern.crit> trantor kernel: da0: 61MB (126848 512 byte sectors: 0H 0S/T 0C)
Feb 17 11:58:04 <kern.crit> trantor kernel: umass0: at uhub0 port 1 (addr 2) disconnected
Feb 17 11:58:04 <kern.crit> trantor kernel: (da0:umass-sim0:0:0:0): lost device
Feb 17 11:58:04 <kern.crit> trantor kernel: umass0: detached

Looks OK to me.

And this is what usbd prints 
$ sudo usbd -d -v -v -v -v 
usbd: opened /dev/usb0
usbd: opened /dev/usb1
usbd: opened /dev/usb2
usbd: reading configuration file /etc/usbd.conf
usbd: action 1: Sony DSC S70 Camera
  vndr=0x054c prdct=0x0010
  attach='sleep 5 ;mount /sony'
  detach='umount -f /sony'
usbd: action 2: USB device
usbd: 2 actions
usbd: opened /dev/usb
usbd: device-attach event at 1013898654.505840000, Sony DSC, Sony:
  vndr=0x054c prdct=0x0010 rlse=0x0210 clss=0x0000 subclss=0x0000 prtcl=0x0000
  device names: umass0
usbd: Found action 'Sony DSC S70 Camera' for Sony DSC, Sony at umass0
usbd: action 0: Sony DSC S70 Camera
  vndr=0x054c prdct=0x0010
  attach='sleep 5 ;mount /sony'
  detach='umount -f /sony'
usbd: Setting DEVNAME='umass0'
usbd: Executing 'sleep 5 ;mount /sony'
msdosfs: /dev/da0s1: No such file or directory
usbd: 'sleep 5 ;mount /sony' returned 71
usbd: doing timeout discovery on /dev/usb0
usbd: doing timeout discovery on /dev/usb1
usbd: doing timeout discovery on /dev/usb2
usbd: processing event queue due to timeout on /dev/usb
usbd: doing timeout discovery on /dev/usb0
usbd: doing timeout discovery on /dev/usb1
usbd: doing timeout discovery on /dev/usb2
usbd: processing event queue due to timeout on /dev/usb
usbd: processing event queue on /dev/usb
usbd: device-attach event at 1013943463.949946000, Sony DSC, Sony:
  vndr=0x054c prdct=0x0010 rlse=0x0210 clss=0x0000 subclss=0x0000 prtcl=0x0000
  device names: umass0
usbd: Found action 'Sony DSC S70 Camera' for Sony DSC, Sony at umass0
usbd: action 0: Sony DSC S70 Camera
  vndr=0x054c prdct=0x0010
  attach='sleep 5 ;mount /sony'
  detach='umount -f /sony'
usbd: Setting DEVNAME='umass0'
usbd: Executing 'sleep 5 ;mount /sony'
usbd: 'sleep 5 ;mount /sony' is ok
usbd: doing timeout discovery on /dev/usb0
usbd: doing timeout discovery on /dev/usb1
usbd: doing timeout discovery on /dev/usb2
usbd: processing event queue due to timeout on /dev/usb
usbd: doing timeout discovery on /dev/usb0
usbd: doing timeout discovery on /dev/usb1
usbd: doing timeout discovery on /dev/usb2
usbd: processing event queue due to timeout on /dev/usb
usbd: doing timeout discovery on /dev/usb0
usbd: doing timeout discovery on /dev/usb1
usbd: doing timeout discovery on /dev/usb2
usbd: processing event queue due to timeout on /dev/usb
^C


It looks like the driver works fine as far as I can tell, but usbd just 
doesn't see the detach event.

-- 
Paul van der Zwan		paulz @ trantor.xs4all.nl
"I think I'll move to theory, everything works in theory..."



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202171102.g1HB2m146727>