Skip to contentSkip to conversation

: Kill SBUS device layer.

PATCH In review David Miller 2 participants 5 messages Aug 28, 2008 Network drivers

lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

cover : Kill SBUS device layer.

[ Stephen, I'm only going to CC: on this email not the
rest of the patch bomb, as I figured you'd have some at least cursory interest in this work. Thanks. ]

A long time ago in a galaxy far far away we had no generic device layer and generic OF device driver infrastructure. Thus I created a bunch of ad-hoc interfaces and datastructures to support SBUS device drivers.

Those days are gone but the rotting corpose of the SBUS device layer stays with us. It's time to end that :)

This patch series follows roughly the following sequence:

1) Kill ad-hoc SBUS DVMA driver, only ESP and SUNLANCE use this and they can do so with local code.

2) Make dma_map_*() work for SBUS devices.

3) Make SBUS drivers use dma_*() instead of sbus_*().

4) Convert SBUS drivers to use OF device driver style probing. This is probably the bulk of the patch series.

5) Add local IOMMU controller initialization and a OF node propagator helper routine so that the device->archdata.FOO fields get set on all child devices of a given bus where an IOMMU is discovered setup.

6) rm arch/sparc/include/sbus*.h drivers/sbus/*.c

7) Profit.

All of my testing was done on an Ultra2 with ESP, SUNHME, CS4231 audio, and an SBUS Flash device.

I plan to do the same for the EBUS bus layer as well. The only tricky case there is the CS4231 sound driver as it supports both EBUS and SBUS devices, but I have a plan to sort that out cleanly.

This work will also make converting sparc32 over to the generic IRQ layer much easier as well.

Anyways, after this sits for review for a day or two I'll push this into the sparc-next-2.6 tree.

Enjoy.

#1 lore raw

Hi,

I also tested your patches on my Ultra 2, it has an Quad FastEthernet network interface card which causes a panic on boot:

Quattro: Fatal IRQ registery error -16.

Attached are two boot logs, one with your patches applied and one without.

Cheers,
Friedrich

Sun Ultra 2 UPA/SBus (2 X UltraSPARC-II 400MHz), No Keyboard OpenBoot 3.11, 1152 MB memory installed, Serial #10208913. Ethernet address 8:0:20:9b:c6:91, Host ID: 809bc691.

Boot device: /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0:a File and args:
SILO Version 1.4.14
boot:
Allocated 64 Megs of memory at 0x40000000 for kernel Loaded kernel version 2.6.27

PROMLIB: Sun IEEE Boot Prom 'OBP 3.11.2 1997/12/05 10:25'
PROMLIB: Root node compatible:
Linux version 2.6.27-rc4-00278-g4c246ed (bluebird@nafrayu) (gcc version 4.3.1 (Gentoo 4.3.1-r1 p1.1) ) #51 SMP PREEMPT Thu Aug 28 18:45:53 CEST 2008 console [earlyprom0] enabled
ARCH: SUN4U
Ethernet address: 08:00:20:9b:c6:91
Kernel: Using 2 locked TLB entries for main kernel image.
Remapping the kernel... done.
OF stdout device is: /sbus@1f,0/zs@f,1100000:a
PROM: Built device tree with 43373 bytes of memory.
Top of RAM: 0x67f24000, Total RAM: 0x47f12000
Memory hole size: 512MB
[0000000200000000-fffff80000400000] page_structs=131072 node=0 entry=0/0
[0000000200000000-fffff80000800000] page_structs=131072 node=0 entry=1/0
[0000000200700000-fffff80000c00000] page_structs=131072 node=0 entry=2/0
[0000000200700000-fffff80001000000] page_structs=131072 node=0 entry=3/0
Zone PFN ranges:
Normal 0x00000000 -> 0x00033f92
Movable zone start PFN for each node
early_node_map[4] active PFN ranges

    0: 0x00000000 -> 0x00018000
    0: 0x00020000 -> 0x00028000
    0: 0x00030000 -> 0x00033f7e
    0: 0x00033f87 -> 0x00033f92

Booting Linux...
Built 1 zonelists in Node order, mobility grouping on. Total pages: 145881
Policy zone: Normal
Kernel command line: root=/dev/sda4 console=/dev/ttyS0 bonding.miimon=100
Preemptible RCU implementation.
PID hash table entries: 4096 (order: 12, 32768 bytes)
clocksource: mult[28002] shift[16]
clockevent: mult[66660415] shift[32]
Console: colour dummy device 80x25
Dentry cache hash table entries: 262144 (order: 8, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 7, 1048576 bytes)
Memory: 1154096k available (3136k kernel code, 856k data, 184k init) [fffff80000000000,0000000067f24000] Calibrating delay using timer specific routine.. 802.70 BogoMIPS (lpj=1605403)
Security Framework initialized
Mount-cache hash table entries: 512
CPU 1: synchronized TICK with master CPU (last diff -5 cycles, maxerr 682 cycles) Brought up 2 CPUs
net_namespace: 800 bytes
NET: Registered protocol family 16
SCSI subsystem initialized
SYSIO: UPA portID 1f, at 000001fe00000000
sbus0: Clock 25.0 MHz
dma0: HME DVMA gate array
dma1: ESC Revision 1
AUXIO: Found device at /sbus@1f,0/auxio@f,1900000
/sbus@1f,0/eeprom@f,1200000: Clock regs at 000001fff1200000
tracer: 643 pages allocated for 65536 entries of 80 bytes
actual entries 65586
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 6, 524288 bytes)
TCP established hash table entries: 262144 (order: 9, 4194304 bytes)
TCP bind hash table entries: 65536 (order: 7, 1048576 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
NET: Registered protocol family 1
Mini RTC Driver
fuse init (API version 7.9)
msgmni has been set to 2254
io scheduler noop registered
io scheduler cfq registered (default)
Console: switching to colour frame buffer device 160x64
/SUNW,ffb@1e,0: FFB at 000001fc00000000, type 67, DAC pnum[236c] rev[10] manuf_rev[4]
f005bbcc: ttyS0 at MMIO 0x1fff1100000 (irq = 9) is a zs
Console: ttyS0 (SunZilog zs0)
console handover: boot [earlyprom0] -> real [ttyS0]
f005bbcc: ttyS1 at MMIO 0x1fff1100004 (irq = 9) is a zs
f005d06c: Keyboard at MMIO 0x1fff1000000 (irq = 9) is a zs
f005d06c: Mouse at MMIO 0x1fff1000004 (irq = 9) is a zs
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
loop: module loaded
Ethernet Channel Bonding Driver: v3.3.0 (June 10, 2008)
bonding: MII link monitoring set to 100 ms
sunhme.c:v3.00 June 23, 2006 David S. Miller ([email protected])
eth0: HAPPY MEAL (SBUS) 10/100baseT Ethernet 08:00:20:9b:c6:91
eth1: Quattro HME slot 0 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:38
eth2: Quattro HME slot 1 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:39
eth3: Quattro HME slot 2 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:3a
eth4: Quattro HME slot 3 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:3b
esp: esp0, regs[1ffe8810000:1ffe8800000] irq[10]
esp: esp0 is a FASHME, 40 MHz (ccf=0), SCSI ID 7
scsi0 : esp
esp: esp1, regs[1ff20080000:1ff20081000] irq[14]
esp: esp1 is a FAS236, 40 MHz (ccf=0), SCSI ID 7
scsi 0:0:0:0: Direct-Access SEAGATE ST373405LC 0002 PQ: 0 ANSI: 3
scsi target0:0:0: Beginning Domain Validation
scsi target0:0:0: FAST-10 WIDE SCSI 20.0 MB/s ST (100 ns, offset 15)
scsi target0:0:0: Domain Validation skipping write tests
scsi target0:0:0: Ending Domain Validation
scsi 0:0:6:0: CD-ROM TOSHIBA CD-ROM XM-5401TA 3605 PQ: 0 ANSI: 2
scsi target0:0:6: Beginning Domain Validation
scsi target0:0:6: FAST-5 SCSI 4.2 MB/s ST (236 ns, offset 15)
scsi target0:0:6: Domain Validation skipping write tests
scsi target0:0:6: Ending Domain Validation
scsi1 : esp
Driver 'sd' needs updating - please use bus_type methods
Driver 'sr' needs updating - please use bus_type methods
OBP Flash: RD 1fff0000000[80000] WR 1fff1380000[80000]
mice: PS/2 mouse device common for all mice
sd 0:0:0:0: [sda] 143374741 512-byte hardware sectors (73408 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 0:0:0:0: [sda] 143374741 512-byte hardware sectors (73408 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
sda: sda1 sda2 sda3 sda4
sd 0:0:0:0: [sda] Attached SCSI disk
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Advanced Linux Sound Architecture Driver Version 1.0.17.
input: Sun Mouse as /devices/root/f005b27c/f005d06c/serio1/input/input0
ALSA device list:
#0: Sun CS4231 at 0xff:0x00000000dc000000, irq 7
TCP cubic registered
NET: Registered protocol family 10
NET: Registered protocol family 17
registered taskstats version 1
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
INIT: version 2.86 booting

Sun Ultra 2 UPA/SBus (2 X UltraSPARC-II 400MHz), No Keyboard OpenBoot 3.11, 1152 MB memory installed, Serial #10208913. Ethernet address 8:0:20:9b:c6:91, Host ID: 809bc691.

Rebooting with command: boot
Boot device: /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0:a File and args:
SILO Version 1.4.14
boot: linux2
Allocated 64 Megs of memory at 0x40000000 for kernel Loaded kernel version 2.6.27

PROMLIB: Sun IEEE Boot Prom 'OBP 3.11.2 1997/12/05 10:25'
PROMLIB: Root node compatible:
Linux version 2.6.27-rc4-00280-g4177d72 (bluebird@nafrayu) (gcc version 4.3.1 (Gentoo 4.3.1-r1 p1.1) ) #52 SMP PREEMPT Thu Aug 28 19:08:55 CEST 2008 console [earlyprom0] enabled
ARCH: SUN4U
Ethernet address: 08:00:20:9b:c6:91
Kernel: Using 2 locked TLB entries for main kernel image.
Remapping the kernel... done.
OF stdout device is: /sbus@1f,0/zs@f,1100000:a
PROM: Built device tree with 43373 bytes of memory.
Top of RAM: 0x67f24000, Total RAM: 0x47f12000
Memory hole size: 512MB
[0000000200000000-fffff80000400000] page_structs=131072 node=0 entry=0/0
[0000000200000000-fffff80000800000] page_structs=131072 node=0 entry=1/0
[0000000200700000-fffff80000c00000] page_structs=131072 node=0 entry=2/0
[0000000200700000-fffff80001000000] page_structs=131072 node=0 entry=3/0
Zone PFN ranges:
Normal 0x00000000 -> 0x00033f92
Movable zone start PFN for each node
early_node_map[4] active PFN ranges

    0: 0x00000000 -> 0x00018000
    0: 0x00020000 -> 0x00028000
    0: 0x00030000 -> 0x00033f7e
    0: 0x00033f87 -> 0x00033f92

Booting Linux...
Built 1 zonelists in Node order, mobility grouping on. Total pages: 145881
Policy zone: Normal
Kernel command line: root=/dev/sda4 console=/dev/ttyS0 bonding.miimon=100
Preemptible RCU implementation.
PID hash table entries: 4096 (order: 12, 32768 bytes)
clocksource: mult[28002] shift[16]
clockevent: mult[66660b6f] shift[32]
Console: colour dummy device 80x25
Dentry cache hash table entries: 262144 (order: 8, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 7, 1048576 bytes)
Memory: 1154080k available (3144k kernel code, 864k data, 176k init) [fffff80000000000,0000000067f24000] Calibrating delay using timer specific routine.. 802.09 BogoMIPS (lpj=1604191)
Security Framework initialized
Mount-cache hash table entries: 512
CPU 1: synchronized TICK with master CPU (last diff 5 cycles, maxerr 696 cycles) Brought up 2 CPUs
net_namespace: 800 bytes
NET: Registered protocol family 16
SYSIO: UPA portID ffffffff, at 000001fe00000000
SCSI subsystem initialized
AUXIO: Found device at /sbus@1f,0/auxio@f,1900000
/sbus@1f,0/eeprom@f,1200000: Clock regs at 000001fff1200000
tracer: 643 pages allocated for 65536 entries of 80 bytes
actual entries 65586
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 6, 524288 bytes)
TCP established hash table entries: 262144 (order: 9, 4194304 bytes)
TCP bind hash table entries: 65536 (order: 7, 1048576 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
NET: Registered protocol family 1
Mini RTC Driver
fuse init (API version 7.9)
msgmni has been set to 2254
io scheduler noop registered
io scheduler cfq registered (default)
Console: switching to colour frame buffer device 160x64
/SUNW,ffb@1e,0: FFB at 000001fc00000000, type 67, DAC pnum[236c] rev[10] manuf_rev[4]
f005bbcc: ttyS0 at MMIO 0x1fff1100000 (irq = 9) is a zs
Console: ttyS0 (SunZilog zs0)
console handover: boot [earlyprom0] -> real [ttyS0]
f005bbcc: ttyS1 at MMIO 0x1fff1100004 (irq = 9) is a zs
f005d06c: Keyboard at MMIO 0x1fff1000000 (irq = 9) is a zs
f005d06c: Mouse at MMIO 0x1fff1000004 (irq = 9) is a zs
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
loop: module loaded
Ethernet Channel Bonding Driver: v3.3.0 (June 10, 2008)
bonding: MII link monitoring set to 100 ms
sunhme.c:v3.10 August 26, 2008 David S. Miller ([email protected])
eth0: HAPPY MEAL (SBUS) 10/100baseT Ethernet 08:00:20:9b:c6:91
eth1: Quattro HME slot 0 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:38
eth2: Quattro HME slot 1 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:39
eth3: Quattro HME slot 2 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:3a
eth4: Quattro HME slot 3 (SBUS) 10/100baseT Ethernet 08:00:20:92:75:3b
Quattro: Fatal IRQ registery error -16.

Kernel panic - not syncing: QFE request irq

Press Stop-A (L1-A) to return to the boot prom

author maintainer
#2 lore raw
In reply to David Miller

From: Friedrich Oslage <[email protected]>
Date: Thu, 28 Aug 2008 19:49:12 +0200

Quoted 7 lines

I also tested your patches on my Ultra 2, it has an Quad FastEthernet network interface card which causes a panic on boot:

Quattro: Fatal IRQ registery error -16.

Attached are two boot logs, one with your patches applied and one without.

Thank you for testing, the following patch should fix the problem.

Let me know if it works.

drivers/net/sunhme.c +1 -1
index 7638a9f..dc46e97 100644
@@ -2534,7 +2534,7 @@ static struct quattro * __devinit quattro_sbus_find(struct of_device *child)
 		for (i = 0; i < 4; i++)
 			qp->happy_meals[i] = NULL;
 
-		qp->quattro_dev = op;
+		qp->quattro_dev = child;
 		qp->next = qfe_sbus_list;
 		qfe_sbus_list = qp;