summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* powerpc: rename swiotlb_dma_opsChristoph Hellwig2018-01-154-5/+5
| | | | | | | | We'll need that name for a generic implementation soon. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* ia64: rename swiotlb_dma_opsChristoph Hellwig2018-01-153-8/+8
| | | | | | | | We'll need that name for a generic implementation soon. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* arm64: rename swiotlb_dma_opsChristoph Hellwig2018-01-151-2/+2
| | | | | | | | We'll need that name for a generic implementation soon. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
* swiotlb: suppress warning when __GFP_NOWARN is setChristian König2018-01-151-6/+9
| | | | | | | | | | | | | | | TTM tries to allocate coherent memory in chunks of 2MB first to improve TLB efficiency and falls back to allocating 4K pages if that fails. Suppress the warning when the 2MB allocations fails since there is a valid fall back path. Signed-off-by: Christian König <christian.koenig@amd.com> Reported-by: Mike Galbraith <efault@gmx.de> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104082 CC: stable@vger.kernel.org Signed-off-by: Christoph Hellwig <hch@lst.de>
* h8300: use dma-directChristoph Hellwig2018-01-155-79/+3
| | | | | | | Replace the bare-bones h8300 direct dma mapping implementation with the fully featured generic dma-direct one. Signed-off-by: Christoph Hellwig <hch@lst.de>
* cris: use dma-directChristoph Hellwig2018-01-155-98/+6
| | | | | | | | | cris currently has an incomplete direct mapping dma_map_ops implementation if PCI support is enabled. Replace it with the fully feature generic dma-direct implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
* dma-direct: reject too small dma masksChristoph Hellwig2018-01-152-0/+20
| | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
* dma-direct: make dma_direct_{alloc,free} available to other implementationsChristoph Hellwig2018-01-153-9/+11
| | | | | | | So that they don't need to indirect through the operation vector. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
* dma-direct: retry allocations using GFP_DMA for small masksChristoph Hellwig2018-01-151-1/+24
| | | | | | | | | | | If an attempt to allocate memory succeeded, but isn't inside the supported DMA mask, retry the allocation with GFP_DMA set as a last resort. Based on the x86 code, but an off by one error in what is now dma_coherent_ok has been fixed vs the x86 code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: add support for allocation from ZONE_DMA and ZONE_DMA32Christoph Hellwig2018-01-151-0/+14
| | | | | | | | | | | | This allows to dip into zones for lower memory if they are available. If one of the zones is not available the corresponding GFP_* flag will evaluate to 0 so they won't change anything. We provide an arch tunable for those architectures that do not use GFP_DMA for the lowest 24-bits, given that there are a few. Roughly based on the x86 code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: use node local allocations for coherent memoryChristoph Hellwig2018-01-151-1/+1
| | | | | | | To preserve the x86 behavior. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
* dma-direct: add support for CMA allocationChristoph Hellwig2018-01-151-6/+18
| | | | | | | | Try the CMA allocator for coherent allocations if supported. Roughly modelled after the x86 code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: add dma address sanity checksChristoph Hellwig2018-01-151-1/+30
| | | | | | Roughly based on the x86 pci-nommu implementation. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-direct: use phys_to_dmaChristoph Hellwig2018-01-151-11/+7
| | | | | | | | This means it uses whatever linear remapping scheme that the architecture provides is used in the generic dma_direct ops. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
* dma-direct: rename dma_noop to dma_directChristoph Hellwig2018-01-1512-34/+29
| | | | | | | | | | | The trivial direct mapping implementation already does a virtual to physical translation which isn't strictly a noop, and will soon learn to do non-direct but linear physical to dma translations through the device offset and a few small tricks. Rename it to a better fitting name. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
* dma-mapping: provide a generic asm/dma-mapping.hChristoph Hellwig2018-01-158-64/+14
| | | | | | | For architectures that just use the generic dma_noop_ops we can provide a generic version of dma-mapping.h. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-mapping: add an arch_dma_supported hookChristoph Hellwig2018-01-153-7/+26
| | | | | | | | | To implement the x86 forbid_dac and iommu_sac_force we want an arch hook so that it can apply the global options across all dma_map_ops implementations. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* dma-mapping: clear harmful GFP_* flags in common codeChristoph Hellwig2018-01-1512-31/+7
| | | | | | | | | Lift the code from x86 so that we behave consistently. In the future we should probably warn if any of these is set. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
* dma-mapping: warn when there is no coherent_dma_maskChristoph Hellwig2018-01-151-0/+1
| | | | | | | | | | These days all devices should have a DMA coherent mask, and most dma_ops implementations rely on that fact. But just to be sure add an assert to ring the warning bell if that is not the case. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* s390: move s390_pci_dma_ops to asm/pci_dma.hChristoph Hellwig2018-01-102-2/+3
| | | | | | This is not needed in drivers, so move it to a private header. Signed-off-by: Christoph Hellwig <hch@lst.de>
* microblaze: remove the dead !NOT_COHERENT_CACHE dma codeChristoph Hellwig2018-01-101-28/+0
| | | | Signed-off-by: Christoph Hellwig <hch@lst.de>
* microblaze: remove dma_nommu_dma_supportedChristoph Hellwig2018-01-102-13/+0
| | | | | | Always returning 1 is the same behavior as not supplying a method at all. Signed-off-by: Christoph Hellwig <hch@lst.de>
* microblaze: rename dma_direct to dma_nommuChristoph Hellwig2018-01-102-26/+26
| | | | | | This frees the dma_direct_* namespace for a generic implementation. Signed-off-by: Christoph Hellwig <hch@lst.de>
* powerpc: rename dma_direct_ to dma_nommu_Christoph Hellwig2018-01-1015-68/+68
| | | | | | | We want to use the dma_direct_ namespace for a generic implementation, so rename powerpc to the second best choice: dma_nommu_. Signed-off-by: Christoph Hellwig <hch@lst.de>
* hexagon: use the generic dma_capable helperChristoph Hellwig2018-01-102-7/+1
| | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Richard Kuo <rkuo@codeaurora.org>
* dma-mapping: move dma_mark_clean to dma-direct.hChristoph Hellwig2018-01-1010-18/+10
| | | | | | | | And unlike the other helpers we don't require a <asm/dma-direct.h> as this helper is a special case for ia64 only, and this keeps it as simple as possible. Signed-off-by: Christoph Hellwig <hch@lst.de>
* dma-mapping: move swiotlb arch helpers to a new headerChristoph Hellwig2018-01-1034-195/+165
| | | | | | | | | | | | | | | | phys_to_dma, dma_to_phys and dma_capable are helpers published by architecture code for use of swiotlb and xen-swiotlb only. Drivers are not supposed to use these directly, but use the DMA API instead. Move these to a new asm/dma-direct.h helper, included by a linux/dma-direct.h wrapper that provides the default linear mapping unless the architecture wants to override it. In the MIPS case the existing dma-coherent.h is reused for now as untangling it will take a bit of work. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Robin Murphy <robin.murphy@arm.com>
* mips: fix an off-by-one in dma_capableChristoph Hellwig2018-01-101-1/+1
| | | | | | | This makes it match the generic version. Reported-by: Vladimir Murzin <vladimir.murzin@arm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* arm64: don't override dma_max_pfnChristoph Hellwig2018-01-101-9/+0
| | | | | | | | The generic version now takes dma_pfn_offset into account, so there is no more need for an architecture override. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
* dma-mapping: take dma_pfn_offset into account in dma_max_pfnChristoph Hellwig2018-01-101-1/+1
| | | | | | | | This makes sure the generic version can be used with architectures / devices that have a DMA offset in the direct mapping. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
* s390: remove the unused dma_capable helperChristoph Hellwig2018-01-091-7/+0
| | | | Signed-off-by: Christoph Hellwig <hch@lst.de>
* riscv: remove the unused dma_capable helperChristoph Hellwig2018-01-091-8/+0
| | | | Signed-off-by: Christoph Hellwig <hch@lst.de>
* m32r: remove the unused dma_capable helperChristoph Hellwig2018-01-091-7/+0
| | | | Signed-off-by: Christoph Hellwig <hch@lst.de>
* arc: remove CONFIG_ARC_PLAT_NEEDS_PHYS_TO_DMAChristoph Hellwig2018-01-093-17/+7
| | | | | | | We always use the stub definitions, so remove the unused other code. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Vineet Gupta <vgupta@synopsys.com>
* powerpc: remove unused flush_write_buffers definitionChristoph Hellwig2018-01-091-3/+0
| | | | Signed-off-by: Christoph Hellwig <hch@lst.de>
* m32r: remove unused flush_write_buffers definitionChristoph Hellwig2018-01-091-2/+0
| | | | Signed-off-by: Christoph Hellwig <hch@lst.de>
* hexagon: remove unused flush_write_buffers definitionChristoph Hellwig2018-01-091-2/+0
| | | | Signed-off-by: Christoph Hellwig <hch@lst.de>
* alpha: mark jensen as brokenChristoph Hellwig2018-01-091-0/+1
| | | | | | | CONFIG_ALPHA_JENSEN has failed to compile since commit 6aca0503 ("alpha/dma: use common noop dma ops"), so mark it as broken. Signed-off-by: Christoph Hellwig <hch@lst.de>
* Linux 4.15-rc7v4.15-rc7Linus Torvalds2018-01-071-1/+1
|
* Merge branch 'parisc-4.15-3' of ↵Linus Torvalds2018-01-078-16/+71
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fixes from Helge Deller: - Many small fixes to show the real physical addresses of devices instead of hashed addresses. - One important fix to unbreak 32-bit SMP support: We forgot to 16-byte align the spinlocks in the assembler code. - Qemu support: The host will get a chance to sleep when the parisc guest is idle. We use the same mechanism as the power architecture by overlaying the "or %r10,%r10,%r10" instruction which is simply a nop on real hardware. * 'parisc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: qemu idle sleep support parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel parisc: Show unhashed EISA EEPROM address parisc: Show unhashed HPA of Dino chip parisc: Show initial kernel memory layout unhashed parisc: Show unhashed hardware inventory
| * parisc: qemu idle sleep supportHelge Deller2018-01-061-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | Add qemu idle sleep support when running under qemu with SeaBIOS PDC firmware. Like the power architecture we use the "or" assembler instructions, which translate to nops on real hardware, to indicate that qemu shall idle sleep. Signed-off-by: Helge Deller <deller@gmx.de> Cc: Richard Henderson <rth@twiddle.net> CC: stable@vger.kernel.org # v4.9+
| * parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernelHelge Deller2018-01-023-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qemu for PARISC reported on a 32bit SMP parisc kernel strange failures about "Not-handled unaligned insn 0x0e8011d6 and 0x0c2011c9." Those opcodes evaluate to the ldcw() assembly instruction which requires (on 32bit) an alignment of 16 bytes to ensure atomicity. As it turns out, qemu is correct and in our assembly code in entry.S and pacache.S we don't pay attention to the required alignment. This patch fixes the problem by aligning the lock offset in assembly code in the same manner as we do in our C-code. Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> # v4.0+
| * parisc: Show unhashed EISA EEPROM addressHelge Deller2018-01-021-1/+1
| | | | | | | | | | Fixes: ad67b74d2469d9b8 ("printk: hash addresses printed with %p") Signed-off-by: Helge Deller <deller@gmx.de>
| * parisc: Show unhashed HPA of Dino chipHelge Deller2018-01-021-5/+5
| | | | | | | | | | Fixes: ad67b74d2469d9b8 ("printk: hash addresses printed with %p") Signed-off-by: Helge Deller <deller@gmx.de>
| * parisc: Show initial kernel memory layout unhashedHelge Deller2018-01-021-5/+5
| | | | | | | | | | Fixes: ad67b74d2469d9b8 ("printk: hash addresses printed with %p") Signed-off-by: Helge Deller <deller@gmx.de>
| * parisc: Show unhashed hardware inventoryHelge Deller2018-01-021-1/+1
| | | | | | | | | | Fixes: ad67b74d2469d9b8 ("printk: hash addresses printed with %p") Signed-off-by: Helge Deller <deller@gmx.de>
* | Merge tag 'apparmor-pr-2018-01-07' of ↵Linus Torvalds2018-01-071-1/+11
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor Pull apparmor fix from John Johansen: "This fixes a regression when the kernel feature set is reported as supporting mount and policy is pinned to a feature set that does not support mount mediation" * tag 'apparmor-pr-2018-01-07' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: apparmor: fix regression in mount mediation when feature set is pinned
| * | apparmor: fix regression in mount mediation when feature set is pinnedJohn Johansen2018-01-051-1/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | When the mount code was refactored for Labels it was not correctly updated to check whether policy supported mediation of the mount class. This causes a regression when the kernel feature set is reported as supporting mount and policy is pinned to a feature set that does not support mount mediation. BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=882697#41 Fixes: 2ea3ffb7782a ("apparmor: add mount mediation") Reported-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John Johansen <john.johansen@canonical.com>
* | Merge tag 'led_fixes_for_4.15-rc7' of ↵Linus Torvalds2018-01-071-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds Pull LED fix from Jacek Anaszewski: "The commit 2b83ff96f51d for 4.15-rc6, which was fixing LED brightness setting after clearing delay_off broke the behavior on any alteration of delay_on{off} properties, due to use of a LED core helper that does too much for this particular case" * tag 'led_fixes_for_4.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: leds: core: Fix regression caused by commit 2b83ff96f51d
| * | leds: core: Fix regression caused by commit 2b83ff96f51dJacek Anaszewski2018-01-071-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2b83ff96f51d ("led: core: Fix brightness setting when setting delay_off=0") replaced del_timer_sync(&led_cdev->blink_timer) with led_stop_software_blink() in led_blink_set(), which additionally clears LED_BLINK_SW flag as well as zeroes blink_delay_on and blink_delay_off properties of the struct led_classdev. Cleansing of the latter ones wasn't required to fix the original issue but wasn't considered harmful. It nonetheless turned out to be so in case when pointer to one or both props is passed to led_blink_set() like in the ledtrig-timer.c. In such cases zeroes are passed later in delay_on and/or delay_off arguments to led_blink_setup(), which results either in stopping the software blinking or setting blinking frequency always to 1Hz. Avoid using led_stop_software_blink() and add a single call required to clear LED_BLINK_SW flag, which was the only needed modification to fix the original issue. Fixes 2b83ff96f51d ("led: core: Fix brightness setting when setting delay_off=0") Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>