From wkb@freebie.demon.nl  Fri Jul 28 06:13:23 2000
Return-Path: <wkb@freebie.demon.nl>
Received: from post.mail.nl.demon.net (post-10.mail.nl.demon.net [194.159.73.20])
	by hub.freebsd.org (Postfix) with ESMTP id 1BF8737BB89
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 28 Jul 2000 06:13:19 -0700 (PDT)
	(envelope-from wkb@freebie.demon.nl)
Received: from [212.238.54.101] (helo=freebie.demon.nl)
	by post.mail.nl.demon.net with smtp (Exim 3.14 #2)
	id 13I9wz-0002gc-01
	for FreeBSD-gnats-submit@freebsd.org; Fri, 28 Jul 2000 13:13:18 +0000
Received: (from wkb@localhost)
	by freebie.demon.nl (8.9.3/8.9.3) id PAA05912;
	Fri, 28 Jul 2000 15:12:59 +0200 (CEST)
	(envelope-from wkb)
Message-Id: <200007281312.PAA05912@freebie.demon.nl>
Date: Fri, 28 Jul 2000 15:12:59 +0200 (CEST)
From: wilko@freebsd.org
Sender: wkb@freebie.demon.nl
Reply-To: wilko@freebsd.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: DEFPA FDDI on alpha panics system
X-Send-Pr-Version: 3.2

>Number:         20248
>Category:       alpha
>Synopsis:       DEFPA FDDI on alpha panics system
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-alpha
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 28 06:20:00 PDT 2000
>Closed-Date:    Mon Jan 15 12:13:12 PST 2001
>Last-Modified:  Mon Jan 15 12:14:44 PST 2001
>Originator:     Wilko Bulte
>Release:        FreeBSD 4.1-R alpha
>Organization:
Private FreeBSD site - The Netherlands
>Environment:

	4.1-R on a MiataGL-600au. System contains a DEC DEFPA FDDI PCI
	adapter

>Description:

presence of 'device fpa' in the kernel produces a panic on 
boot as follows:

isp0: interrupting at CIA irq 3
fpa0: <Digital DEFPA PCI FDDI Controller> port 0x8100-0x817f mem
0x80800000-0x8080ffff,0x80821000-0x8082107f irq 16 at device 9.0 on pci1
     
fatal kernel trap:
     
    trap entry = 0x2 (memory management fault)  
    a0         = 0x80821014
    a1         = 0x1
    a2         = 0x0
    pc         = 0xfffffc0000369158
    ra         = 0xfffffc0000368e98
    curproc    = 0xfffffc000057e988
        pid = 0, comm = swapper
     
ddbprinttrap from 0xfffffc0000369158
ddbprinttrap(0x80821014, 0x1, 0x0, 0x2)
panic: trap
panic
Stopped at      Debugger+0x2c:  ldq     ra,0(sp) <0xfffffc00005e5900>
<ra=0xfffffc00004c3ca0,sp=0xfffffc00005e5900>
db> t
Debugger() at Debugger+0x2c
panic() at panic+0x100
trap() at trap+0x610
XentMM() at XentMM+0x20
pdq_initialize() at pdq_initialize+0x278
(null)() at 0x6
db>
     
and
     
fffffc00003688e0 T pdq_interrupt
fffffc0000368c20 T pdq_initialize
fffffc00003691c0 T pdq_ifinit
fffffc0000369300 T pdq_ifwatchdog
fffffc0000369380 T pdq_ifstart
fffffc0000369520 T pdq_os_receive_pdu
fffffc0000369620 T pdq_os_restart_transmitter 
     
It seems something in pdq_initialize might be doing something wrong. At
least, it does on alpha. I tested with one DEFPA in a current i386 FreeBSD
box and the other one in the Miata running T64 4.0G. That works just fine.

>How-To-Repeat:

	See above

>Fix:

Thanks to Andrew Gallatin for:

Index: pci/pci_compat.c
===================================================================
RCS file: /home/ncvs/src/sys/pci/pci_compat.c,v
retrieving revision 1.35
diff -u -r1.35 pci_compat.c
--- pci/pci_compat.c    2000/02/28 08:12:24     1.35
+++ pci/pci_compat.c    2000/07/25 15:03:00
@@ -96,7 +96,7 @@
     
        rid = reg;
        res = bus_alloc_resource(cfg->dev, SYS_RES_MEMORY, &rid,
-                                0, ~0, 1, RF_ACTIVE);
+                                0, ~0, 1, RF_ACTIVE|PCI_RF_DENSE);
        if (res) {
                *pa = rman_get_start(res);
                *va = (vm_offset_t) rman_get_virtual(res);

This solves the panic condition. It does not, however result in a working
DEFPA/FDDI link. Note that de fpa driver in -current (I think this is the
same as in 4.1) on i386 works just fine. 

>Release-Note:
>Audit-Trail:

From: Wilko Bulte <wkb@chello.nl>
To: freebsd-gnats-submit@FreeBSD.org, wilko@FreeBSD.org
Cc:  
Subject: Re: alpha/20248: DEFPA FDDI on alpha panics system
Date: Fri, 11 Aug 2000 14:15:55 +0200

 It appears that the probe on alpha is quite incomplete, judging from the
 messages the kernel displays on boot:
 
 	Alpha probe messages:
 fpa0: <Digital DEFPA PCI FDDI Controller> port 0x9000-0x907f mem
 0x80950000-0x80
 95ffff,0x80975000-0x8097507f irq 4 at device 11.0 on pci0
 fpa0: interrupting at CIA irq 4
 fpa0: driver is using old-style compatability shims
 
 	Intel probe messages:
 fpa0: <Digital DEFPA PCI FDDI Controller> port 0xe400-0xe47f mem
 0xfbf90000-0xfbf9ffff,0xfbfaf000-0xfbfaf07f irq 9 at device 9.0 on pci0
 fpa0: DEC DEFPA PCI FDDI SAS Controller
 fpa0: FDDI address 00:00:f8:43:c4:53, FW=3.10, HW=1, SMT V7.2
 fpa0: FDDI Port = S (PMD = ANSI Multi-Mode)
 fpa0: driver is using old-style compatability shims
 
 The missing messages are produced by pdq_print_fddi_chars() which
 is only called by pdq_process_command_responses(). It appears the 
 kernel cannot send commands to the card correctly (and/or receive
 the commands). This is in line with the fact that ifconfig can UP
 the interface but never a RING UP condition is detected.
 
 -- 
 Wilko Bulte  	 
 wilko@freebsd.org			Arnhem, the Netherlands
 
State-Changed-From-To: open->closed 
State-Changed-By: wilko 
State-Changed-When: Mon Jan 15 12:13:12 PST 2001 
State-Changed-Why:  
fpa driver is fixed in -current for some time now. Verified 
with DEFPA in a Miata MX5 talking to a PPro running FreeBSD as 
well. 


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

I tried moving the DEFPA to a 64bit PCI slot (before the Miata's bridge) while 
keeping the PCI_RF_DENSE patch in. The card is detected OK, ifconfig
can 'UP' it but it does not work either.

