diff options
Diffstat (limited to 'arch/ia64/sn/pci/pci_dma.c')
-rw-r--r-- | arch/ia64/sn/pci/pci_dma.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c index 0e4b9ad9ef02..9bf9f23b9a1f 100644 --- a/arch/ia64/sn/pci/pci_dma.c +++ b/arch/ia64/sn/pci/pci_dma.c | |||
@@ -75,7 +75,7 @@ EXPORT_SYMBOL(sn_dma_set_mask); | |||
75 | * more information. | 75 | * more information. |
76 | */ | 76 | */ |
77 | void *sn_dma_alloc_coherent(struct device *dev, size_t size, | 77 | void *sn_dma_alloc_coherent(struct device *dev, size_t size, |
78 | dma_addr_t * dma_handle, int flags) | 78 | dma_addr_t * dma_handle, gfp_t flags) |
79 | { | 79 | { |
80 | void *cpuaddr; | 80 | void *cpuaddr; |
81 | unsigned long phys_addr; | 81 | unsigned long phys_addr; |
@@ -326,6 +326,29 @@ int sn_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size) | |||
326 | { | 326 | { |
327 | unsigned long addr; | 327 | unsigned long addr; |
328 | int ret; | 328 | int ret; |
329 | struct ia64_sal_retval isrv; | ||
330 | |||
331 | /* | ||
332 | * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work | ||
333 | * around hw issues at the pci bus level. SGI proms older than | ||
334 | * 4.10 don't implment this. | ||
335 | */ | ||
336 | |||
337 | SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, | ||
338 | pci_domain_nr(bus), bus->number, | ||
339 | 0, /* io */ | ||
340 | 0, /* read */ | ||
341 | port, size, __pa(val)); | ||
342 | |||
343 | if (isrv.status == 0) | ||
344 | return size; | ||
345 | |||
346 | /* | ||
347 | * If the above failed, retry using the SAL_PROBE call which should | ||
348 | * be present in all proms (but which cannot work round PCI chipset | ||
349 | * bugs). This code is retained for compatability with old | ||
350 | * pre-4.10 proms, and should be removed at some point in the future. | ||
351 | */ | ||
329 | 352 | ||
330 | if (!SN_PCIBUS_BUSSOFT(bus)) | 353 | if (!SN_PCIBUS_BUSSOFT(bus)) |
331 | return -ENODEV; | 354 | return -ENODEV; |
@@ -349,6 +372,29 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size) | |||
349 | int ret = size; | 372 | int ret = size; |
350 | unsigned long paddr; | 373 | unsigned long paddr; |
351 | unsigned long *addr; | 374 | unsigned long *addr; |
375 | struct ia64_sal_retval isrv; | ||
376 | |||
377 | /* | ||
378 | * First, try the SN_SAL_IOIF_PCI_SAFE SAL call which can work | ||
379 | * around hw issues at the pci bus level. SGI proms older than | ||
380 | * 4.10 don't implment this. | ||
381 | */ | ||
382 | |||
383 | SAL_CALL(isrv, SN_SAL_IOIF_PCI_SAFE, | ||
384 | pci_domain_nr(bus), bus->number, | ||
385 | 0, /* io */ | ||
386 | 1, /* write */ | ||
387 | port, size, __pa(&val)); | ||
388 | |||
389 | if (isrv.status == 0) | ||
390 | return size; | ||
391 | |||
392 | /* | ||
393 | * If the above failed, retry using the SAL_PROBE call which should | ||
394 | * be present in all proms (but which cannot work round PCI chipset | ||
395 | * bugs). This code is retained for compatability with old | ||
396 | * pre-4.10 proms, and should be removed at some point in the future. | ||
397 | */ | ||
352 | 398 | ||
353 | if (!SN_PCIBUS_BUSSOFT(bus)) { | 399 | if (!SN_PCIBUS_BUSSOFT(bus)) { |
354 | ret = -ENODEV; | 400 | ret = -ENODEV; |