From ollie@laptop.home.olliecook.net  Sun Feb  9 19:32:26 2003
Return-Path: <ollie@laptop.home.olliecook.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9A70837B40A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Feb 2003 19:32:26 -0800 (PST)
Received: from scrabble.freeuk.net (scrabble.freeuk.net [212.126.144.6])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6DE4A43FEC
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Feb 2003 19:31:05 -0800 (PST)
	(envelope-from ollie@laptop.home.olliecook.net)
Received: from laptop.home.olliecook.net ([217.158.102.197] helo=laptop.olliecook.net)
	by scrabble.freeuk.net with esmtp (Exim 3.36 #2)
	id 18i4et-000Gdt-00; Mon, 10 Feb 2003 03:31:03 +0000
Received: from laptop.home.olliecook.net (localhost [127.0.0.1])
	by laptop.olliecook.net (8.12.6/8.12.6) with ESMTP id h1A3V4bH001302;
	Mon, 10 Feb 2003 03:31:05 GMT
	(envelope-from ollie@laptop.home.olliecook.net)
Received: (from root@localhost)
	by laptop.home.olliecook.net (8.12.6/8.12.6/Submit) id h1A3V4gM001301;
	Mon, 10 Feb 2003 03:31:04 GMT
Message-Id: <200302100331.h1A3V4gM001301@laptop.home.olliecook.net>
Date: Mon, 10 Feb 2003 03:31:04 GMT
From: Ollie Cook <ollie@uk.clara.net>
Reply-To: Ollie Cook <ollie@uk.clara.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ollie@uk.clara.net
Subject: panic when attaching firewire device (CDRW/DVD)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         48129
>Category:       kern
>Synopsis:       panic when attaching firewire device (CDRW/DVD)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    simokawa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 09 19:40:03 PST 2003
>Closed-Date:    Thu Feb 27 20:27:55 PST 2003
>Last-Modified:  Thu Feb 27 20:27:55 PST 2003
>Originator:     Ollie Cook
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD laptop.home.olliecook.net 4.7-STABLE FreeBSD 4.7-STABLE #6: Mon Feb 10 02:21:40 GMT 2003 root@laptop.olliecook.net:/usr/src/sys/compile/LAPTOP i386


	
>Description:
	
	Laptop (Dell X200 Latitude) running RELENG-4 panics during boot if CDRW/DVD device is attached to firewire bus. If device is attached after a successful boot, the laptop also panics. The instruction pointer on crash is in the sbp_get_text_leaf function. A backtrace from a kernel coredump is:

(kgdb) bt
#0  dumpsys () at ../../kern/kern_shutdown.c:487
#1  0xc01875a7 in boot (howto=260) at ../../kern/kern_shutdown.c:316
#2  0xc01879e5 in panic (fmt=0xc02df484 "from debugger")
    at ../../kern/kern_shutdown.c:595
#3  0xc0139afd in db_panic (addr=-1072303954, have_addr=0, count=-1, 
    modif=0xc031c0dc "") at ../../ddb/db_command.c:435
#4  0xc0139a9d in db_command (last_cmdp=0xc031f884, cmd_table=0xc031f6c4, 
    aux_cmd_tablep=0xc0358ad4) at ../../ddb/db_command.c:333
#5  0xc0139b62 in db_command_loop () at ../../ddb/db_command.c:457
#6  0xc013bc9f in db_trap (type=12, code=0) at ../../ddb/db_trap.c:71
#7  0xc02b972e in kdb_trap (type=12, code=0, regs=0xc031c230)
    at ../../i386/i386/db_interface.c:158
#8  0xc02c8b28 in trap_fatal (frame=0xc031c230, eva=3252625180)
    at ../../i386/i386/trap.c:969
#9  0xc02c8801 in trap_pfault (frame=0xc031c230, usermode=0, eva=3252625180)
    at ../../i386/i386/trap.c:867
#10 0xc02c83a7 in trap (frame={tf_fs = -1043988464, tf_es = -1070530544, 
      tf_ds = -1072365552, tf_edi = 3, tf_esi = 0, tf_ebp = -1070480772, 
      tf_isp = -1070480804, tf_ebx = -1042342116, tf_edx = 8, 
      tf_ecx = -1043972056, tf_eax = 407485, tf_trapno = 12, tf_err = 0, 
      tf_eip = -1072303954, tf_cs = 8, tf_eflags = 66054, 
      tf_esp = -1043972096, tf_ss = -1043962460}) at ../../i386/i386/trap.c:466
#11 0xc015f0ae in sbp_get_text_leaf (fwdev=0xc1c64000, key=3, 
    buf=0xc1c665a4 "", len=32) at ../../dev/firewire/sbp.c:530
#12 0xc015f134 in sbp_probe_lun (sdev=0xc1c66580)
    at ../../dev/firewire/sbp.c:550
#13 0xc015f226 in sbp_probe_target (target=0xc199b414, alive=1)
    at ../../dev/firewire/sbp.c:588
#14 0xc015f47f in sbp_post_explore (arg=0xc199b400)
    at ../../dev/firewire/sbp.c:718
#15 0xc01573ad in fw_attach_dev (fc=0xc19b7000)
    at ../../dev/firewire/firewire.c:1560
#16 0xc0156d57 in fw_bus_explore (fc=0xc19b7000)
    at ../../dev/firewire/firewire.c:1252
#17 0xc015716d in fw_bus_explore_callback (xfer=0xc1c66580)
    at ../../dev/firewire/firewire.c:1453
#18 0xc0156258 in fw_xfer_done (xfer=0xc1c66580)
    at ../../dev/firewire/firewire.c:842
#19 0xc015764d in fw_rcv (fc=0xc19b7000, buf=0xc1c0e000 "", len=16, sub=0, 
    off=0, spd=0) at ../../dev/firewire/firewire.c:1683
#20 0xc015e47b in fwohci_arcv (sc=0xc19b7000, dbch=0xc19bb56c, count=-1)
    at ../../dev/firewire/fwohci.c:2757
#21 0xc015ce91 in fwohci_intr_body (sc=0xc19b7000, stat=32, count=-1)
    at ../../dev/firewire/fwohci.c:1849
#22 0xc015d1c0 in fwohci_intr (arg=0xc19b7000)
    at ../../dev/firewire/fwohci.c:1962
#23 0xc02d0e7d in intr_mux (arg=0xc105e1e0)
    at ../../i386/isa/intr_machdep.c:582
#24 0xc02bfdbe in cpu_idle () at ../../i386/i386/machdep.c:1022
(kgdb) fr 11
#11 0xc015f0ae in sbp_get_text_leaf (fwdev=0xc1c64000, key=3, 
    buf=0xc1c665a4 "", len=32) at ../../dev/firewire/sbp.c:530
530		src = (u_int32_t *) creg + creg->val;
(kgdb) p *fwdev
cannot read proc at 0
(kgdb) p fwdev
$1 = (struct fw_device *) 0x671c02
(kgdb) p creg->val
cannot read proc at 0
(kgdb) quit

which suggests derefencing a null pointer.

>How-To-Repeat:
	Attach CDRW/DVD to the firewire bus.
>Fix:
	None known at this time.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->simokawa 
Responsible-Changed-By: simokawa 
Responsible-Changed-When: Mon Feb 10 00:54:50 PST 2003 
Responsible-Changed-Why:  
I'll take care of this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48129 

From: Ollie Cook <ollie@uk.clara.net>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Subject: Re: kern/48129: panic when attaching firewire device (CDRW/DVD)
Date: Mon, 10 Feb 2003 09:41:20 +0000

 On Sun, Feb 09, 2003 at 07:40:03PM -0800, FreeBSD-gnats-submit@FreeBSD.org wrote:
 > Thank you very much for your problem report.
 > It has the internal identification `kern/48129'.
 > The individual assigned to look at your
 > report is: freebsd-bugs. 
 
 As requested:
 
 su-2.05b# fwcontrol -d 0
 fwcontrol: open: No such file or directory
 su-2.05b# fwcontrol -d 1
 fwcontrol: open: No such file or directory
 su-2.05b# fwcontrol -r
 fwcontrol: open: No such file or directory
 su-2.05b# fwcontrol -t
 fwcontrol: open: No such file or directory
 
 Seems the bus is not properly scanned?
 
 I include a dmesg output:
 
 Copyright (c) 1992-2003 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 4.7-STABLE #6: Mon Feb 10 02:21:40 GMT 2003
     root@laptop.olliecook.net:/usr/src/sys/compile/LAPTOP
 Timecounter "i8254"  frequency 1193182 Hz
 CPU: Intel(R) Pentium(R) III Mobile CPU       800MHz (797.35-MHz 686-class CPU)
   Origin = "GenuineIntel"  Id = 0x6b1  Stepping = 1
   Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
 real memory  = 348127232 (339968K bytes)
 avail memory = 334381056 (326544K bytes)
 Preloaded elf kernel "kernel" at 0xc03ee000.
 Pentium Pro MTRR support enabled
 md0: Malloc disk
 Using $PIR table, 9 entries at 0xc00fdf30
 apm0: <APM BIOS> on motherboard
 apm0: found APM BIOS v1.2, connected at v1.2
 npx0: <math processor> on motherboard
 npx0: INT 16 interface
 pcib0: <Host to PCI bridge> on motherboard
 pci0: <PCI bus> on pcib0
 agp0: <Intel 82830 (i830M GMCH) SVGA controller> mem 0xe0000000-0xe007ffff,0xe8000000-0xefffffff irq 10 at device 2.0 on pci0
 agp0: detected 8060k stolen memory
 agp0: aperture size is 128M
 pci0: <unknown card> (vendor=0x8086, dev=0x3577) at 2.1
 pci0: <UHCI USB controller> at 29.0 irq 10
 pci0: <UHCI USB controller> at 29.1 irq 11
 pci0: <UHCI USB controller> at 29.2 irq 11
 pcib1: <PCI to PCI bridge (vendor=8086 device=2448)> at device 30.0 on pci0
 pci2: <PCI bus> on pcib1
 pci_cfgintr_linked: linked (60) to hard-routed irq 10
 pci_cfgintr: 2:3 INTA routed to irq 10
 pcic0: <Ricoh RL5C475 PCI-CardBus Bridge> irq 10 at device 3.0 on pci2
 pcic0: PCI Memory allocated: 0x88000000
 pccard0: <PC Card 16-bit bus (classic)> on pcic0
 fwohci0: vendor=1180, dev=551
 fwohci0: <1394 Open Host Controller Interface> mem 0xe0200000-0xe02007ff irq 11 at device 3.1 on pci2
 fwohci0: PCI bus latency was changing to 250.
 fwohci0: OHCI version 1.0 (ROM=1)
 fwohci0: No. of Isochronous channel is 4.
 fwohci0: EUI64 00:06:5b:80:01:0f:73:d3
 fwohci0: Phy 1394a available S400, 2 ports.
 fwohci0: Link S400, max_rec 2048 bytes.
 firewire0: <IEEE1394(FireWire) bus> on fwohci0
 sbp0: <SBP2/SCSI over firewire> on firewire0
 xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xa000-0xa07f mem 0xe0200800-0xe020087f irq 11 at device 5.0 on pci2
 xl0: Ethernet address: 00:06:5b:89:83:f0
 miibus0: <MII bus> on xl0
 ukphy0: <Generic IEEE 802.3u media interface> on miibus0
 ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 isab0: <PCI to ISA bridge (vendor=8086 device=248c)> at device 31.0 on pci0
 isa0: <ISA bus> on isab0
 atapci0: <Intel ICH3 ATA100 controller> port 0x9000-0x900f,0-0x3,0-0x7,0-0x3,0-0x7 at device 31.1 on pci0
 ata0: at 0x1f0 irq 14 on atapci0
 ata1: at 0x170 irq 15 on atapci0
 pci0: <unknown card> (vendor=0x8086, dev=0x2483) at 31.3 irq 10
 pcm0: <Intel 82801CA (ICH3)> port 0x80c0-0x80ff,0x8400-0x84ff irq 10 at device 31.5 on pci0
 pcm0: <Cirrus Logic CS4299D ac97 codec>
 pci0: <unknown card> (vendor=0x8086, dev=0x2486) at 31.6 irq 10
 orm0: <Option ROMs> at iomem 0xc0000-0xccfff,0xd0000-0xd2fff,0xd3000-0xd3fff,0xd4000-0xd47ff,0xd4800-0xd4fff on isa0
 fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
 fdc0: FIFO enabled, 8 bytes threshold
 fd0: <1440-KB 3.5" drive> on fdc0 drive 0
 atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
 atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
 kbd0 at atkbd0
 psm0: <PS/2 Mouse> irq 12 on atkbdc0
 psm0: model Generic PS/2 mouse, device ID 0
 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
 sc0: <System console> at flags 0x100 on isa0
 sc0: VGA <16 virtual consoles, flags=0x300>
 fwohci0: BUS reset
 fwohci0: node_id = 0xc800ffc0, CYCLEMASTER mode
 firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
 ad0: 28615MB <IC25N030ATCS04-0> [58140/16/63] at ata0-master UDMA100
 Mounting root from ufs:/dev/ad0s3a
 uhci0: <Intel 82801CA/CAM (ICH3) USB controller USB-A> port 0x8c80-0x8c9f irq 10 at device 29.0 on pci0
 usb0: <Intel 82801CA/CAM (ICH3) USB controller USB-A> on uhci0
 usb0: USB revision 1.0
 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub0: 2 ports with 2 removable, self powered
 uhci1: <Intel 82801CA/CAM (ICH3) USB controller USB-B> port 0x8ca0-0x8cbf irq 11 at device 29.1 on pci0
 usb1: <Intel 82801CA/CAM (ICH3) USB controller USB-B> on uhci1
 usb1: USB revision 1.0
 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub1: 2 ports with 2 removable, self powered
 uhci2: <Intel 82801CA/CAM (ICH3) USB controller USB-C> port 0x8cc0-0x8cdf irq 11 at device 29.2 on pci0
 usb2: <Intel 82801CA/CAM (ICH3) USB controller USB-C> on uhci2
 usb2: USB revision 1.0
 uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
 uhub2: 2 ports with 2 removable, self powered
 
 Thanks,
 
 Ollie
 -- 
 Oliver Cook    Systems Administrator, Claranet UK
 ollie@uk.clara.net                  020 7903 3000

From: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To: Ollie Cook <ollie@uk.clara.net>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/48129: panic when attaching firewire device (CDRW/DVD)
Date: Mon, 10 Feb 2003 20:29:16 +0900

 Oops, I forgot to mention how to get the output without panic.
 Instruction follows.
 
 1. build kernel without firewire drivers.
 2. reboot with the new kernel.
 3. "kldload firewire" (don't load sbp)
 4. connect CDRW/DVD
 5. "cd /dev; ./MAKEDEV fw0"
 6. run "fwcontrol -d 0"
 
 /\ Hidetoshi Shimokawa
 \/  simokawa@sat.t.u-tokyo.ac.jp
 PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html
 
 At Mon, 10 Feb 2003 09:41:20 +0000,
 Ollie Cook wrote:
 > 
 > On Sun, Feb 09, 2003 at 07:40:03PM -0800, FreeBSD-gnats-submit@FreeBSD.org wrote:
 > > Thank you very much for your problem report.
 > > It has the internal identification `kern/48129'.
 > > The individual assigned to look at your
 > > report is: freebsd-bugs. 
 > 
 > As requested:
 > 
 > su-2.05b# fwcontrol -d 0
 > fwcontrol: open: No such file or directory
 > su-2.05b# fwcontrol -d 1
 > fwcontrol: open: No such file or directory
 > su-2.05b# fwcontrol -r
 > fwcontrol: open: No such file or directory
 > su-2.05b# fwcontrol -t
 > fwcontrol: open: No such file or directory
 > 
 > Seems the bus is not properly scanned?

From: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To: Ollie Cook <ollie@uk.clara.net>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/48129: panic when attaching firewire device (CDRW/DVD)
Date: Mon, 10 Feb 2003 21:11:44 +0900

 Though I'm not sure whether this fix your problem, can you try this patch?
 
 /\ Hidetoshi Shimokawa
 \/  simokawa@sat.t.u-tokyo.ac.jp
 PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html
 
 Index: sbp.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/dev/firewire/sbp.c,v
 retrieving revision 1.29
 diff -u -r1.29 sbp.c
 --- sbp.c	9 Feb 2003 07:40:27 -0000	1.29
 +++ sbp.c	10 Feb 2003 11:47:33 -0000
 @@ -521,13 +521,13 @@
  	chdr = (struct csrhdr *)&fwdev->csrrom[0];
  	creg = (struct csrreg *)chdr;
  	creg += chdr->info_len;
 -	for( i = chdr->info_len + 4; i <= fwdev->rommax; i+=4){
 +	for( i = chdr->info_len + 4; i <= fwdev->rommax - 4; i+=4){
  		if((creg++)->key == key){
  			found = 1;
  			break;
  		}
  	}
 -	if (!found) {
 +	if (!found || creg->key != CROM_TEXTLEAF) {
  		strncpy(buf, nullstr, len);
  		return;
  	}
State-Changed-From-To: open->feedback 
State-Changed-By: simokawa 
State-Changed-When: Wed Feb 12 19:56:10 PST 2003 
State-Changed-Why:  
A patch has been sent to the originator. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48129 

From: Ollie Cook <ollie@uk.clara.net>
To: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/48129: panic when attaching firewire device (CDRW/DVD)
Date: Thu, 13 Feb 2003 19:03:47 +0000

 On Mon, Feb 10, 2003 at 08:29:16PM +0900, Hidetoshi Shimokawa wrote:
 > Oops, I forgot to mention how to get the output without panic.
 > Instruction follows.
 > 
 > 1. build kernel without firewire drivers.
 > 2. reboot with the new kernel.
 > 3. "kldload firewire" (don't load sbp)
 > 4. connect CDRW/DVD
 > 5. "cd /dev; ./MAKEDEV fw0"
 > 6. run "fwcontrol -d 0"
 
 Hi,
 
 Sorry for the late reply; I have been on holiday.
 
 The information I receive with the CDRW/DVD drive connected is:
 
 -bash-2.05b$ fwcontrol -t
 crc_len: 4 generation:15 node_count:2 sid_count:2
 id link gap_cnt speed delay cIRM power port0 port1 port2 ini more
 00    1       1  S400     0    1   15W     P     -         1    0
 01    1      63  S400     0    0   45W     C     -         0    0
 -bash-2.05b$ 
 
 -bash-2.05b$ fwcontrol -d 0
 fwcontrol: node 0 is myself.
 -bash-2.05b$ fwcontrol -d 1
 0429f9f0 31333934 00ffa112 00065b80 030f070f 000637bd 0c0083c0 0300065b
 81000011 04000001 81000014 d1000001 000cdb8f 1200609e 13010483 3ccb1920
 54004000 3a001408 3800609e 390104d8 3b000000 3d000000 14450000 17000000
 8100000b 0004a646 00000000 00000000 44454c4c 00000000 0004a646 00000000
 00000000 44454c4c 00000000 00067b52 00000000 00000000 54797065 35204578
 7465726e 616c0000 00000526 0000030d 00000508 000005e3 00000000 000005d5
 000000fb 00000000 000003a7 00000505 000004a9 000004ea 000001ff 00000000
 000005ab 00000640 00000000 0000008f 00000000 00000585 000003de 0000053c
 00000512 00000122 00000341 00000000 000004fb 00000603 000004e5 00000490
 0000045c 000005fd 00000115 00000670 00000108 0000066f 000001af 000004b5
 00000000 00000196 000001ee 00000000 000001eb 0000035c 0000047a 00000599
 00000000 0000002a 0000065b 0000054a 00000280 00000500 0000059e 00000632
 000005c7 000001e9 000002e0 0000037c 000004c1 00000000 00000051 00000375
 00000000 00000127 0000067e 000001df 000000bd 00000606 0000035b 00000000
 000004ec 000003e2 00000000 000005bf 000003e8 00000000 0000052e 000005d6
 000005e1 00000000 000003c2 000004b0 00000434 0000026f 000004fd 000005ca
 00000548 0000030c 00000645 00000076 00000186 00000239 00000000 000003e6
 0000052b 00000067 00000000 00000000 00000059 00000083 00000000 000003f2
 000002d9 000003ae 00000536 000002b4 00000000 000004bb 00000000 000005dc
 00000573 0000046a 0000039f 000003c7 0000043c 000000da 000003c6 0000067a
 0000025b 0000063d 0000047d 00000650 0000052d 00000481 00000000 0000030e
 0000039d 00000386 0000061d 000005b0 00000563 000000cc 000004a3 00000222
 00000529 000002fc 000004f0 0000063a 000003c4 000002fb 00000141 00000000
 0000017d 2804fb5d 2807366d 2807366d 0000041b 2804fb02 2805e688 28063030
 00000000 00000000 00000510 00063030 bfbffa10 2804faaf 2807366d 0aa1b747
 28062100 00000000 2805e688 280edc50 2807366d 2804fb5d 280712e2 2804cb33
 000002f4 2804fb02 28062100 00000000 bfbffa80 2804f8f7 2807366d 0aa1b747
 2805d4c8 bfbffa70 00000000 bfbffa74 2805e960 00000000 2804fb5d 080485be
 2807160f 2804f83a 2804fb02 2805e688 28063030 00000000 2805e688 28062100
 01063030 bfbffaa4 2804faaf 080485be 068acf04 28062100 00000001 2805e688
 28062000 080485be 2805e688 0aa1b747 28062100 bfbffadc 00000000 28062100
 01bffad0 bfbffb14 2804f8f7 080485be 068acf04 2805d4c8 bfbffb04 00000001
 
 Yours,
 
 Ollie
 
 -- 
 Oliver Cook    Systems Administrator, Claranet UK
 ollie@uk.clara.net                  020 7903 3000

From: Ollie Cook <ollie@uk.clara.net>
To: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/48129: panic when attaching firewire device (CDRW/DVD)
Date: Thu, 13 Feb 2003 20:00:45 +0000

 On Mon, Feb 10, 2003 at 09:11:44PM +0900, Hidetoshi Shimokawa wrote:
 > Though I'm not sure whether this fix your problem, can you try this patch?
 > 
 > /\ Hidetoshi Shimokawa
 > \/  simokawa@sat.t.u-tokyo.ac.jp
 > PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html
 > 
 > Index: sbp.c
 > ===================================================================
 > RCS file: /home/ncvs/src/sys/dev/firewire/sbp.c,v
 > retrieving revision 1.29
 > diff -u -r1.29 sbp.c
 > --- sbp.c	9 Feb 2003 07:40:27 -0000	1.29
 > +++ sbp.c	10 Feb 2003 11:47:33 -0000
 > @@ -521,13 +521,13 @@
 >  	chdr = (struct csrhdr *)&fwdev->csrrom[0];
 >  	creg = (struct csrreg *)chdr;
 >  	creg += chdr->info_len;
 > -	for( i = chdr->info_len + 4; i <= fwdev->rommax; i+=4){
 > +	for( i = chdr->info_len + 4; i <= fwdev->rommax - 4; i+=4){
 >  		if((creg++)->key == key){
 >  			found = 1;
 >  			break;
 >  		}
 >  	}
 > -	if (!found) {
 > +	if (!found || creg->key != CROM_TEXTLEAF) {
 >  		strncpy(buf, nullstr, len);
 >  		return;
 >  	}
 
 Hi,
 
 That patch fixes the panics when booting into a kernel with firewire and sbp
 compiled in.
 
 The drive becomes available as cd0 and mounting a filesystem worked correctly.
 
 The patch also fixes the panic when 'kldload sbp' is performed on a system
 without firewire or sbp compiled into the kernel.
 
 Thank you for this patch.
 
 Ollie
 
 -- 
 Oliver Cook    Systems Administrator, Claranet UK
 ollie@uk.clara.net                  020 7903 3000
State-Changed-From-To: feedback->closed 
State-Changed-By: simokawa 
State-Changed-When: Thu Feb 27 20:27:31 PST 2003 
State-Changed-Why:  
Fixed. 

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