diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 16:16:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 16:16:16 -0500 |
commit | cbd88cd4c07f9361914ab7fd7e21c9227986fe68 (patch) | |
tree | 8bc448d73f93f10ebd34ef38c911b06359000ed0 /arch/s390/pci | |
parent | 928b3f12e5fea9d201bbc029d8d537ba7cc14fe7 (diff) | |
parent | c2ab7282f0fcd11eea4d0ba45d1c65d89428c314 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky:
"Among the traditional bug fixes and cleanups are some improvements:
- A tool to generated the facility lists, generating the bit fields
by hand has been a source of bugs in the past
- The spinlock loop is reordered to avoid bursts of hypervisor calls
- Add support for the open-for-business interface to the service
element
- The get_cpu call is added to the vdso
- A set of tracepoints is defined for the common I/O layer
- The deprecated sclp_cpi module is removed
- Update default configuration"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (56 commits)
s390/sclp: fix possible control register corruption
s390: fix normalization bug in exception table sorting
s390/configs: update default configurations
s390/vdso: optimize getcpu system call
s390: drop smp_mb in vdso_init
s390: rename struct _lowcore to struct lowcore
s390/mem_detect: use unsigned longs
s390/ptrace: get rid of long longs in psw_bits
s390/sysinfo: add missing SYSIB 1.2.2 multithreading fields
s390: get rid of CONFIG_SCHED_MC and CONFIG_SCHED_BOOK
s390/Kconfig: remove pointless 64 bit dependencies
s390/dasd: fix failfast for disconnected devices
s390/con3270: testing return kzalloc retval
s390/hmcdrv: constify hmcdrv_ftp_ops structs
s390/cio: add NULL test
s390/cio: Change I/O instructions from inline to normal functions
s390/cio: Introduce common I/O layer tracepoints
s390/cio: Consolidate inline assemblies and related data definitions
s390/cio: Fix incorrect xsch opcode specification
s390/cio: Remove unused inline assemblies
...
Diffstat (limited to 'arch/s390/pci')
-rw-r--r-- | arch/s390/pci/pci.c | 3 | ||||
-rw-r--r-- | arch/s390/pci/pci_dma.c | 19 |
2 files changed, 15 insertions, 7 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 7ef12a3ace3a..11d4f277e9f6 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c | |||
@@ -701,8 +701,7 @@ static int zpci_restore(struct device *dev) | |||
701 | goto out; | 701 | goto out; |
702 | 702 | ||
703 | zpci_map_resources(pdev); | 703 | zpci_map_resources(pdev); |
704 | zpci_register_ioat(zdev, 0, zdev->start_dma + PAGE_OFFSET, | 704 | zpci_register_ioat(zdev, 0, zdev->start_dma, zdev->end_dma, |
705 | zdev->start_dma + zdev->iommu_size - 1, | ||
706 | (u64) zdev->dma_table); | 705 | (u64) zdev->dma_table); |
707 | 706 | ||
708 | out: | 707 | out: |
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index 32da0a6ecec2..4638b93c7632 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c | |||
@@ -457,7 +457,19 @@ int zpci_dma_init_device(struct zpci_dev *zdev) | |||
457 | goto out_clean; | 457 | goto out_clean; |
458 | } | 458 | } |
459 | 459 | ||
460 | zdev->iommu_size = (unsigned long) high_memory - PAGE_OFFSET; | 460 | /* |
461 | * Restrict the iommu bitmap size to the minimum of the following: | ||
462 | * - main memory size | ||
463 | * - 3-level pagetable address limit minus start_dma offset | ||
464 | * - DMA address range allowed by the hardware (clp query pci fn) | ||
465 | * | ||
466 | * Also set zdev->end_dma to the actual end address of the usable | ||
467 | * range, instead of the theoretical maximum as reported by hardware. | ||
468 | */ | ||
469 | zdev->iommu_size = min3((u64) high_memory, | ||
470 | ZPCI_TABLE_SIZE_RT - zdev->start_dma, | ||
471 | zdev->end_dma - zdev->start_dma + 1); | ||
472 | zdev->end_dma = zdev->start_dma + zdev->iommu_size - 1; | ||
461 | zdev->iommu_pages = zdev->iommu_size >> PAGE_SHIFT; | 473 | zdev->iommu_pages = zdev->iommu_size >> PAGE_SHIFT; |
462 | zdev->iommu_bitmap = vzalloc(zdev->iommu_pages / 8); | 474 | zdev->iommu_bitmap = vzalloc(zdev->iommu_pages / 8); |
463 | if (!zdev->iommu_bitmap) { | 475 | if (!zdev->iommu_bitmap) { |
@@ -465,10 +477,7 @@ int zpci_dma_init_device(struct zpci_dev *zdev) | |||
465 | goto out_reg; | 477 | goto out_reg; |
466 | } | 478 | } |
467 | 479 | ||
468 | rc = zpci_register_ioat(zdev, | 480 | rc = zpci_register_ioat(zdev, 0, zdev->start_dma, zdev->end_dma, |
469 | 0, | ||
470 | zdev->start_dma + PAGE_OFFSET, | ||
471 | zdev->start_dma + zdev->iommu_size - 1, | ||
472 | (u64) zdev->dma_table); | 481 | (u64) zdev->dma_table); |
473 | if (rc) | 482 | if (rc) |
474 | goto out_reg; | 483 | goto out_reg; |