[RFC PATCH V2 4/4] powerpc/mm/iommu: Allow migration of cma allocated pages during mm_iommu_get

2018-09-05 Thread Aneesh Kumar K.V
Current code doesn't do page migration if the page allocated is a compound page. With HugeTLB migration support, we can end up allocating hugetlb pages from CMA region. Also THP pages can be allocated from CMA region. This patch updates the code to handle compound pages correctly. This use the

[RFC PATCH V2 3/4] powerpc/mm/iommu: Allow large IOMMU page size only for hugetlb backing

2018-09-05 Thread Aneesh Kumar K.V
THP pages can get split during different code paths. An incremented reference count do imply we will not split the compound page. But the pmd entry can be converted to level 4 pte entries. Keep the code simpler by allowing large IOMMU page size only if the guest ram is backed by hugetlb pages.

[RFC PATCH V2 2/4] mm: Add get_user_pages_cma_migrate

2018-09-05 Thread Aneesh Kumar K.V
This helper does a get_user_pages_fast and if it find pages in the CMA area it will try to migrate them before taking page reference. This makes sure that we don't keep non-movable pages (due to page reference count) in the CMA area. Not able to move pages out of CMA area result in CMA allocation

[RFC PATCH V2 1/4] mm: Export alloc_migrate_huge_page

2018-09-05 Thread Aneesh Kumar K.V
We want to use this to support customized huge page migration. Signed-off-by: Aneesh Kumar K.V --- include/linux/hugetlb.h | 2 ++ mm/hugetlb.c| 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index

Re: [RFC PATCH 00/29] mm: remove bootmem allocator

2018-09-05 Thread Greentime Hu
Mike Rapoport 於 2018年9月6日 週四 上午12:04寫道: > > Hi, > > These patches switch early memory managment to use memblock directly > without any bootmem compatibility wrappers. As the result both bootmem and > nobootmem are removed. > > There are still a couple of things to sort out, the most important is

Re: [PATCH 3/3] mm: optimise pte dirty/accessed bit setting by demand based pte insertion

2018-09-05 Thread Guenter Roeck
On 09/05/2018 03:18 PM, Nicholas Piggin wrote: On Wed, 5 Sep 2018 07:29:51 -0700 Guenter Roeck wrote: Hi, On Tue, Aug 28, 2018 at 09:20:34PM +1000, Nicholas Piggin wrote: Similarly to the previous patch, this tries to optimise dirty/accessed bits in ptes to avoid access costs of hardware

[PATCH v2 7/9] powerpc: enable building all dtbs

2018-09-05 Thread Rob Herring
Enable the 'dtbs' target for powerpc. This allows building all the dts files in arch/powerpc/boot/dts/ when COMPILE_TEST and OF_ALL_DTBS are enabled. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- Please ack

[PATCH v2 6/9] kbuild: consolidate Devicetree dtb build rules

2018-09-05 Thread Rob Herring
There is nothing arch specific about building dtb files other than their location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. The dependencies and supported targets are all slightly different. Also, a cross-compiler for each arch is needed, but really the host compiler

[PATCH v2 1/9] powerpc: build .dtb files in dts directory

2018-09-05 Thread Rob Herring
Align powerpc with other architectures which build the dtb files in the same directory as the dts files. This is also in line with most other build targets which are located in the same directory as the source. This move will help enable the 'dtbs' target which builds all the dtbs regardless of

[PATCH v2 0/9] Devicetree build consolidation

2018-09-05 Thread Rob Herring
This series addresses a couple of issues I have with building dts files. First, the ability to build all the dts files in the tree. This has been supported on most arches for some time with powerpc being the main exception. The reason powerpc wasn't supported was it needed a change in the

Re: [PATCH 3/3] mm: optimise pte dirty/accessed bit setting by demand based pte insertion

2018-09-05 Thread Nicholas Piggin
On Wed, 5 Sep 2018 07:29:51 -0700 Guenter Roeck wrote: > Hi, > > On Tue, Aug 28, 2018 at 09:20:34PM +1000, Nicholas Piggin wrote: > > Similarly to the previous patch, this tries to optimise dirty/accessed > > bits in ptes to avoid access costs of hardware setting them. > > > > This patch

[PATCH 13/21] powerpc: 8xx: get cpu node with of_get_cpu_node

2018-09-05 Thread Rob Herring
"device_type" use is deprecated for FDT though it has continued to be used for nodes like cpu nodes. Use of_get_cpu_node() instead which works using node names by default. This will allow the eventually removal of cpu device_type properties. Also, fix a leaked reference and add a missing

[PATCH 12/21] powerpc: 4xx: get cpu node with of_get_cpu_node

2018-09-05 Thread Rob Herring
"device_type" use is deprecated for FDT though it has continued to be used for nodes like cpu nodes. Use of_get_cpu_node() instead which works using node names by default. This will allow the eventually removal of cpu device_type properties. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc:

[PATCH 11/21] powerpc: use for_each_of_cpu_node iterator

2018-09-05 Thread Rob Herring
Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This has the side effect of defaulting to iterating using "cpu" node names in preference to the deprecated (for FDT) device_type == "cpu". Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc:

[PATCH 00/21] DT cpu node iterator

2018-09-05 Thread Rob Herring
This series adds an iterator for cpu nodes and converts users over to use it or of_get_cpu_node in some cases. This allows us to remove the dependency on device_type property for cpu nodes though removing that from DTS files will have to wait for some time. In some cases, this makes the DT search

Re: [PATCH 0/3] tty: hvc: latency break regression fixes

2018-09-05 Thread Jason Gunthorpe
On Wed, Sep 05, 2018 at 10:14:36PM +1000, Nicholas Piggin wrote: > Hi Greg, > > Here are fixes for a few regressions that came in with my > carelessness with the irq latency work for the hvc subsystem. > These were independently reported in 2 configurations, and I > confirmed with another. > > I

Re: FSL/NXP P5020: USB problems with the latest Git kernels

2018-09-05 Thread Scott Wood
On Wed, 2018-09-05 at 14:08 +, Laurentiu Tudor wrote: > Hi Scott, > > > -Original Message- > > On Mon, 2018-08-27 at 20:15 +0200, Christian Zigotzky wrote: > > > Hello, > > > > > > Our users tested the RC1 of kernel 4.19 on their P5020 boards today. > > > Unfortunately the USB bug

Re: [RFC PATCH 07/29] memblock: remove _virt from APIs returning virtual address

2018-09-05 Thread Mike Rapoport
On Wed, Sep 05, 2018 at 12:04:36PM -0500, Rob Herring wrote: > On Wed, Sep 5, 2018 at 11:00 AM Mike Rapoport wrote: > > > > The conversion is done using > > > > sed -i 's@memblock_virt_alloc@memblock_alloc@g' \ > > $(git grep -l memblock_virt_alloc) > > What's the reason to do this? It

Re: [RFC PATCH 07/29] memblock: remove _virt from APIs returning virtual address

2018-09-05 Thread Rob Herring
On Wed, Sep 5, 2018 at 11:00 AM Mike Rapoport wrote: > > The conversion is done using > > sed -i 's@memblock_virt_alloc@memblock_alloc@g' \ > $(git grep -l memblock_virt_alloc) What's the reason to do this? It seems like a lot of churn even if a mechanical change. Rob

[RFC PATCH 08/29] memblock: replace alloc_bootmem_align with memblock_alloc

2018-09-05 Thread Mike Rapoport
The functions are equivalent, just the later does not require nobootmem translation layer. Signed-off-by: Mike Rapoport --- arch/x86/xen/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 159a897..68c0f14 100644 ---

[RFC PATCH 10/29] memblock: replace __alloc_bootmem_node_nopanic with memblock_alloc_try_nid_nopanic

2018-09-05 Thread Mike Rapoport
The __alloc_bootmem_node_nopanic() is used only once, there is no reason to add a wrapper for memblock_alloc_try_nid_nopanic for it. Signed-off-by: Mike Rapoport --- arch/x86/kernel/setup_percpu.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[RFC PATCH 19/29] memblock: replace alloc_bootmem_pages with memblock_alloc

2018-09-05 Thread Mike Rapoport
The conversion is done using the following semantic patch: @@ expression e; @@ - alloc_bootmem_pages(e) + memblock_alloc(e, PAGE_SIZE) Signed-off-by: Mike Rapoport --- arch/c6x/mm/init.c | 3 ++- arch/h8300/mm/init.c | 2 +- arch/m68k/mm/init.c| 2 +-

[RFC PATCH 29/29] mm: remove include/linux/bootmem.h

2018-09-05 Thread Mike Rapoport
Move remaining definitions and declarations from include/linux/bootmem.h into include/linux/memblock.h and remove the redundant header. Signed-off-by: Mike Rapoport --- arch/alpha/kernel/core_cia.c| 2 +- arch/alpha/kernel/core_irongate.c | 1 -

[RFC PATCH 21/29] memblock: replace alloc_bootmem with memblock_alloc

2018-09-05 Thread Mike Rapoport
The conversion is done using the following semantic patch: @@ expression e; @@ - __alloc_bootmem(e) + memblock_alloc_from(e, 0) Signed-off-by: Mike Rapoport --- arch/alpha/kernel/core_marvel.c | 4 ++-- arch/alpha/kernel/pci-noop.c| 4 ++-- arch/alpha/kernel/pci.c | 4

[RFC PATCH 28/29] memblock: replace BOOTMEM_ALLOC_* with MEMBLOCK variants

2018-09-05 Thread Mike Rapoport
Drop BOOTMEM_ALLOC_ACCESSIBLE and BOOTMEM_ALLOC_ANYWHERE in favor of identical MEMBLOCK definitions. Signed-off-by: Mike Rapoport --- arch/ia64/mm/discontig.c | 2 +- arch/powerpc/kernel/setup_64.c | 2 +- arch/sparc/kernel/smp_64.c | 2 +- arch/x86/kernel/setup_percpu.c | 2 +-

[RFC PATCH 27/29] mm: remove nobootmem

2018-09-05 Thread Mike Rapoport
Move a few remaining functions from nobootmem.c to memblock.c and remove nobootmem Signed-off-by: Mike Rapoport --- mm/Makefile| 1 - mm/memblock.c | 104 ++ mm/nobootmem.c | 128 - 3

[RFC PATCH 26/29] memblock: rename __free_pages_bootmem to memblock_free_pages

2018-09-05 Thread Mike Rapoport
The conversion is done using sed -i 's@__free_pages_bootmem@memblock_free_pages@' \ $(git grep -l __free_pages_bootmem) Signed-off-by: Mike Rapoport --- mm/internal.h | 2 +- mm/memblock.c | 2 +- mm/nobootmem.c | 2 +- mm/page_alloc.c | 2 +- 4 files changed, 4 insertions(+), 4

[RFC PATCH 25/29] memblock: rename free_all_bootmem to memblock_free_all

2018-09-05 Thread Mike Rapoport
The conversion is done using sed -i 's@free_all_bootmem@memblock_free_all@' \ $(git grep -l free_all_bootmem) Signed-off-by: Mike Rapoport --- arch/alpha/mm/init.c | 2 +- arch/arc/mm/init.c | 2 +- arch/arm/mm/init.c | 2 +-

[RFC PATCH 24/29] memblock: replace free_bootmem_late with memblock_free_late

2018-09-05 Thread Mike Rapoport
The free_bootmem_late and memblock_free_late do exactly the same thing: they iterate over a range and give pages to the page allocator. Replace calls to free_bootmem_late with calls to memblock_free_late and remove the bootmem variant. Signed-off-by: Mike Rapoport --- arch/sparc/kernel/mdesc.c

[RFC PATCH 23/29] memblock: replace free_bootmem{_node} with memblock_free

2018-09-05 Thread Mike Rapoport
The free_bootmem and free_bootmem_node are merely wrappers for memblock_free. Replace their usage with a call to memblock_free using the following semantic patch: @@ expression e1, e2, e3; @@ ( - free_bootmem(e1, e2) + memblock_free(e1, e2) | - free_bootmem_node(e1, e2, e3) + memblock_free(e2,

[RFC PATCH 22/29] mm: nobootmem: remove bootmem allocation APIs

2018-09-05 Thread Mike Rapoport
The bootmem compatibility APIs are not used and can be removed. Signed-off-by: Mike Rapoport --- include/linux/bootmem.h | 47 -- mm/nobootmem.c | 224 2 files changed, 271 deletions(-) diff --git a/include/linux/bootmem.h

[RFC PATCH 20/29] memblock: replace __alloc_bootmem with memblock_alloc_from

2018-09-05 Thread Mike Rapoport
The conversion is done using the following semantic patch: @@ expression e1, e2, e3; @@ - __alloc_bootmem(e1, e2, e3) + memblock_alloc(e1, e2, e3) Signed-off-by: Mike Rapoport --- arch/alpha/kernel/core_cia.c | 2 +- arch/alpha/kernel/pci_iommu.c | 4 ++-- arch/alpha/kernel/setup.c | 2

[RFC PATCH 18/29] memblock: replace alloc_bootmem_low_pages with memblock_alloc_low

2018-09-05 Thread Mike Rapoport
The conversion is done using the following semantic patch: @@ expression e; @@ - alloc_bootmem_low_pages(e) + memblock_alloc_low(e, PAGE_SIZE) Signed-off-by: Mike Rapoport --- arch/arc/mm/highmem.c| 2 +- arch/m68k/atari/stram.c | 3 ++- arch/m68k/mm/motorola.c

[RFC PATCH 17/29] memblock: replace alloc_bootmem_node with memblock_alloc_node

2018-09-05 Thread Mike Rapoport
Signed-off-by: Mike Rapoport --- arch/alpha/kernel/pci_iommu.c | 4 ++-- arch/ia64/sn/kernel/io_common.c | 7 ++- arch/ia64/sn/kernel/setup.c | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index

[RFC PATCH 15/29] memblock: replace alloc_bootmem_pages_node with memblock_alloc_node

2018-09-05 Thread Mike Rapoport
Signed-off-by: Mike Rapoport --- arch/ia64/mm/init.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 3b85c3e..ffcc358 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -447,19 +447,19 @@ int __init

[RFC PATCH 16/29] memblock: replace __alloc_bootmem_node with appropriate memblock_ API

2018-09-05 Thread Mike Rapoport
Use memblock_alloc_try_nid whenever goal (i.e. mininal address is specified) and memblock_alloc_node otherwise. Signed-off-by: Mike Rapoport --- arch/ia64/mm/discontig.c | 6 -- arch/ia64/mm/init.c| 2 +- arch/powerpc/kernel/setup_64.c | 6 --

[RFC PATCH 12/29] memblock: replace alloc_bootmem_low with memblock_alloc_low

2018-09-05 Thread Mike Rapoport
The alloc_bootmem_low(size) allocates low memory with default alignement and can be replcaed by memblock_alloc_low(size, 0) Signed-off-by: Mike Rapoport --- arch/arm64/kernel/setup.c | 2 +- arch/unicore32/kernel/setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[RFC PATCH 14/29] memblock: add align parameter to memblock_alloc_node()

2018-09-05 Thread Mike Rapoport
With the align parameter memblock_alloc_node() can be used as drop in replacement for alloc_bootmem_pages_node(). Signed-off-by: Mike Rapoport --- include/linux/bootmem.h | 4 ++-- mm/sparse.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git

[RFC PATCH 13/29] memblock: replace __alloc_bootmem_nopanic with memblock_alloc_from_nopanic

2018-09-05 Thread Mike Rapoport
Signed-off-by: Mike Rapoport --- arch/arc/kernel/unwind.c | 4 ++-- arch/x86/kernel/setup_percpu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index 183391d..2a01dd1 100644 --- a/arch/arc/kernel/unwind.c +++

[RFC PATCH 09/29] memblock: replace alloc_bootmem_low with memblock_alloc_low

2018-09-05 Thread Mike Rapoport
The functions are equivalent, just the later does not require nobootmem translation layer. Signed-off-by: Mike Rapoport --- arch/x86/kernel/tce_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/tce_64.c b/arch/x86/kernel/tce_64.c index f386bad..54c9b5a

[RFC PATCH 11/29] memblock: replace alloc_bootmem_pages_nopanic with memblock_alloc_nopanic

2018-09-05 Thread Mike Rapoport
The alloc_bootmem_pages_nopanic(size) is a shortcut for __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) and can be replaced by memblock_alloc_nopanic(size, PAGE_SIZE) Signed-off-by: Mike Rapoport --- drivers/usb/early/xhci-dbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[RFC PATCH 07/29] memblock: remove _virt from APIs returning virtual address

2018-09-05 Thread Mike Rapoport
The conversion is done using sed -i 's@memblock_virt_alloc@memblock_alloc@g' \ $(git grep -l memblock_virt_alloc) Signed-off-by: Mike Rapoport --- arch/arm/kernel/setup.c | 4 ++-- arch/arm/mach-omap2/omap_hwmod.c | 2 +- arch/arm64/mm/kasan_init.c

[RFC PATCH 05/29] mm: nobootmem: remove dead code

2018-09-05 Thread Mike Rapoport
Several bootmem functions and macros are not used. Remove them. Signed-off-by: Mike Rapoport --- include/linux/bootmem.h | 26 -- mm/nobootmem.c | 35 --- 2 files changed, 61 deletions(-) diff --git a/include/linux/bootmem.h

[RFC PATCH 06/29] memblock: rename memblock_alloc{_nid, _try_nid} to memblock_phys_alloc*

2018-09-05 Thread Mike Rapoport
This will allow using memblock_alloc for memblock allocations returning virtual address. The conversion is done using the following semantic patch: @@ expression e1, e2, e3; @@ ( - memblock_alloc(e1, e2) + memblock_phys_alloc(e1, e2) | - memblock_alloc_nid(e1, e2, e3) +

[RFC PATCH 03/29] mm: remove CONFIG_HAVE_MEMBLOCK

2018-09-05 Thread Mike Rapoport
All architecures use memblock for early memory management. There is no need for the CONFIG_HAVE_MEMBLOCK configuration option. Signed-off-by: Mike Rapoport --- arch/alpha/Kconfig | 1 - arch/arc/Kconfig| 1 - arch/arm/Kconfig| 1 -

[RFC PATCH 04/29] mm: remove bootmem allocator implementation.

2018-09-05 Thread Mike Rapoport
All architectures have been converted to use MEMBLOCK + NO_BOOTMEM. The bootmem allocator implementation can be removed. Signed-off-by: Mike Rapoport --- include/linux/bootmem.h | 16 - mm/bootmem.c| 811 2 files changed, 827

[RFC PATCH 02/29] mm: remove CONFIG_NO_BOOTMEM

2018-09-05 Thread Mike Rapoport
All achitectures select NO_BOOTMEM which essentially becomes 'Y' for any kernel configuration and therefore it can be removed. Signed-off-by: Mike Rapoport --- arch/alpha/Kconfig | 1 - arch/arc/Kconfig| 1 - arch/arm/Kconfig| 1 - arch/arm64/Kconfig | 1 -

[RFC PATCH 00/29] mm: remove bootmem allocator

2018-09-05 Thread Mike Rapoport
Hi, These patches switch early memory managment to use memblock directly without any bootmem compatibility wrappers. As the result both bootmem and nobootmem are removed. There are still a couple of things to sort out, the most important is the removal of bootmem usage in MIPS. Still, IMHO,

[RFC PATCH 01/29] mips: switch to NO_BOOTMEM

2018-09-05 Thread Mike Rapoport
MIPS already has memblock support and all the memory is already registered with it. This patch replaces bootmem memory reservations with memblock ones and removes the bootmem initialization. Signed-off-by: Mike Rapoport --- arch/mips/Kconfig | 1 +

[PATCH 5/5] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-05 Thread Sergey Miroshnichenko
Reading an empty slot returns all ones, which triggers a false EEH error event on PowerNV. New callbacks pcibios_rescan_prepare/done are introduced to pause/resume the EEH during rescan. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/include/asm/eeh.h | 2 ++

[PATCH 0/5] powerpc/pci/hotplug: Discover surprise-hotplugged PCIe devices during rescan

2018-09-05 Thread Sergey Miroshnichenko
This patchset allows hotplugged PCIe devices to be enumerated during a bus rescan being issued via sysfs, when the "Presence Detect Changed" interrupt is not available. As a first part of our work on adding support for hotplugging PCIe bridges full of devices without special requirement such as

[PATCH 4/5] powerpc/powernv/pci: Enable reassigning the bus numbers

2018-09-05 Thread Sergey Miroshnichenko
PowerNV doesn't depend on PCIe topology info from DT anymore, and now it is able to enumerate the fabric and assign the bus numbers. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 3/5] powerpc/pci: Use DT to create pci_dn for root bridges only

2018-09-05 Thread Sergey Miroshnichenko
Endpoint's pci_dn can be created dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 5ce752874827..1b9f563d9461 100644 ---

[PATCH 2/5] powerpc/pci: Create pci_dn on demand

2018-09-05 Thread Sergey Miroshnichenko
The pci_dn structures can be created not only from DT, but also directly from newly discovered PCIe devices, so allocate them dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 69 +++- 1 file changed, 52 insertions(+), 17

[PATCH 1/5] powerpc/pci: Access PCI config space directly w/o pci_dn

2018-09-05 Thread Sergey Miroshnichenko
The pci_dn structures are retrieved from a DT, but hot-plugged PCIe devices don't have them. Don't stop PCIe I/O in absence of pci_dn, so it is now possible to discover new devices. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/rtas_pci.c | 89 +---

Re: [RFC PATCH v1 00/17] ban the use of _PAGE_XXX flags outside platform specific code

2018-09-05 Thread Christophe Leroy
On 09/05/2018 02:03 PM, Aneesh Kumar K.V wrote: On 09/05/2018 06:06 PM, Christophe Leroy wrote: Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code have proven to lead to mistakes or misbehaviour, because

Re: [PATCH 3/3] mm: optimise pte dirty/accessed bit setting by demand based pte insertion

2018-09-05 Thread Guenter Roeck
tch fixes the problem. Bisect log is attached. Guenter --- # bad: [387ac6229ecf6e012649d4fc409c5352655a4cf0] Add linux-next specific files for 20180905 # good: [57361846b52bc686112da6ca5368d11210796804] Linux 4.19-rc2 git bisect start 'HEAD' 'v4.19-rc2' # good: [668570e8389bb076bea9b7531553e1362f5abd

RE: FSL/NXP P5020: USB problems with the latest Git kernels

2018-09-05 Thread Laurentiu Tudor
Hi Scott, > -Original Message- > On Mon, 2018-08-27 at 20:15 +0200, Christian Zigotzky wrote: > > Hello, > > > > Our users tested the RC1 of kernel 4.19 on their P5020 boards today. > > Unfortunately the USB bug still exists. With mem values bigger than > 4096M, > > the USB mouse and

Re: [RFC PATCH v1 00/17] ban the use of _PAGE_XXX flags outside platform specific code

2018-09-05 Thread Aneesh Kumar K.V
On 09/05/2018 06:06 PM, Christophe Leroy wrote: Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code have proven to lead to mistakes or misbehaviour, because their use is not always as trivial as one could think.

Re: [PATCH] powerpc64s: Print exception vector name alongside the trap number

2018-09-05 Thread Christophe LEROY
Le 18/04/2018 à 11:02, Naveen N. Rao a écrit : Print a small help text indicating the exception vector alongside the trap number to make it easier while analyzing back traces. As an example: Unable to handle kernel paging request for data at address 0x Faulting instruction

Re: [PATCH] [RFC v2] Drop all 00-INDEX files from Documentation/

2018-09-05 Thread Paul Moore
On Mon, Sep 3, 2018 at 6:15 PM Henrik Austad wrote: > This is a respin with a wider audience (all that get_maintainer returned) > and I know this spams a *lot* of people. Not sure what would be the correct > way, so my apologies for ruining your inbox. > > The 00-INDEX files are supposed to give

[RFC PATCH v1 17/17] powerpc/8xx: change name of a few page flags to avoid confusion

2018-09-05 Thread Christophe Leroy
_PAGE_PRIVILEGED corresponds to the SH bit which doesn't protect against user access but only disables ASID verification on kernel accesses. User access is controlled with _PMD_USER flag. Name it _PAGE_SH instead of _PAGE_PRIVILEGED _PAGE_HUGE corresponds to the SPS bit which doesn't really

[RFC PATCH v1 16/17] powerpc/mm: Get rid of pte-common.h

2018-09-05 Thread Christophe Leroy
Do not include pte-common.h in nohash/32/pgtable.h As that was the last includer, get rid of pte-common.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 23 +-- arch/powerpc/include/asm/pte-common.h| 25 -

[RFC PATCH v1 15/17] powerpc/mm: Define platform default caches related flags

2018-09-05 Thread Christophe Leroy
Cache related flags like _PAGE_COHERENT and _PAGE_WRITETHRU and defined on most platforms. The platforms not defining them don't define any alternative. So we can give them a NUL value directly for those platforms directly. Signed-off-by: Christophe Leroy ---

[RFC PATCH v1 14/17] powerpc/mm: Allow platforms to redefine some helpers

2018-09-05 Thread Christophe Leroy
The 40xx defines _PAGE_HWWRITE while others don't. The 8xx defines _PAGE_RO instead of _PAGE_RW. The 8xx defines _PAGE_PRIVILEGED instead of _PAGE_USER. The 8xx defines _PAGE_HUGE and _PAGE_NA while others don't. Lets those platforms redefine pte_write(), pte_wrprotect() and pte_mkwrite() and get

[RFC PATCH v1 13/17] powerpc/nohash/64: do not include pte-common.h

2018-09-05 Thread Christophe Leroy
nohash/64 only uses book3e PTE flags, so it doesn't need pte-common.h This also allows to drop PAGE_SAO and H_PAGE_4K_PFN from pte_common.h as they are only used by PPC64 Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/pgtable.h | 16 -

[RFC PATCH v1 12/17] powerpc/mm: Distribute platform specific PAGE and PMD flags and definitions

2018-09-05 Thread Christophe Leroy
The base kernel PAGE_ definition sets are more or less platform specific. Lets distribute them close to platform _PAGE_XXX flags definition, and customise them to their exact platform flags. Also defines _PAGE_PSIZE and _PTE_NONE_MASK for each platform allthough they are defined as 0. Do the

[RFC PATCH v1 11/17] powerpc/mm: Move pte_user() into nohash/pgtable.h

2018-09-05 Thread Christophe Leroy
Now the pte-common.h is only for nohash platforms, lets move pte_user() helper out of pte-common.h to put it together with other helpers. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/pgtable.h | 10 ++ arch/powerpc/include/asm/pte-common.h | 13 -

[RFC PATCH v1 10/17] powerpc/book3s/32: do not include pte-common.h

2018-09-05 Thread Christophe Leroy
As done for book3s/64, add necessary flags/defines in book3s/32/pgtable.h and do not include pte-common.h It allows in the meantime to remove all related hash definitions from pte-common.h and to also remove _PAGE_EXEC default as _PAGE_EXEC is defined on all platforms except book3s/32.

[RFC PATCH v1 09/17] powerpc/mm: move __P and __S tables in the common pgtable.h

2018-09-05 Thread Christophe Leroy
__P and __S flags are the same for all platform and should remain as is in the future, so avoid duplication. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/pgtable.h | 20 arch/powerpc/include/asm/pgtable.h | 19 +++

[RFC PATCH v1 08/17] powerpc/mm: drop unused page flags

2018-09-05 Thread Christophe Leroy
The following page flags in pte-common.h can be dropped: _PAGE_ENDIAN is only used in mm/fsl_booke_mmu.c and is defined in asm/nohash/32/pte-fsl-booke.h _PAGE_4K_PFN is nowhere defined nor used _PAGE_READ, _PAGE_WRITE and _PAGE_PTE are only defined and used in book3s/64 The following page

[RFC PATCH v1 07/17] powerpc/mm: Split dump_pagelinuxtables flag_array table

2018-09-05 Thread Christophe Leroy
To reduce the complexity of flag_array, and allow the removal of default 0 value of non existing flags, lets have one flag_array table for each platform family with only the really existing flags. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile| 7 ++

[RFC PATCH v1 06/17] powerpc/mm: use pte helpers in generic code

2018-09-05 Thread Christophe Leroy
Get rid of platform specific _PAGE_ in powerpc code code and use helpers instead. mm/dump_linuxpagetables.c will be handled separately Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 9 +++-- arch/powerpc/include/asm/nohash/32/pgtable.h | 13

[RFC PATCH v1 05/17] powerpc/mm: add pte helpers to query and change pte flags

2018-09-05 Thread Christophe Leroy
In order to avoid using generic _PAGE_XXX flags in powerpc core functions, define helpers for all needed flags: - pte_mkuser() and pte_mkprivileged() to set/unset and/or unset/set _PAGE_USER and/or _PAGE_PRIVILEGED - pte_hashpte() to check if _PAGE_HASHPTE is set. - pte_mknoncoherent() to make a

[RFC PATCH v1 04/17] powerpc/mm: move some nohash pte helpers in nohash/[32:64]/pgtable.h

2018-09-05 Thread Christophe Leroy
In order to allow their use in nohash/32/pgtable.h, we have to move the following helpers in nohash/[32:64]/pgtable.h: - pte_mkwrite() - pte_mkdirty() - pte_mkyoung() - pte_wrprotect() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 28

[RFC PATCH v1 03/17] powerpc/mm: dont't use _PAGE_EXEC in book3s/32

2018-09-05 Thread Christophe Leroy
book3s/32 doesn't define _PAGE_EXEC, so no need to use it. All other platforms define _PAGE_EXEC so no need to check it is not NUL when not book3s/32. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +- arch/powerpc/mm/pgtable.c| 6

[RFC PATCH v1 02/17] powerpc/mm: remove direct use of flags related to cache

2018-09-05 Thread Christophe Leroy
As already done for PPC64, use pgprot_cache() helpers instead of flags in ioremap() derived functions. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/pgtable.h | 2 ++ arch/powerpc/mm/pgtable_32.c | 15 +-- 2 files changed, 11 insertions(+), 6

[RFC PATCH v1 00/17] ban the use of _PAGE_XXX flags outside platform specific code

2018-09-05 Thread Christophe Leroy
Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code have proven to lead to mistakes or misbehaviour, because their use is not always as trivial as one could think. For instance, (flags & _PAGE_USER) == 0 isn't

[RFC PATCH v1 01/17] powerpc/32: Add ioremap_wt()

2018-09-05 Thread Christophe Leroy
Other arches have ioremap_wt() to map IO areas write-through. Implement it on PPC as well in order to avoid drivers using __ioremap(_PAGE_WRITETHRU) Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/io.h | 6 ++ arch/powerpc/mm/pgtable_32.c | 8 2 files changed, 14

[PATCH 3/3] tty: hvc: hvc_write() fix break condition

2018-09-05 Thread Nicholas Piggin
Commit 550ddadcc758 ("tty: hvc: hvc_write() may sleep") broke the termination condition in case the driver stops accepting characters. This can result in unnecessary polling of the busy driver. Restore it by testing the hvc_push return code. Fixes: 550ddadcc758 ("tty: hvc: hvc_write() may

[PATCH 2/3] tty: hvc: hvc_poll() fix read loop batching

2018-09-05 Thread Nicholas Piggin
Patch ec97eaad1383 ("tty: hvc: hvc_poll() break hv read loop") removes get_chars batching entirely, which slows down large console operations like paste -- virtio console "feels worse than a 9600 baud serial line," reports Matteo. This adds back batching in a more latency friendly way. If the

[PATCH 1/3] tty: hvc: hvc_poll() fix read loop hang

2018-09-05 Thread Nicholas Piggin
Patch ec97eaad1383 ("tty: hvc: hvc_poll() break hv read loop") causes the virtio console to hang at times (e.g., if you paste a bunch of characters to it. The reason is that get_chars must return 0 before we can be sure the driver will kick or poll input again, but this change only scheduled a

[PATCH 0/3] tty: hvc: latency break regression fixes

2018-09-05 Thread Nicholas Piggin
Hi Greg, Here are fixes for a few regressions that came in with my carelessness with the irq latency work for the hvc subsystem. These were independently reported in 2 configurations, and I confirmed with another. I think those went upstream via Michael's tree, but he's away at the moment so if

Re: [PATCH 6/6] powerpc sstep: Add modsd, modud instruction emulation

2018-09-05 Thread Sandipan Das
Hi Segher, On Wednesday 05 September 2018 02:51 AM, Segher Boessenkool wrote: > On Mon, Sep 03, 2018 at 08:49:38PM +0530, Sandipan Das wrote: >> +#ifdef __powerpc64__ >> +case 265: /* modud */ >> +if (!cpu_has_feature(CPU_FTR_ARCH_300)) >> +

Re: [PATCH 1/6] powerpc sstep: Add maddhd, maddhdu, maddld instruction emulation

2018-09-05 Thread Sandipan Das
Hi Segher, On Wednesday 05 September 2018 03:42 AM, Segher Boessenkool wrote: > On Mon, Sep 03, 2018 at 08:49:33PM +0530, Sandipan Das wrote: >> +#ifdef __powerpc64__ >> +case 4: >> +if (!cpu_has_feature(CPU_FTR_ARCH_300)) >> +return -1; >> + >> +

Re: v4.17 regression: PowerMac G3 won't boot, was Re: [PATCH v5 1/3] of: cache phandle nodes to reduce cost of of_find_node_by_phandle()

2018-09-05 Thread Benjamin Herrenschmidt
On Fri, 2018-08-31 at 14:35 +1000, Benjamin Herrenschmidt wrote: > > > If I force output with "-f", the resulting file has no occurrences > > of "phandle". > > Are you booting with BootX or Open Firmware ? Assuming you are using BootX (or miBoot), can you try this patch ? ---

Re: [PATCH 3/6] powerpc sstep: Add cnttzw, cnttzd instruction emulation

2018-09-05 Thread Paul Mackerras
On Tue, Sep 04, 2018 at 04:12:07PM -0500, Segher Boessenkool wrote: > On Mon, Sep 03, 2018 at 08:49:35PM +0530, Sandipan Das wrote: > > + case 538: /* cnttzw */ > > + if (!cpu_has_feature(CPU_FTR_ARCH_300)) > > + return -1; > > +

Re: [PATCH v2] powerpc/powernv: Make possible for user to force a full ipl cec reboot

2018-09-05 Thread Vasant Hegde
On 09/03/2018 03:56 PM, Vaibhav Jain wrote: Ever since fast reboot is enabled by default in opal, opal_cec_reboot() will use fast-reset instead of full IPL to perform system reboot. This leaves the user with no direct way to force a full IPL reboot except changing an nvram setting that