[PATCH V3] powerpc: Add KVM guest defconfig

2018-11-14 Thread sathnaga
From: Satheesh Rajendran This patch adds new defconfig options for powerpc KVM guest and guest.config with additional config symbols enabled, which is to build kernel to boot without initramfs and can be used as place holder for guest specific additional config symbols in future. Signed-off-by:

[PATCH] powerpc: Add missing config symbols for ppc64_defconfig

2018-11-14 Thread sathnaga
From: Satheesh Rajendran This patch adds missing config symbols for ppc64_defconfig to enable cgroups, memhotplug, numa balancing and XFS in core kernel image. Signed-off-by: Satheesh Rajendran --- arch/powerpc/configs/ppc64_defconfig | 12 +++- 1 file changed, 11 insertions(+), 1 dele

[PATCH] powerpc/mm: dump block address translation on book3s/32

2018-11-14 Thread Christophe Leroy
This patch adds a debugfs file to dump block address translation: ~# cat /sys/kernel/debug/block_address_translation Instruction Block Address Translations: 0: - 1: - 2: 0xc000-0xcfff 0x Kernel EXEC coherent 3: 0xd000-0xdfff 0x1000 Kernel EXEC coherent 4

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-14 Thread Bjorn Helgaas
On Wed, Nov 14, 2018 at 07:22:04PM +, alex_gagn...@dellteam.com wrote: > On 11/14/2018 12:00 AM, Bjorn Helgaas wrote: > > On Tue, Nov 13, 2018 at 10:39:15PM +, alex_gagn...@dellteam.com wrote: > >> On 11/12/2018 11:02 PM, Bjorn Helgaas wrote: > >> ... > >>> Do you think Linux observes the r

Re: [PATCH kernel v3 02/22] powerpc/mm/iommu/vfio_spapr_tce: Change mm_iommu_get to reference a region

2018-11-14 Thread David Gibson
On Tue, Nov 13, 2018 at 07:28:03PM +1100, Alexey Kardashevskiy wrote: > Normally mm_iommu_get() is supposed to add a reference and > mm_iommu_put() to remove it. However historically mm_iommu_find() does > the referencing and mm_iommu_get() is doing allocation and referencing. > > We are going to

Re: [PATCH kernel] powerpc/powernv/ioda: Reduce a number of hooks in pnv_phb

2018-11-14 Thread Sam Bobroff
On Tue, Oct 16, 2018 at 01:34:09PM +1100, Alexey Kardashevskiy wrote: > fixup_phb() is never used, this removes it. > > pick_m64_pe() and reserve_m64_pe() are always defined for all powernv > PHBs: they are initialized by pnv_ioda_parse_m64_window() which is > called unconditionally from pnv_pci_i

Re: [RFC PATCH 13/14] powerpc/tm: Do not restore TM without SPRs

2018-11-14 Thread Michael Neuling
On Tue, 2018-11-06 at 10:40 -0200, Breno Leitao wrote: > Currently the signal context restore code enables the bit on the MSR > register without restoring the TM SPRs, which can cause undesired side > effects. > > This is not correct because if TM is enabled in MSR, it means the TM SPR > registers

Re: [PATCH kernel] powerpc/powernv/ioda1: Remove dead code for a single device PE

2018-11-14 Thread Sam Bobroff
On Thu, Nov 08, 2018 at 04:45:04PM +1100, Alexey Kardashevskiy wrote: > Ping? > > > On 16/10/2018 13:30, Alexey Kardashevskiy wrote: > > At the moment PNV_IODA_PE_DEV is only used for NPU PEs which are not > > present on IODA1 machines (i.e. POWER7) so let's remove a piece of > > dead code. > >

Re: [RFC PATCH 09/14] powerpc/tm: Warn if state is transactional

2018-11-14 Thread Michael Neuling
On Tue, 2018-11-06 at 10:40 -0200, Breno Leitao wrote: > Since every kernel entrance is calling TM_KERNEL_ENTRY, it is not > expected to arrive at this point with a suspended transaction. > > If that is the case, cause a warning and reclaim the current thread in > order to avoid a TM Bad Thing.

Re: [RFC PATCH 08/14] powerpc/tm: Recheckpoint at exit path

2018-11-14 Thread Michael Neuling
On Tue, 2018-11-06 at 10:40 -0200, Breno Leitao wrote: > In the past, TIF_RESTORE_TM was being handled with the rest of the TIF > workers, > but, that was too early, and can cause some IRQ to be replayed in suspended > state (after recheckpoint). > > This patch moves TIF_RESTORE_TM handler to as l

Re: It looks like that wild_bctr on powerpc/fixes is still not compiling

2018-11-14 Thread Gustavo Romero
Hi Michael, On 11/13/2018 10:58 PM, Michael Ellerman wrote: It looks like binutils 2.27 doesn't accept ULL but binutils 2.28 does. Ah yep, here: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=86b80085c889cd388fa677a5ae9053fd4be3776c The following trivial workaround c

[PATCH] powerpc/64: Fix kernel stack 16-byte alignment

2018-11-14 Thread Nicholas Piggin
Commit 4c2de74cc869 ("powerpc/64: Interrupts save PPR on stack rather than thread_struct") changed sizeof(struct pt_regs) % 16 from 0 to 8, which causes the interrupt frame allocation on kernel entry to put the kernel stack out of alignment. Add a pad field to fix alignment, and add a BUILD_BUG_ON

[PATCH v2] selftests/powerpc: Adjust wild_bctr to build with old gcc

2018-11-14 Thread Gustavo Romero
Currently the selftest wild_bctr can fail to build when an old gcc is used, notably on gcc using a binutils version <= 2.27, because the assembler does not support the integer suffix UL. This patch adjusts the wild_bctr test so the REG_POISON value is still treated as an unsigned long for the shif

Re: [RFC PATCH 05/14] powerpc/tm: Refactor the __switch_to_tm code

2018-11-14 Thread Michael Neuling
On Tue, 2018-11-06 at 10:40 -0200, Breno Leitao wrote: > __switch_to_tm is the function that switches between two tasks which might > have TM enabled. This function is clearly split in two parts, the task that > is leaving the CPU, known as 'prev' and the task that is being scheduled, > known as 'n

Re: [RFC PATCH 01/14] powerpc/tm: Reclaim transaction on kernel entry

2018-11-14 Thread Nicholas Piggin
On Tue, 6 Nov 2018 10:40:15 -0200 Breno Leitao wrote: > This patch creates a macro that will be invoked on all entrance to the > kernel, so, in kernel space the transaction will be completely reclaimed > and not suspended anymore. This doesn't get invoked on _all_ kernel entries, by the looks (

Re: [RFC PATCH 03/14] powerpc/tm: Recheckpoint when exiting from kernel

2018-11-14 Thread Michael Neuling
On Tue, 2018-11-06 at 10:40 -0200, Breno Leitao wrote: > This is the only place we are going to recheckpoint now. Now the task > needs to have TIF_RESTORE_TM flag set, which will get into > restore_tm_state() at exception exit path, and execute the recheckpoint > depending on the MSR. > > Every ti

Re: [RFC PATCH 01/14] powerpc/tm: Reclaim transaction on kernel entry

2018-11-14 Thread Michael Neuling
On Tue, 2018-11-06 at 10:40 -0200, Breno Leitao wrote: > This patch creates a macro that will be invoked on all entrance to the > kernel, so, in kernel space the transaction will be completely reclaimed > and not suspended anymore. > > This patchset checks if we are coming from PR, if not, skip.

Re: [RFC PATCH 02/14] powerpc/tm: Reclaim on unavailable exception

2018-11-14 Thread Michael Neuling
On Tue, 2018-11-06 at 10:40 -0200, Breno Leitao wrote: > If there is a FP/VEC/Altivec touch inside a transaction and the facility is > disabled, then a facility unavailable exception is raised and ends up > calling {fp,vec,vsx}_unavailable_tm, which was reclaiming and > recheckpointing. > > This i

[PATCH AUTOSEL 4.4 6/8] hwmon: (ibmpowernv) Remove bogus __init annotations

2018-11-14 Thread Sasha Levin
From: Geert Uytterhoeven [ Upstream commit e3e61f01d755188cb6c2dcf5a244b9c0937c258e ] If gcc decides not to inline make_sensor_label(): WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label(

[PATCH AUTOSEL 4.9 08/13] hwmon: (ibmpowernv) Remove bogus __init annotations

2018-11-14 Thread Sasha Levin
From: Geert Uytterhoeven [ Upstream commit e3e61f01d755188cb6c2dcf5a244b9c0937c258e ] If gcc decides not to inline make_sensor_label(): WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label(

[PATCH AUTOSEL 4.14 21/27] ibmvnic: fix accelerated VLAN handling

2018-11-14 Thread Sasha Levin
From: Michał Mirosław [ Upstream commit e84b47941e15eafb8ee8b21d1c3fc1a013af ] Don't request tag insertion when it isn't present in outgoing skb. Signed-off-by: Michał Mirosław Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 2 +- 1 fil

[PATCH AUTOSEL 4.14 12/27] hwmon: (ibmpowernv) Remove bogus __init annotations

2018-11-14 Thread Sasha Levin
From: Geert Uytterhoeven [ Upstream commit e3e61f01d755188cb6c2dcf5a244b9c0937c258e ] If gcc decides not to inline make_sensor_label(): WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label(

[PATCH AUTOSEL 4.18 46/59] ibmvnic: fix accelerated VLAN handling

2018-11-14 Thread Sasha Levin
From: Michał Mirosław [ Upstream commit e84b47941e15eafb8ee8b21d1c3fc1a013af ] Don't request tag insertion when it isn't present in outgoing skb. Signed-off-by: Michał Mirosław Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 2 +- 1 fil

[PATCH AUTOSEL 4.18 22/59] hwmon: (ibmpowernv) Remove bogus __init annotations

2018-11-14 Thread Sasha Levin
From: Geert Uytterhoeven [ Upstream commit e3e61f01d755188cb6c2dcf5a244b9c0937c258e ] If gcc decides not to inline make_sensor_label(): WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label(

Re: [PATCH v4 2/4] kgdb: Fix kgdb_roundup_cpus() for arches who used smp_call_function()

2018-11-14 Thread Will Deacon
On Mon, Nov 12, 2018 at 10:26:56AM -0800, Douglas Anderson wrote: > When I had lockdep turned on and dropped into kgdb I got a nice splat > on my system. Specifically it hit: > DEBUG_LOCKS_WARN_ON(current->hardirq_context) > > Specifically it looked like this: > sysrq: SysRq : DEBUG > -

Re: [PATCH v4 1/4] kgdb: Remove irq flags from roundup

2018-11-14 Thread Will Deacon
On Mon, Nov 12, 2018 at 10:26:55AM -0800, Douglas Anderson wrote: > The function kgdb_roundup_cpus() was passed a parameter that was > documented as: > > > the flags that will be used when restoring the interrupts. There is > > local_irq_save() call before kgdb_roundup_cpus(). > > Nobody used tho

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-14 Thread Keith Busch
On Wed, Nov 14, 2018 at 08:52:10PM +, alex_gagn...@dellteam.com wrote: > But it does in portdrv_core.c: > > if (dev->aer_cap && pci_aer_available() && > (pcie_ports_native || host->native_aer)) { > services |= PCIE_PORT_SERVICE_AER; > > That flag later creates a

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-14 Thread Alex_Gagniuc
On 11/14/2018 02:27 PM, Keith Busch wrote: > On Wed, Nov 14, 2018 at 07:22:04PM +, alex_gagn...@dellteam.com wrote: >> On 11/14/2018 12:00 AM, Bjorn Helgaas wrote: >>> Just to make sure we're on the same page, can you point me to this >>> rule? I do see that OSPM must request control of AER us

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-14 Thread Keith Busch
On Wed, Nov 14, 2018 at 07:22:04PM +, alex_gagn...@dellteam.com wrote: > On 11/14/2018 12:00 AM, Bjorn Helgaas wrote: > > Just to make sure we're on the same page, can you point me to this > > rule? I do see that OSPM must request control of AER using _OSC > > before it touches the AER registe

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-14 Thread Derrick, Jonathan
On Wed, 2018-11-14 at 19:22 +, alex_gagn...@dellteam.com wrote: [snip] > The whole issue of firmware-first, the mechanism by which > > > > firmware > > > > gets control, the System Error enables in Root Port Root > > > > Control > > > > registers, etc., is very murky to me. Jon has a sort of >

Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected

2018-11-14 Thread Alex_Gagniuc
On 11/14/2018 12:00 AM, Bjorn Helgaas wrote: > On Tue, Nov 13, 2018 at 10:39:15PM +, alex_gagn...@dellteam.com wrote: >> On 11/12/2018 11:02 PM, Bjorn Helgaas wrote: >>> >>> [EXTERNAL EMAIL] >>> Please report any suspicious attachments, links, or requests for sensitive >>> information. > > It

[PATCH] powerpc/numa: fix hot-added CPU on memory-less node

2018-11-14 Thread Laurent Vivier
Trying to hotplug a CPU on an empty NUMA node (without memory or CPU) crashes the kernel when the CPU is onlined. During the onlining process, the kernel calls start_secondary() that ends by calling set_numa_mem(local_memory_node(numa_cpu_lookup_table[cpu])) that relies on NODE_DATA(nid)->node_zon

Re: UBSAN: Undefined behaviour in kernel/rcu/tree_plugin.h in 4.20-rc1

2018-11-14 Thread Paul E. McKenney
On Wed, Nov 14, 2018 at 03:43:05PM +0100, Christophe LEROY wrote: > > > Le 09/11/2018 à 21:10, Paul E. McKenney a écrit : > >On Fri, Nov 09, 2018 at 06:11:20PM +0100, Christophe LEROY wrote: > >>(Resending due to error in Paul's address) > >> > >>Paul > >> > >>I get the following UBSAN reports in

Re: UBSAN: Undefined behaviour in kernel/rcu/tree_plugin.h in 4.20-rc1

2018-11-14 Thread Christophe LEROY
Le 09/11/2018 à 21:10, Paul E. McKenney a écrit : On Fri, Nov 09, 2018 at 06:11:20PM +0100, Christophe LEROY wrote: (Resending due to error in Paul's address) Paul I get the following UBSAN reports in 4.20-rc1 on an MPC8321E (powerpc/book3s/32) I bisected it to 3e31009898699dfc ("rcu: Defe

[PATCH] Powerpc/perf: Wire up PMI throttling

2018-11-14 Thread Ravi Bangoria
Commit 14c63f17b1fde ("perf: Drop sample rate when sampling is too slow") introduced a way to throttle PMU interrupts if we're spending too much time just processing those. Wire up powerpc PMI handler to use this infrastructure. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/traps.c | 4 ++

Re: [PATCH] powerpc/numa: Perform full re-add of CPU for PRRN/VPHN topology update

2018-11-14 Thread Michael Bringmann
On 11/13/2018 02:39 AM, Srikar Dronamraju wrote: >> -static void topology_work_fn(struct work_struct *work) >> -{ >> -rebuild_sched_domains(); >> +if (changed) >> +rebuild_sched_domains(); >> } >> static DECLARE_WORK(topology_work, topology_work_fn); >> >> @@ -1553,7 +1424,

[PATCH] selftests/powerpc: Adjust wild_bctr to build with old gcc

2018-11-14 Thread Gustavo Romero
Currently the selftest wild_bctr can fail to build when an old gcc is used, notably on gcc using a binutils version <= 2.27, because the assembler does not support the integer suffix UL. That patch adjusts the wild_bctr test so the type promotion to UL for the shifts on compilation still happens b

Re: linux-next: build warnings from Linus' tree

2018-11-14 Thread Michael Ellerman
Joel Stanley writes: > Hello Alan, > > On Tue, 12 Jun 2018 at 07:44, Stephen Rothwell wrote: > >> Building Linus' tree, today's linux-next build (powerpc ppc64_defconfig) >> produced these warning: >> >> ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in >> section `.gnu

[PATCH v2 4/4] powerpc: generate uapi header and system call table files

2018-11-14 Thread Firoz Khan
System call table generation script must be run to gener- ate unistd_32/64.h and syscall_table_32/64/c32/spu.h files. This patch will have changes which will invokes the script. This patch will generate unistd_32/64.h and syscall_table- _32/64/c32/spu.h files by the syscall table generation script

[PATCH v2 3/4] powerpc: add system call table generation support

2018-11-14 Thread Firoz Khan
The system call tables are in different format in all architecture and it will be difficult to manually add or modify the system calls in the respective files. To make it easy by keeping a script and which will generate the uapi header and syscall table file. This change will also help to unify the

[PATCH v2 2/4] powerpc: move macro definition from asm/systbl.h

2018-11-14 Thread Firoz Khan
Move the macro definition for compat_sys_sigsuspend from asm/systbl.h to the file which it is getting included. One of the patch in this patch series is generating uapi header and syscall table files. In order to come up with a common implimentation across all architecture, we need to do this chan

[PATCH v2 1/4] powerpc: add __NR_syscalls along with NR_syscalls

2018-11-14 Thread Firoz Khan
NR_syscalls macro holds the number of system call exist in powerpc architecture. We have to change the value of NR_syscalls, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file conta

[PATCH v2 0/4] powerpc: system call table generation support

2018-11-14 Thread Firoz Khan
The purpose of this patch series is, we can easily add/modify/delete system call table support by cha- nging entry in syscall.tbl file instead of manually changing many files. The other goal is to unify the system call table generation support implementation across all the architectures. The sy

[PATCH 03/34] powerpc/dma: remove the unused ARCH_HAS_DMA_MMAP_COHERENT define

2018-11-14 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 8fa394520af6..f2a4a7142b1e 100644 --- a/arch/po

[PATCH 01/34] powerpc: use mm zones more sensibly

2018-11-14 Thread Christoph Hellwig
Powerpc has somewhat odd usage where ZONE_DMA is used for all memory on common 64-bit configfs, and ZONE_DMA32 is used for 31-bit schemes. Move to a scheme closer to what other architectures use (and I dare to say the intent of the system): - ZONE_DMA: optionally for memory < 31-bit (64-bit embe

use generic DMA mapping code in powerpc V4

2018-11-14 Thread Christoph Hellwig
Hi all, this series switches the powerpc port to use the generic swiotlb and noncoherent dma ops, and to use more generic code for the coherent direct mapping, as well as removing a lot of dead code. As this series is very large and depends on the dma-mapping tree I've also published a git tree:

[PATCH 30/34] powerpc/dma: remove dma_nommu_mmap_coherent

2018-11-14 Thread Christoph Hellwig
The coherent cache version of this function already is functionally identicall to the default version, and by defining the arch_dma_coherent_to_pfn hook the same is ture for the noncoherent version as well. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 4 ar

[PATCH 32/34] powerpc/dma: remove get_dma_offset

2018-11-14 Thread Christoph Hellwig
Just fold the calculation into __phys_to_dma/__dma_to_phys as those are the only places that should know about it. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/dma-direct.h | 8 ++-- arch/powerpc/include/asm/dma-mapping.h | 16

[PATCH 29/34] powerpc/dma: use phys_to_dma instead of get_dma_offset

2018-11-14 Thread Christoph Hellwig
Use the standard portable helper instead of the powerpc specific one, which is about to go away. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/dma.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/dma

[PATCH 34/34] powerpc/dma: trim the fat from

2018-11-14 Thread Christoph Hellwig
There is no need to provide anything but get_arch_dma_ops to . More the remaining declarations to and drop all the includes. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h| 29 --- arch/powerpc/include/asm/iommu.h | 10 +++

[PATCH 28/34] dma-mapping, powerpc: simplify the arch dma_set_mask override

2018-11-14 Thread Christoph Hellwig
Instead of letting the architecture supply all of dma_set_mask just give it an additional hook selected by Kconfig. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/dma-mapping.h | 3 --- arch/powerpc/kernel/dma-swiotlb.c | 8 +++

[PATCH 33/34] powerpc/dma: remove set_dma_offset

2018-11-14 Thread Christoph Hellwig
There is no good reason for this helper, just opencode it. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h| 6 -- arch/powerpc/kernel/pci-common.c | 2 +- arch/powerpc/platforms/cell/iommu.c | 4 ++-- arch/powerpc/platforms/powernv/pci-ioda.c |

[PATCH 31/34] powerpc/dma: use generic direct and swiotlb ops

2018-11-14 Thread Christoph Hellwig
- The ppc32 case of dma_nommu_dma_supported already was a no-op, and the 64-bit case came to the same conclusion as dma_direct_supported, so replace it with the generic version. - supports CMA - Note that the cache maintainance in the existing code is a bit odd as it implements both t

[PATCH 23/34] powerpc/dma: remove get_pci_dma_ops

2018-11-14 Thread Christoph Hellwig
This function is only used by the Cell iommu code, which can keep track if it is using the iommu internally just as good. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci.h | 2 -- arch/powerpc/kernel/pci-common.c| 6 -- arch/powerpc/platforms/cell/iommu.c | 17 ++

[PATCH 27/34] powerpc/fsl_pci: simplify fsl_pci_dma_set_mask

2018-11-14 Thread Christoph Hellwig
swiotlb will only bounce buffer the effectice dma address for the device is smaller than the actual DMA range. Instead of flipping between the swiotlb and nommu ops for FSL SOCs that have the second outbound window just don't set the bus dma_mask in this case. Signed-off-by: Christoph Hellwig --

[PATCH 26/34] powerpc/dma: fix an off-by-one in dma_capable

2018-11-14 Thread Christoph Hellwig
We need to compare the last byte in the dma range and not the one after it for the bus_dma_mask, just like we do for the regular dma_mask. Fix this cleanly by merging the two comparisms into one. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-direct.h | 8 ++-- 1 file cha

[PATCH 21/34] powerpc/pci: remove the dma_set_mask pci_controller ops methods

2018-11-14 Thread Christoph Hellwig
Unused now. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci-bridge.h | 2 -- arch/powerpc/kernel/dma.c | 7 --- 2 files changed, 9 deletions(-) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index aace7033fa02..a5070

[PATCH 20/34] powerpc/dma: stop overriding dma_get_required_mask

2018-11-14 Thread Christoph Hellwig
The ppc_md and pci_controller_ops methods are unused now and can be removed. The dma_nommu implementation is generic to the generic one except for using max_pfn instead of calling into the memblock API, and all other dma_map_ops instances implement a method of their own. Signed-off-by: Christoph

[PATCH 25/34] powerpc/dma: remove max_direct_dma_addr

2018-11-14 Thread Christoph Hellwig
The max_direct_dma_addr duplicates the bus_dma_mask field in struct device. Use the generic field instead. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/device.h | 3 --- arch/powerpc/include/asm/dma-direct.h | 4 +--- arch/powerpc/kernel/dma-swiotlb.c | 20 ---

[PATCH 19/34] cxl: drop the dma_set_mask callback from vphb

2018-11-14 Thread Christoph Hellwig
The CXL code never even looks at the dma mask, so there is no good reason for this sanity check. Remove it because it gets in the way of the dma ops refactoring. Signed-off-by: Christoph Hellwig --- drivers/misc/cxl/vphb.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers

[PATCH 24/34] powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c

2018-11-14 Thread Christoph Hellwig
pci_dma_dev_setup_swiotlb is only used by the fsl_pci code, and closely related to it, so fsl_pci.c seems like a better place for it. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/swiotlb.h | 2 -- arch/powerpc/kernel/dma-swiotlb.c | 11 --- arch/powerpc/sysdev/fsl_pci.

[PATCH 18/34] powerpc/powernv: use the generic iommu bypass code

2018-11-14 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 95 ++- 1 file changed, 25 insertions(+), 70 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/pow

[PATCH 22/34] powerpc/dma: remove the iommu fallback for coherent allocations

2018-11-14 Thread Christoph Hellwig
All iommu capable platforms now always use the iommu code with the internal bypass, so there is not need for this magic anymore. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 4 --- arch/powerpc/kernel/dma.c | 68 ++- 2 files changed, 2 ins

[PATCH 16/34] powerpc/powernv: remove pnv_pci_ioda_pe_single_vendor

2018-11-14 Thread Christoph Hellwig
This function is completely bogus - the fact that two PCIe devices come from the same vendor has absolutely nothing to say about the DMA capabilities and characteristics. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 28 ++- 1 file changed,

[PATCH 15/34] powerpc/dart: use the generic iommu bypass code

2018-11-14 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/sysdev/dart_iommu.c | 45 +++- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysde

[PATCH 14/34] powerpc/dart: remove dead cleanup code in iommu_init_early_dart

2018-11-14 Thread Christoph Hellwig
If dart_init failed we didn't have a chance to setup dma or controller ops yet, so there is no point in resetting them. Signed-off-by: Christoph Hellwig --- arch/powerpc/sysdev/dart_iommu.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/powerpc/sysdev/dart_i

[PATCH 17/34] powerpc/powernv: remove pnv_npu_dma_set_mask

2018-11-14 Thread Christoph Hellwig
These devices are not PCIe devices and do not have associated dma map ops, so this is just dead code. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/power

[PATCH 13/34] powerpc/cell: use the generic iommu bypass code

2018-11-14 Thread Christoph Hellwig
This gets rid of a lot of clumsy code and finally allows us to mark dma_iommu_ops const. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 2 +- arch/powerpc/include/asm/iommu.h | 6 ++ arch/powerpc/kernel/dma-iommu.c| 7 +- arch/powerpc/platforms/

[PATCH 12/34] powerpc/cell: move dma direct window setup out of dma_configure

2018-11-14 Thread Christoph Hellwig
Configure the dma settings at device setup time, and stop playing games with get_pci_dma_ops. This prepares for using the common dma_configure code later on. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/cell/iommu.c | 20 +++- 1 file changed, 11 insertions(+), 9 d

[PATCH 11/34] powerpc/pseries: use the generic iommu bypass code

2018-11-14 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/iommu.c | 100 +++-- 1 file changed, 27 insertions(+), 73 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerp

[PATCH 05/34] powerpc/dma: remove the unused dma_iommu_ops export

2018-11-14 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma-iommu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index f9fe2080ceb9..2ca6cfaebf65 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-i

[PATCH 08/34] powerpc/dma: untangle vio_dma_mapping_ops from dma_iommu_ops

2018-11-14 Thread Christoph Hellwig
vio_dma_mapping_ops currently does a lot of indirect calls through dma_iommu_ops, which not only make the code harder to follow but are also expensive in the post-spectre world. Unwind the indirect calls by calling the ppc_iommu_* or iommu_* APIs directly applicable, or just use the dma_iommu_* me

[PATCH 02/34] powerpc: allow NOT_COHERENT_CACHE for amigaone

2018-11-14 Thread Christoph Hellwig
AMIGAONE select NOT_COHERENT_CACHE, so we better allow it. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/Kconfig.cputype | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index f4e2

[PATCH 06/34] powerpc/dma: split the two __dma_alloc_coherent implementations

2018-11-14 Thread Christoph Hellwig
The implemementation for the CONFIG_NOT_COHERENT_CACHE case doesn't share any code with the one for systems with coherent caches. Split it off and merge it with the helpers in dma-noncoherent.c that have no other callers. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- ar

[PATCH 10/34] powerpc/pseries: unwind dma_get_required_mask_pSeriesLP a bit

2018-11-14 Thread Christoph Hellwig
Call dma_get_required_mask_pSeriesLP directly instead of dma_iommu_ops to simply the code a bit. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/

[PATCH 09/34] powerpc/dma: handle iommu bypass in dma_iommu_ops

2018-11-14 Thread Christoph Hellwig
Add a new iommu_bypass flag to struct dev_archdata so that the dma_iommu implementation can handle the direct mapping transparently instead of switiching ops around. Setting of this flag is controlled by new pci_controller_ops method. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/as

[PATCH 04/34] powerpc/dma: remove the unused ISA_DMA_THRESHOLD export

2018-11-14 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 81909600013a..07f7e6aaf104 100644 --- a/arch/powerpc/kernel/setup_32.c +++

[PATCH 07/34] powerpc/dma: remove the no-op dma_nommu_unmap_{page, sg} routines

2018-11-14 Thread Christoph Hellwig
These methods are optional, no need to implement no-op versions. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/dma.c | 16 1 file changed, 16 deletions(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index d6deb