Fixes the problem of SCSI midlayer trying to bounce buffers for memory above 4GB. Signed-off-by: Grant Grundler Index: arch/parisc/kernel/setup.c =================================================================== RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/setup.c,v retrieving revision 1.9 diff -u -p -r1.9 setup.c --- arch/parisc/kernel/setup.c 12 Oct 2004 01:07:00 -0000 1.9 +++ arch/parisc/kernel/setup.c 17 Nov 2004 04:24:00 -0000 @@ -53,6 +53,10 @@ struct proc_dir_entry * proc_runway_root struct proc_dir_entry * proc_gsc_root = NULL; struct proc_dir_entry * proc_mckinley_root = NULL; +#if !defined(CONFIG_PA20) && (defined(CONFIG_IOMMU_CCIO) || defined(CONFIG_IOMMU_SBA)) +int parisc_bus_is_phys = TRUE; /* Assume no IOMMU is present */ +EXPORT_SYMBOL(parisc_bus_is_phys); +#endif void __init setup_cmdline(char **cmdline_p) { Index: drivers/parisc/ccio-dma.c =================================================================== RCS file: /var/cvs/linux-2.6/drivers/parisc/ccio-dma.c,v retrieving revision 1.16 diff -u -p -r1.16 ccio-dma.c --- drivers/parisc/ccio-dma.c 26 Oct 2004 19:52:46 -0000 1.16 +++ drivers/parisc/ccio-dma.c 16 Nov 2004 18:59:35 -0000 @@ -1557,9 +1557,12 @@ static int ccio_probe(struct parisc_devi create_proc_read_entry(MODULE_NAME"-bitmap", S_IRWXU, proc_runway_root, ccio_resource_map, NULL); } + + ioc_count++; + parisc_vmerge_boundary = IOVP_SIZE; parisc_vmerge_max_size = BITS_PER_LONG * IOVP_SIZE; - ioc_count++; + parisc_has_iommu(); return 0; } Index: drivers/parisc/sba_iommu.c =================================================================== RCS file: /var/cvs/linux-2.6/drivers/parisc/sba_iommu.c,v retrieving revision 1.21 diff -u -p -r1.21 sba_iommu.c --- drivers/parisc/sba_iommu.c 9 Nov 2004 20:28:33 -0000 1.21 +++ drivers/parisc/sba_iommu.c 16 Nov 2004 19:04:40 -0000 @@ -880,17 +880,21 @@ sba_mark_invalid(struct ioc *ioc, dma_ad * * See Documentation/DMA-mapping.txt */ -static int -sba_dma_supported( struct device *dev, u64 mask) +static int sba_dma_supported( struct device *dev, u64 mask) { + struct ioc *ioc; if (dev == NULL) { printk(KERN_ERR MODULE_NAME ": EISA/ISA/et al not supported\n"); BUG(); return(0); } - /* only support 32-bit PCI devices - no DAC support (yet) */ - return((int) (mask == 0xffffffffUL)); + ioc = GET_IOC(dev); + + /* check if mask is > than the largest IO Virt Address */ + + return((int) (mask >= (ioc->ibase + + (ioc->pdir_size / sizeof(u64) * IOVP_SIZE) ))); } @@ -2113,7 +2117,7 @@ sba_driver_callback(struct parisc_device #endif parisc_vmerge_boundary = IOVP_SIZE; parisc_vmerge_max_size = IOVP_SIZE * BITS_PER_LONG; - + parisc_has_iommu(); return 0; } Index: include/asm-parisc/pci.h =================================================================== RCS file: /var/cvs/linux-2.6/include/asm-parisc/pci.h,v retrieving revision 1.12 diff -u -p -r1.12 pci.h --- include/asm-parisc/pci.h 3 Nov 2004 00:57:50 -0000 1.12 +++ include/asm-parisc/pci.h 16 Nov 2004 18:55:42 -0000 @@ -106,11 +106,27 @@ static __inline__ int pci_is_lmmio(stru struct pci_bus; struct pci_dev; -/* The PCI address space does equal the physical memory - * address space. The networking and block device layers use +/* + * If the PCI device's view of memory is the same as the CPU's view of memory, + * PCI_DMA_BUS_IS_PHYS is true. The networking and block device layers use * this boolean for bounce buffer decisions. */ -#define PCI_DMA_BUS_IS_PHYS (1) +#ifdef CONFIG_PA20 +/* All PA-2.0 machines have an IOMMU. */ +#define PCI_DMA_BUS_IS_PHYS 0 +#define parisc_has_iommu() do { } while (0) +#else + +#if defined(CONFIG_IOMMU_CCIO) || defined(CONFIG_IOMMU_SBA) +#define PCI_DMA_BUS_IS_PHYS parisc_bus_is_phys +#define parisc_has_iommu() do { parisc_bus_is_phys = 1; } while (0) +#else +#define PCI_DMA_BUS_IS_PHYS 1 +#define parisc_has_iommu() do { } while (0) +#endif + +#endif /* !CONFIG_PA20 */ + /* ** Most PCI devices (eg Tulip, NCR720) also export the same registers