|
From: Paul M. <le...@li...> - 2003-06-30 21:41:23
|
On Mon, Jun 30, 2003 at 06:31:50PM +0100, Richard Curnow wrote:
> The wierd behaviour is gone. I'm trying a larger test now, but I need
> to go home ASAP so will probably need to finish it in the morning.
>=20
> Anyway, it's looking like cache coherency around PCI DMA that might be
> the problem?
>=20
I see one potential user that might be a problem.. looking at the driver
itself, in __sync_scsi_data(), it wraps to pci_dma_sync_sg() and
pci_dma_sync_single() .. we're covered for the first one, but not the latte=
r.
Try this patch out, see if it helps any:
--- shmedia-2.4.test/include/asm-sh64/pci.h Mon Jun 30 17:30:50 2003
+++ shmedia-2.4/include/asm-sh64/pci.h Mon Jun 30 17:33:20 2003
@@ -210,7 +210,10 @@
dma_addr_t dma_handle,
size_t size,int direction)
{
- /* Nothing to do */
+ if (direction =3D=3D PCI_DMA_NONE)
+ BUG();
+=09
+ dma_cache_wback_inv(bus_to_virt(dma_handle), size);
}
=20
Once these issues are worked out, we can optimize the flush itself based off
of the dma direction .. though it makes sense to have things working first
prior to trying to optimize the corner cases.
|