|
From: Richard C. <Ric...@su...> - 2003-06-27 15:42:35
|
I've started another round of trying to get this card working with the
Cayman. First off, I've found that with the card in a different Cayman
I'm getting a lot further than before.
I'm configuring in the sym53c8xx_2 scsi driver, and selecting 0 for the
DMA mode (i.e. 32 bit always).
I had to fix memcpy_toio and memcpy_fromio (arch/sh64/lib/io.c) to make
them have the same semantics as sh. This helped get it further still.
(Not bk-push'able yet though because they've got diagnostics in still.)
However, I'm now hitting a problem with the scatter-gather stuff. I've
got pci_map_sg annotated thusly
static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
int nents,int direction)
{
int i;
for (i=0; i<nents; i++) {
if (sg[i].address == 0) {
printk("pci_map_sg, sg[%d]==0 (length=%d, nents=%d)\n", i, sg[i].length, nents);
} else {
printk("pci_map_sg, sg[%d]=0x%08lx, length=%d\n", i, (unsigned long) sg[i].address, sg[i].length);
dma_cache_wback_inv((unsigned long)sg[i].address, sg[i].length);
}
}
return nents;
}
and my console messages now look like this:
SCSI subsystem driver Revision: 1.00
sym.0.2.0: setting PCI_COMMAND_PARITY...
sym.0.2.0: setting PCI_COMMAND_INVALIDATE.
sym.0.2.1: setting PCI_COMMAND_PARITY...
sym.0.2.1: setting PCI_COMMAND_INVALIDATE.
sym0: <1010-33> rev 0x1 on pci bus 0 device 2 function 0 irq 6
pci_alloc_consistent returns a07c4000, phys 0x807c4000, mapped to f0002000
sym0: Symbios NVRAM, ID 7, Fast-80, LVD, parity checking
sym0: open drain IRQ line driver, using on-chip SRAM
sym0: using LOAD/STORE-based firmware.
sym0: handling phase mismatch from SCRIPTS.
pci_alloc_consistent returns a07c3000, phys 0x807c3000, mapped to f0009000
pci_alloc_consistent returns a07c2000, phys 0x807c2000, mapped to f000b000
pci_alloc_consistent returns a07c1000, phys 0x807c1000, mapped to f000d000
pci_alloc_consistent returns a07c0000, phys 0x807c0000, mapped to f000f000
OUTRAM_OFF/memcpy_to_io f0007000 f000f000 0000052c
memcpy_toio called f0007000 f000f000 0000052c
OUTRAM_OFF/memcpy_to_io f0006000 f000d000 00000bd0
memcpy_toio called f0006000 f000d000 00000bd0
sym0: SCSI BUS has been reset.
sym1: <1010-33> rev 0x1 on pci bus 0 device 2 function 1 irq 6
pci_alloc_consistent returns a07be000, phys 0x807be000, mapped to f0011000
sym1: Symbios NVRAM, ID 7, Fast-80, SE, parity checking
sym1: open drain IRQ line driver, using on-chip SRAM
sym1: using LOAD/STORE-based firmware.
sym1: handling phase mismatch from SCRIPTS.
pci_alloc_consistent returns a07bd000, phys 0x807bd000, mapped to f0018000
pci_alloc_consistent returns a07bc000, phys 0x807bc000, mapped to f001a000
pci_alloc_consistent returns a07bb000, phys 0x807bb000, mapped to f001c000
pci_alloc_consistent returns a07ba000, phys 0x807ba000, mapped to f001e000
OUTRAM_OFF/memcpy_to_io f0016000 f001e000 0000052c
memcpy_toio called f0016000 f001e000 0000052c
OUTRAM_OFF/memcpy_to_io f0015000 f001c000 00000bd0
memcpy_toio called f0015000 f001c000 00000bd0
sym1: SCSI BUS has been reset.
sym1: SCSI BUS mode change from SE to SE.
OUTRAM_OFF/memcpy_to_io f0016000 f001e000 0000052c
memcpy_toio called f0016000 f001e000 0000052c
OUTRAM_OFF/memcpy_to_io f0015000 f001c000 00000bd0
memcpy_toio called f0015000 f001c000 00000bd0
sym1: SCSI BUS has been reset.
scsi0 : sym-2.1.17a
scsi1 : sym-2.1.17a
blk: queue a07ce174, I/O limit 4095Mb (mask 0xffffffff)
Vendor: IBM Model: DDYS-T09170N Rev: S96H
Type: Direct-Access ANSI SCSI revision: 03
blk: queue a07ce274, I/O limit 4095Mb (mask 0xffffffff)
sym1:6:0: tagged command queuing enabled, command queue depth 16.
Attached scsi disk sda at scsi1, channel 0, id 6, lun 0
sym1:6:0:M_REJECT to send for : 1-6-4-c-0-3e-1-0.
sym1:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 31)
SCSI device sda: 17916240 512-byte hdwr sectors (9173 MB)
Partition check:
sda:pci_map_sg, sg[0]==0 (length=1024, nents=4)
pci_map_sg, sg[1]==0 (length=1024, nents=4)
pci_map_sg, sg[2]==0 (length=1024, nents=4)
pci_map_sg, sg[3]==0 (length=1024, nents=4)
PCI ARB INTERRUPT!
PCI AINT -> 0x4
PCI AIR -> 0xe0000000
PCI CIR -> 0x8000000f
sym1:6: ERROR (20:0) (1-21-0) (1f/38/0) @ (scripta 7d8:110003d8).
sym1: script cmd = 11000000
sym1: regdump: da 10 c0 38 47 1f 06 0e 0e 01 86 21 80 01 01 01 00 ec 7b 80 08 00 00 00.
sym1: PCI STATUS = 0x2000
sym1: SCSI BUS reset detected.
OUTRAM_OFF/memcpy_to_io f0016000 f001e000 0000052c
memcpy_toio called f0016000 f001e000 0000052c
OUTRAM_OFF/memcpy_to_io f0015000 f001c000 00000bd0
memcpy_toio called f0015000 f001c000 00000bd0
sym1: SCSI BUS has been reset.
pci_map_sg, sg[0]==0 (length=1024, nents=4)
pci_map_sg, sg[1]==0 (length=1024, nents=4)
pci_map_sg, sg[2]==0 (length=1024, nents=4)
pci_map_sg, sg[3]==0 (length=1024, nents=4)
pci_map_sg, sg[0]==0 (length=1024, nents=4)
[etc]
(The OUTRAM_OFF/memcpy_to_io messages are other debug I've added.) So
the card is booting, it's even detecting the drive correctly now (yup,
IBM Ultrastar 9.1Gb is right). However, it's clear that the addresses
in the scatter-gather list are all zeroes. I guess this leads onto the
PCI ARB interrupt because the Tekram is going to attempt a DMA to a
bogus physical address.
I've now got stuck because I got lost trying to follow the call chain
back far enough to locate where the scatter-gather buffers are getting
allocated and hence why the addresses in the table passed to pci_map_sg
are all zero. I suspect there's something in asm-sh64 or arch/sh64
that's missing a real implementation, but I've no idea what.
Is anybody au fait with this area of the code and able to give me any
pointers where to look next?
Cheers
Richard
--
Richard \\\ SuperH Core+Debug Architect /// .. At home ..
P. /// ric...@su... /// rc...@rc...
Curnow \\\ http://www.superh.com/ /// www.rc0.org.uk
|