From estartu@etustar.ze.tum.de  Thu Feb  9 08:36:02 2006
Return-Path: <estartu@etustar.ze.tum.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7129516A420
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  9 Feb 2006 08:36:02 +0000 (GMT)
	(envelope-from estartu@etustar.ze.tum.de)
Received: from etustar.ze.tum.de (etustar.ze.tum.de [129.187.39.96])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D776343D45
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  9 Feb 2006 08:36:01 +0000 (GMT)
	(envelope-from estartu@etustar.ze.tum.de)
Received: from etustar.ze.tum.de (localhost [127.0.0.1])
	by etustar.ze.tum.de (8.13.4/8.13.4) with ESMTP id k198a065006740
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 9 Feb 2006 09:36:00 +0100 (CET)
	(envelope-from estartu@etustar.ze.tum.de)
Received: (from estartu@localhost)
	by etustar.ze.tum.de (8.13.4/8.13.4/Submit) id k198a048006739;
	Thu, 9 Feb 2006 09:36:00 +0100 (CET)
	(envelope-from estartu)
Message-Id: <200602090836.k198a048006739@etustar.ze.tum.de>
Date: Thu, 9 Feb 2006 09:36:00 +0100 (CET)
From: Gerhard Schmidt <estartu@augusta.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Detach of Firewire Harddisk not recognied properly
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         93083
>Category:       kern
>Synopsis:       [firewire] Detach of Firewire Harddisk not recognied properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    simokawa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 09 08:40:03 GMT 2006
>Closed-Date:    Wed Mar 05 02:01:41 UTC 2008
>Last-Modified:  Wed Mar 05 02:01:41 UTC 2008
>Originator:     Gerhard Schmidt
>Release:        FreeBSD 6.1-PRERELEASE i386
>Organization:
Augsburger Computer Forum e.V.
>Environment:
System: FreeBSD etustar.ze.tum.de 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #1: Wed Feb 8 15:31:25 CET 2006 root@etustar.ze.tum.de:/usr/src/sys/i386/compile/ETUSTAR i386


>Description:

I have an external USB/Firewire Harddisk. When i attach it 
via Firewire I gets attached as da0. So far everything is 
all right. Console reports the follwing:

fwohci0: BUS reset
fwohci0: node_id=0xc800ffc1, gen=2, CYCLEMASTER mode
firewire0: 2 nodes, maxhop <= 1, cable IRM = 1 (me)
firewire0: bus manager 1 (me)
firewire0: New S400 device ID:0090a95000000665
sbp0:0:1 login failed
da0 at sbp0 bus 0 target 0 lun 0
da0: <WD 3200JB External 0223> Fixed Simplified Direct Access SCSI-4 device 
da0: 50.000MB/s transfers
da0: 305245MB (625142448 512 byte sectors: 255H 63S/T 38913C)

When I detach the device the device records 
are not removed and camcontrol devlist still lists the device 

<WD 3200JB External 0223>          at scbus0 target 0 lun 0 (probe0,da0,pass1)

On the console there is the following output 
fwohci0: BUS reset
fwohci0: node_id=0xc800ffc0, gen=13, CYCLEMASTER mode
firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
firewire0: bus manager 0 (me)

I tried to do a rescan with camcontrol rescan 0 
camcontrol never returned. 

Even when I reattach the device it still doesn't work. 

The same Harddisk on USB works without problem. 

here the dmesg of my system 

Copyright (c) 1992-2006 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 6.1-PRERELEASE #1: Wed Feb  8 15:31:25 CET 2006
    root@etustar.ze.tum.de:/usr/src/sys/i386/compile/ETUSTAR
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) 64 Processor 3000+ (1802.32-MHz 686-class CPU)
  Origin = "AuthenticAMD"  Id = 0x20ff0  Stepping = 0
  Features=0x78bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2>
  Features2=0x1<SSE3>
  AMD Features=0xe2500800<SYSCALL,NX,MMX+,<b25>,LM,3DNow+,3DNow>
real memory  = 1073414144 (1023 MB)
avail memory = 1041494016 (993 MB)
ACPI APIC Table: <A M I  OEMAPIC >
MADT: Forcing active-low polarity and level trigger for SCI
ioapic0 <Version 0.3> irqs 0-23 on motherboard
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <A M I OEMRSDT> on motherboard
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0: <ACPI CPU> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <VIA K8T800Pro host to PCI bridge> mem 0xce000000-0xcfffffff at device 0.0 on pci0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
pci1: <display> at device 0.1 (no driver attached)
fwohci0: <VIA Fire II (VT6306)> port 0x8400-0x847f mem 0xfb500000-0xfb5007ff irq 16 at device 7.0 on pci0
fwohci0: OHCI version 1.0 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:11:d8:00:00:12:47:bd
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
fwe0: <Ethernet over FireWire> on firewire0
if_fwe0: Fake Ethernet address: 02:11:d8:12:47:bd
fwe0: Ethernet address: 02:11:d8:12:47:bd
fwe0: if_start running deferred for Giant
sbp0: <SBP-2/SCSI over FireWire> on firewire0
fwohci0: Initiate bus reset
fwohci0: node_id=0xc800ffc1, gen=1, CYCLEMASTER mode
firewire0: 2 nodes, maxhop <= 1, cable IRM = 1 (me)
firewire0: bus manager 1 (me)
atapci0: <Promise PDC20378 SATA150 controller> port 0x9400-0x943f,0x9000-0x900f,0x8800-0x887f mem 0xfb700000-0xfb700fff,0xfb600000-0xfb61ffff irq 18 at device 8.0 on pci0
ata2: <ATA channel 0> on atapci0
ata3: <ATA channel 1> on atapci0
ata4: <ATA channel 2> on atapci0
skc0: <Marvell Gigabit Ethernet> port 0x9800-0x98ff mem 0xfb900000-0xfb903fff irq 17 at device 10.0 on pci0
skc0: Marvell Yukon Lite Gigabit Ethernet rev. (0x9)
sk0: <Marvell Semiconductor, Inc. Yukon> on skc0
sk0: Ethernet address: 00:11:d8:92:8a:49
miibus0: <MII bus> on sk0
e1000phy0: <Marvell 88E1000 Gigabit PHY> on miibus0
e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto
ahc0: <Adaptec 2902/04/10/15/20C/30C SCSI adapter> port 0xa000-0xa0ff mem 0xfba00000-0xfba00fff irq 19 at device 14.0 on pci0
ahc0: [GIANT-LOCKED]
aic7850: Single Channel A, SCSI Id=7, 3/253 SCBs
atapci1: <VIA 6420 SATA150 controller> port 0xc000-0xc007,0xb800-0xb803,0xb400-0xb407,0xb000-0xb003,0xa800-0xa80f,0xa400-0xa4ff irq 20 at device 15.0 on pci0
ata5: <ATA channel 0> on atapci1
ata6: <ATA channel 1> on atapci1
atapci2: <VIA 8237 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xfc00-0xfc0f at device 15.1 on pci0
ata0: <ATA channel 0> on atapci2
ata1: <ATA channel 1> on atapci2
uhci0: <VIA 83C572 USB controller> port 0xc400-0xc41f irq 21 at device 16.0 on pci0
uhci0: [GIANT-LOCKED]
usb0: <VIA 83C572 USB controller> on uhci0
usb0: USB revision 1.0
uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <VIA 83C572 USB controller> port 0xc800-0xc81f irq 21 at device 16.1 on pci0
uhci1: [GIANT-LOCKED]
usb1: <VIA 83C572 USB controller> on uhci1
usb1: USB revision 1.0
uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2: <VIA 83C572 USB controller> port 0xd000-0xd01f irq 21 at device 16.2 on pci0
uhci2: [GIANT-LOCKED]
usb2: <VIA 83C572 USB controller> on uhci2
usb2: USB revision 1.0
uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3: <VIA 83C572 USB controller> port 0xd400-0xd41f irq 21 at device 16.3 on pci0
uhci3: [GIANT-LOCKED]
usb3: <VIA 83C572 USB controller> on uhci3
usb3: USB revision 1.0
uhub3: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0: <VIA VT6202 USB 2.0 controller> mem 0xfbc00000-0xfbc000ff irq 21 at device 16.4 on pci0
ehci0: [GIANT-LOCKED]
usb4: waiting for BIOS to give up control
usb4: EHCI version 1.0
usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
usb4: <VIA VT6202 USB 2.0 controller> on ehci0
usb4: USB revision 2.0
uhub4: VIA EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
uhub5: vendor 0x04e1 product 0x0201, class 9/0, rev 2.00/0.02, addr 2
uhub5: multiple transaction translators
uhub5: 4 ports with 4 removable, self powered
ums0: Kensington Kensington Expert Mouse, rev 1.10/1.00, addr 3, iclass 3/1
ums0: 4 buttons and Z dir.
isab0: <PCI-ISA bridge> at device 17.0 on pci0
isa0: <ISA bus> on isab0
pcm0: <VIA VT8237> port 0xd800-0xd8ff irq 22 at device 17.5 on pci0
pcm0: <Avance Logic ALC850 AC97 Codec>
pcm0: <VIA DXS Enabled: DXS 4 / SGD 1 / REC 1>
acpi_button0: <Power Button> on acpi0
acpi_button1: <Sleep Button> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse, device ID 3
fdc0: <floppy drive controller (FDE)> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FAST]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
ppc0: <ECP parallel printer port> port 0x378-0x37f,0x778-0x77b irq 7 drq 3 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/9 bytes threshold
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
sio0: configured irq 3 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 flags 0x10 on acpi0
sio0: type 16550A
sio1: configured irq 4 not in bitmap of probed irqs 0
sio1: port may not be enabled
sio1: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 on acpi0
sio1: type 16550A
orm0: <ISA Option ROM> at iomem 0xc0000-0xccfff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 1802318066 Hz quality 800
Timecounters tick every 1.000 msec
Waiting 15 seconds for SCSI devices to settle
acd0: DVDR <HL-DT-ST DVDRAM GSA-4163B/A102> at ata0-master UDMA33
ad4: 152627MB <Seagate ST3160827AS 3.42> at ata2-master SATA150
cd0 at ata0 bus 0 target 0 lun 0
cd0: <HL-DT-ST DVDRAM GSA-4163B A102> Removable CD-ROM SCSI-0 device 
cd0: 33.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present
Trying to mount root from ufs:/dev/ad4s1a

>How-To-Repeat:
	
attach firewire device and detach it. 
	
>Fix:

n/k 


>Release-Note:
>Audit-Trail:

From: Christopher Sean Hilton <chris@vindaloo.com>
To: bug-followup@FreeBSD.org, estartu@augusta.de
Cc:  
Subject: Re: kern/93083: [firewire] Detach of Firewire Harddisk not
	recognied properly
Date: Sun, 09 Apr 2006 22:18:28 -0400

 This appears to be "normal" behaviour for the firewire code in FreeBSD.
 To convince a firewire drive to detach Initiate a firewire bus reset
 with the fwcontrol command. To reset the bus use the -r command three
 times in succession. It's a kludge but it works.
 
     # fwcontrol -r
     # fwcontrol -r
     # fwcontrol -r
 
 -- Chris
 
 -- 
 Chris Hilton                                   chris-at-vindaloo-dot-com
 ------------------------------------------------------------------------
                 "All I was doing was trying to get home from work!"
                                                  -- Rosa Parks
 
 

From: Gerhard Schmidt <estartu@augusta.de>
To: Christopher Sean Hilton <chris@vindaloo.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/93083: [firewire] Detach of Firewire Harddisk not recognied properly
Date: Sat, 17 Jun 2006 11:47:25 +0200

 On Sun, Apr 09, 2006 at 10:18:28PM -0400, Christopher Sean Hilton wrote:
 > This appears to be "normal" behaviour for the firewire code in FreeBSD.
 > To convince a firewire drive to detach Initiate a firewire bus reset
 > with the fwcontrol command. To reset the bus use the -r command three
 > times in succession. It's a kludge but it works.
 > 
 >     # fwcontrol -r
 >     # fwcontrol -r
 >     # fwcontrol -r
 
 Not realy. It only works if you detach all firewire devices if you remove
 only one. and other are still remain the computer reboots shortly after
 the reset.
 
 But still it may work but its not the expected behaviour. I don't think 
 its very handy to have to do manual resets wenn you detach a device. 
 The firewire code gets the detach so why isn't there a test which device 
 has been removed and an autodetach of the spezific device. 
 
 Bye
         Estartu
 
 --------------------------------------------------------------------------
 Gerhard Schmidt    | Nick : estartu      IRC : Estartu  |  PGP Public Key
 Fischbachweg 3     |                                    |   auf Anfrage/
 86856 Hiltenfingen | estartu@augusta.de                 |    on request

From: Ulrich Spoerlein <uspoerlein@gmail.com>
To: bug-followup@FreeBSD.org, estartu@augusta.de
Cc: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Subject: Re: kern/93083: [firewire] Detach of Firewire Harddisk not recognied properly
Date: Tue, 6 Mar 2007 21:08:52 +0100

 Hi,
 
 I plan to investigate this problem over the next few weeks, as it is
 time that I finally scratch this itch. I found this thread has some nice
 details:
 
 http://lists.freebsd.org/pipermail/freebsd-firewire/2003-September/000115.html
 
 Perhaps someone can beat me to it.
 
 Ulrich Spoerlein

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/93083: commit references a PR
Date: Thu, 15 Mar 2007 14:44:09 +0000 (UTC)

 simokawa    2007-03-15 14:44:03 UTC
 
   FreeBSD src repository
 
   Modified files:
     share/man/man4       sbp.4 
   Log:
   Add a description about hw.firewire.hold_count.
   
   MFC: after 3 days
   PR: kern/93083
   
   Revision  Changes    Path
   1.12      +2 -1      src/share/man/man4/sbp.4
 _______________________________________________
 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: Hidetoshi Shimokawa <simokawa@FreeBSD.ORG>
To: Ulrich Spoerlein <uspoerlein@gmail.com>
Cc: bug-followup@FreeBSD.org,
	estartu@augusta.de
Subject: Re: kern/93083: [firewire] Detach of Firewire Harddisk not recognied properly
Date: Sat, 17 Mar 2007 21:58:13 +0900

 I suppose `sysctl hw.firewire.hold_count=0' is what you want.
 
 /\ Hidetoshi Shimokawa
 \/  simokawa@FreeBSD.ORG
 
 At Tue, 6 Mar 2007 21:08:52 +0100,
 Ulrich Spoerlein wrote:
 > 
 > Hi,
 > 
 > I plan to investigate this problem over the next few weeks, as it is
 > time that I finally scratch this itch. I found this thread has some nice
 > details:
 > 
 > http://lists.freebsd.org/pipermail/freebsd-firewire/2003-September/000115.html
 > 
 > Perhaps someone can beat me to it.
 > 
 > Ulrich Spoerlein

From: Ulrich Spoerlein <uspoerlein@gmail.com>
To: Hidetoshi Shimokawa <simokawa@FreeBSD.ORG>
Cc: bug-followup@FreeBSD.ORG, estartu@augusta.de
Subject: Re: kern/93083: [firewire] Detach of Firewire Harddisk not recognied properly
Date: Sat, 17 Mar 2007 16:37:03 +0100

 Hidetoshi Shimokawa wrote:
 > I suppose `sysctl hw.firewire.hold_count=0' is what you want.
 
 Ah, thank you.
 
 But why is this deviating from the umass(4) behaviour? It surely is
 confusing ...
 
 Ulrich Spoerlein
 -- 
 "The trouble with the dictionary is you have to know how the word is
 spelled before you can look it up to see how it is spelled."
 -- Will Cuppy
State-Changed-From-To: open->feedback 
State-Changed-By: simokawa 
State-Changed-When: Thu Mar 22 02:47:51 UTC 2007 
State-Changed-Why:  
USB has always tree structures and any devices except hubs 
are leaves of the tree. This means that you can remove any device without 
disconnecting any other devices. 
On the other hand, ieee1394 allows daisy chains and you may sometimes 
want to remove a device between the host and a leaf device which is 
mounted on the host. The current default setting allow to remove physically 
such intermediate nodes without unmounting filesystems. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=93083 
Responsible-Changed-From-To: freebsd-bugs->simokawa 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Feb 29 03:07:20 UTC 2008 
Responsible-Changed-Why:  
Simokawa-san, I'm having difficulty trying to figure out what to do 
with this PR.  You seem to have marked it as 'feedback', but yet there 
has been a commit based on it.  Can you please advise?  Thank you. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93083 
State-Changed-From-To: feedback->closed 
State-Changed-By: simokawa 
State-Changed-When: Wed Mar 5 01:58:48 UTC 2008 
State-Changed-Why:  
The behaviour is documented in the manpage. 
I think it's o.k. to close. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93083 
>Unformatted:
