Re: [PATCH] mm: kill kmemcheck

2015-03-12 Thread Pekka Enberg

Hi Sasha,

On 3/11/15 1:43 PM, Sasha Levin wrote:

As discussed on LSF/MM, kill kmemcheck.

KASan is a replacement that is able to work without the limitation of
kmemcheck (single CPU, slow). KASan is already upstream.

We are also not aware of any users of kmemcheck (or users who don't consider
KASan as a suitable replacement).

I've build tested it using all[yes,no,mod]config and fuzzed a bit with this
patch applied, didn't notice any bad behaviour.

Signed-off-by: Sasha Levin sasha.le...@oracle.com


Can you elaborate on what exactly was discussed at LSF/MM? Preferably in 
the commit log. ;-)


- Pekka
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH slof v2] pci-properties: Remove redundant call to device-type

2015-03-12 Thread Thomas Huth
On Thu, 12 Mar 2015 00:02:02 +1100
Alexey Kardashevskiy a...@ozlabs.ru wrote:

 At the moment SLOF adds a device_type property automatically for
 every single PCI device based on its class even if there is no SLOF
 driver for such a device. OF1275 says that device_type is for
 implemented interfaces only. A side effect of this is virtio-balloon
 getting device_type==memory while it should not have.
 
 This removes automatic call to device-type from the common PCI code.
 Since now, we rely on existing SLOF PCI drivers to call device-type if
 needed. virtio-blk/net, e1000, ohci/ehci/xhci do this. virtio-scsi
 does not create the property for itself but disks on its bus do.
 virtio-ballon won't get the device_type property as there is no driver
 for it.
 
 While we are here, remove device-type from usb-mouse as well.
 
 Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru
 ---
 Changes:
 v2:
 * removed usb mouse as well - slof does not implement it
 ---
  slof/fs/pci-properties.fs | 2 +-
  slof/fs/usb/dev-mouse.fs  | 1 -
  2 files changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs
 index a19c651..9efa87e 100644
 --- a/slof/fs/pci-properties.fs
 +++ b/slof/fs/pci-properties.fs
 @@ -565,7 +565,7 @@
  \ 
 ***
  \ set up common properties for devices and bridges
  : pci-common-props ( addr -- )
 -dup pci-class-name 2dup device-name device-type
 +dup pci-class-name device-name
  dup pci-vendor@encode-int s vendor-id  property
  dup pci-device@encode-int s device-id  property
  dup pci-revision@  encode-int s revision-idproperty
 diff --git a/slof/fs/usb/dev-mouse.fs b/slof/fs/usb/dev-mouse.fs
 index 278a7c0..f6acd7e 100644
 --- a/slof/fs/usb/dev-mouse.fs
 +++ b/slof/fs/usb/dev-mouse.fs
 @@ -6,7 +6,6 @@ sudev slof-devport l@ dup set-unit encode-phys  reg 
 property
  sudev slof-devudev @ VALUE udev
 
  s usb-mouse device-name
 -s mouse device-type
 
  \ .S cr
  \ dup slof-devudev dup . @ . cr

Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH slof v2] pci-properties: Remove redundant call to device-type

2015-03-12 Thread Alexey Kardashevskiy
At the moment SLOF adds a device_type property automatically for
every single PCI device based on its class even if there is no SLOF
driver for such a device. OF1275 says that device_type is for
implemented interfaces only. A side effect of this is virtio-balloon
getting device_type==memory while it should not have.

This removes automatic call to device-type from the common PCI code.
Since now, we rely on existing SLOF PCI drivers to call device-type if
needed. virtio-blk/net, e1000, ohci/ehci/xhci do this. virtio-scsi
does not create the property for itself but disks on its bus do.
virtio-ballon won't get the device_type property as there is no driver
for it.

While we are here, remove device-type from usb-mouse as well.

Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru
---
Changes:
v2:
* removed usb mouse as well - slof does not implement it
---
 slof/fs/pci-properties.fs | 2 +-
 slof/fs/usb/dev-mouse.fs  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs
index a19c651..9efa87e 100644
--- a/slof/fs/pci-properties.fs
+++ b/slof/fs/pci-properties.fs
@@ -565,7 +565,7 @@
 \ 
***
 \ set up common properties for devices and bridges
 : pci-common-props ( addr -- )
-dup pci-class-name 2dup device-name device-type
+dup pci-class-name device-name
 dup pci-vendor@encode-int s vendor-id  property
 dup pci-device@encode-int s device-id  property
 dup pci-revision@  encode-int s revision-idproperty
diff --git a/slof/fs/usb/dev-mouse.fs b/slof/fs/usb/dev-mouse.fs
index 278a7c0..f6acd7e 100644
--- a/slof/fs/usb/dev-mouse.fs
+++ b/slof/fs/usb/dev-mouse.fs
@@ -6,7 +6,6 @@ sudev slof-devport l@ dup set-unit encode-phys  reg property
 sudev slof-devudev @ VALUE udev
 
 s usb-mouse device-name
-s mouse device-type
 
 \ .S cr
 \ dup slof-devudev dup . @ . cr
-- 
2.0.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH 4/7]powerpc/powernv: Add OPAL support for Nest pmu

2015-03-12 Thread maddy



On Thursday 12 March 2015 04:27 AM, Stewart Smith wrote:

Madhavan Srinivasan ma...@linux.vnet.ibm.com writes:

Nest Counters can be configured via PORE Engine and OPAL
provides an interface call to it. PORE Engine also does the
work of moving the counter data to memory.

Do you have the associated skiboot patch that implements this firmware
call? I haven't seen it on the skiboot list yet :)

Hi Stewart,

OPAL side code is under-developement. Will post the patches soon to 
the skiboot mailing list.


Regards
Maddy

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 4/5] arm64/efi: ensure that Image does not cross a 512 MB boundary

2015-03-12 Thread Ard Biesheuvel
Update the Image placement logic used by the stub to make absolutely
sure that the Image is placed such that the early init code will
always be able to map it. This means the entire static memory footprint
of the Image should be inside the same naturally aligned 512 MB region.

First of all, the preferred offset of dram_base + TEXT_OFFSET is only
suitable if it doesn't result in the Image crossing a 512 MB
alignment boundary, which could be the case if dram_base itself is
close to the end of a naturally aligned 512 MB region.

Also, when moving the kernel Image, we need to verify that the new
destination region does not cross a 512 MB alignment boundary either.
If that is the case, we retry the allocation with the alignment
chosen such that the resulting region will always be suitable.

Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org
---
 arch/arm64/kernel/efi-stub.c | 41 +
 1 file changed, 33 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c
index f5374065ad53..3b67ca4e2f2e 100644
--- a/arch/arm64/kernel/efi-stub.c
+++ b/arch/arm64/kernel/efi-stub.c
@@ -21,15 +21,40 @@ efi_status_t __init handle_kernel_image(efi_system_table_t 
*sys_table,
unsigned long dram_base,
efi_loaded_image_t *image)
 {
+   const unsigned long kernel_size = _edata - _text;
+   const unsigned long kernel_memsize = _end - _text;
+   unsigned long preferred_offset;
efi_status_t status;
-   unsigned long kernel_size, kernel_memsize = 0;
-
-   /* Relocate the image, if required. */
-   kernel_size = _edata - _text;
-   if (*image_addr != (dram_base + TEXT_OFFSET)) {
-   kernel_memsize = kernel_size + (_end - _edata);
-   status = efi_low_alloc(sys_table, kernel_memsize + TEXT_OFFSET,
-  SZ_2M, reserve_addr);
+
+   /*
+* The kernel Image should be located as close as possible to the
+* base of system RAM, but its static memory footprint must not
+* cross a 512 MB alignment boundary.
+*/
+   preferred_offset = dram_base + TEXT_OFFSET;
+   if ((preferred_offset  (SZ_512M - 1)) + kernel_memsize  SZ_512M)
+   preferred_offset = round_up(dram_base, SZ_512M) + TEXT_OFFSET;
+
+   if (*image_addr != preferred_offset) {
+   const unsigned long alloc_size = kernel_memsize + TEXT_OFFSET;
+
+   status = efi_low_alloc(sys_table, alloc_size, SZ_2M,
+  reserve_addr);
+
+   /*
+* Check whether the new allocation crosses a 512 MB alignment
+* boundary. If so, retry with the alignment set to a power of
+* two upper bound of the allocation size. That is guaranteed
+* to produce a suitable allocation, but may waste more memory.
+*/
+   if (status == EFI_SUCCESS 
+   ((*reserve_addr  (SZ_512M - 1)) + alloc_size)  SZ_512M) {
+   efi_free(sys_table, alloc_size, *reserve_addr);
+
+   status = efi_low_alloc(sys_table, alloc_size,
+  roundup_pow_of_two(alloc_size),
+  reserve_addr);
+   }
if (status != EFI_SUCCESS) {
pr_efi_err(sys_table, Failed to relocate kernel\n);
return status;
-- 
1.8.3.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC] powerpc: use ticket spin lock for !CONFIG_PPC_SPLPAR

2015-03-12 Thread Kevin Hao
I know Torsten Duwe has tried to add the ticket spinlock for powerpc
one year ago [1]. But it make no progress due to the conflict between
PPC_SPLPAR and lockref. We still don't find a better way to handle
this. But instead of waiting forever for a perfect solution, can't we
just use the ticket spinlock for the !CONFIG_PPC_SPLPAR?

This is a very rough patch based on arm64 codes. I want to make sure
that this is acceptable before going step further. This just passed
build and boot test on a fsl t4240rdb board. I have done a simple
performance benchmark by running the following command ten times before
and after applying this patch:
./perf bench sched messaging

BeforeAfter
Averaged total time [sec]:  0.403 0.367

So we can see a ~9% performance enhancing. This patch depends on this
one [2].

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-February/115195.html
[2] http://patchwork.ozlabs.org/patch/447563/

Signed-off-by: Kevin Hao haoke...@gmail.com
---
 arch/powerpc/include/asm/spinlock.h   | 79 ++-
 arch/powerpc/include/asm/spinlock_types.h | 16 +++
 arch/powerpc/lib/locks.c  |  2 +-
 3 files changed, 95 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/spinlock.h 
b/arch/powerpc/include/asm/spinlock.h
index d303cdad2519..3faf2507abe9 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -54,6 +54,7 @@
 #define SYNC_IO
 #endif
 
+#ifdef CONFIG_PPC_SPLPAR
 static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
 {
return lock.slock == 0;
@@ -89,6 +90,40 @@ static inline unsigned long 
__arch_spin_trylock(arch_spinlock_t *lock)
return tmp;
 }
 
+#else
+static inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+   return lock.owner == lock.next;
+}
+
+static inline int arch_spin_is_locked(arch_spinlock_t *lock)
+{
+   return !arch_spin_value_unlocked(READ_ONCE(*lock));
+}
+
+static inline unsigned long __arch_spin_trylock(arch_spinlock_t *lock)
+{
+   unsigned int tmp;
+   arch_spinlock_t lockval;
+
+   __asm__ __volatile__ (
+1: PPC_LWARX(%0,0,%2,1) \n\
+   rotlwi  %1,%0,16\n\
+   xor.%1,%1,%0\n\
+   bne-2f\n\
+   add %0,%0,%3\n\
+   stwcx.  %0,0,%2\n\
+   bne-1b\n
+   PPC_ACQUIRE_BARRIER
+2:
+   : =r (lockval), =r (tmp)
+   : r (lock), r (1  TICKET_SHIFT)
+   : cr0, memory);
+
+   return tmp;
+}
+#endif
+
 static inline int arch_spin_trylock(arch_spinlock_t *lock)
 {
CLEAR_IO_SYNC;
@@ -120,6 +155,7 @@ extern void __rw_yield(arch_rwlock_t *lock);
 #define SHARED_PROCESSOR   0
 #endif
 
+#ifdef CONFIG_PPC_SPLPAR
 static inline void arch_spin_lock(arch_spinlock_t *lock)
 {
CLEAR_IO_SYNC;
@@ -155,16 +191,57 @@ void arch_spin_lock_flags(arch_spinlock_t *lock, unsigned 
long flags)
local_irq_restore(flags_dis);
}
 }
+#else
+#define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
+
+static inline int arch_spin_is_contended(arch_spinlock_t *lock)
+{
+   arch_spinlock_t lockval = READ_ONCE(*lock);
+   return (lockval.next - lockval.owner)  1;
+}
+#define arch_spin_is_contended arch_spin_is_contended
+
+static inline void arch_spin_lock(arch_spinlock_t *lock)
+{
+   unsigned int tmp;
+   arch_spinlock_t lockval;
+
+   CLEAR_IO_SYNC;
+   __asm__ __volatile__ (
+1: PPC_LWARX(%0,0,%2,1) \n\
+   add %1,%0,%4\n\
+   stwcx.  %1,0,%2\n\
+   bne-1b\n\
+   rotlwi  %1,%0,16\n\
+   cmpw%1,%0\n\
+   beq 3f\n\
+   rlwinm  %0,%0,16,16,31\n\
+2: or  1,1,1\n\
+   lhz %1,0(%3)\n\
+   cmpw%1,%0\n\
+   bne 2b\n\
+   or  2,2,2\n\
+3:
+   PPC_ACQUIRE_BARRIER
+   : =r (lockval), =r (tmp)
+   : r(lock), r (lock-owner), r (1  TICKET_SHIFT)
+   : cr0, memory);
+}
+#endif
 
 static inline void arch_spin_unlock(arch_spinlock_t *lock)
 {
SYNC_IO;
__asm__ __volatile__(# arch_spin_unlock\n\t
PPC_RELEASE_BARRIER: : :memory);
+#ifdef CONFIG_PPC_SPLPAR
lock-slock = 0;
+#else
+   lock-owner++;
+#endif
 }
 
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_SPLPAR
 extern void arch_spin_unlock_wait(arch_spinlock_t *lock);
 #else
 #define arch_spin_unlock_wait(lock) \
diff --git a/arch/powerpc/include/asm/spinlock_types.h 
b/arch/powerpc/include/asm/spinlock_types.h
index 2351adc4fdc4..1af94f290363 100644
--- a/arch/powerpc/include/asm/spinlock_types.h
+++ b/arch/powerpc/include/asm/spinlock_types.h
@@ -5,11 +5,27 @@
 # error please don't include this file directly
 #endif
 
+#ifdef CONFIG_PPC_SPLPAR
 typedef struct {
volatile unsigned int slock;
 } arch_spinlock_t;
 
 

[PATCH v3 0/9] powerpc: kill PPC_OF

2015-03-12 Thread Kevin Hao
Hi Michael,

Finally I got all the acks for these patches. The following two patches in v2
were merged into next now.
213dce3c17a6 (tty: kconfig: remove the superfluous dependency on 
PPC_OF)
f4e074f20cad (mmc: kconfig: replace PPC_OF with PPC)

So we may have dependency issue if we put this series into 4.1.

v3: No codes change, just add the acks from Ben and Tomi.

Kevin Hao (9):
  sata_svw: remove the dependency on PPC_OF
  fbdev: aty128fb: replace PPC_OF with PPC
  fbdev: radeon: replace PPC_OF with PPC
  fbdev: imsttfb: remove the dependency on PPC_OF
  fbdev: nvidia: remove the dependency on PPC_OF
  fbdev: riva: remove the dependency on PPC_OF
  fbdev: remove the unnecessary includes of ppc specific header files
  fbdev: kconfig: replace PPC_OF with PPC
  powerpc: kill PPC_OF

 arch/powerpc/Kconfig |  3 ---
 arch/powerpc/Kconfig.debug   |  2 +-
 arch/powerpc/kernel/Makefile |  4 ++--
 drivers/ata/sata_svw.c   | 11 +--
 drivers/video/fbdev/Kconfig  |  4 ++--
 drivers/video/fbdev/aty/aty128fb.c   |  4 ++--
 drivers/video/fbdev/aty/radeon_base.c| 24 
 drivers/video/fbdev/aty/radeon_monitor.c | 20 ++--
 drivers/video/fbdev/aty/radeon_pm.c  | 16 
 drivers/video/fbdev/aty/radeonfb.h   |  4 ++--
 drivers/video/fbdev/core/fbmon.c |  4 
 drivers/video/fbdev/imsttfb.c|  6 +-
 drivers/video/fbdev/nvidia/Makefile  |  3 +--
 drivers/video/fbdev/nvidia/nv_of.c   |  3 ---
 drivers/video/fbdev/nvidia/nv_proto.h|  8 
 drivers/video/fbdev/nvidia/nvidia.c  |  4 
 drivers/video/fbdev/riva/fbdev.c | 17 +++--
 17 files changed, 49 insertions(+), 88 deletions(-)

-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 1/9] sata_svw: remove the dependency on PPC_OF

2015-03-12 Thread Kevin Hao
The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Tejun Heo t...@kernel.org
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
---
 drivers/ata/sata_svw.c | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index c630fa812624..4c06f6281d74 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -47,11 +47,7 @@
 #include scsi/scsi_cmnd.h
 #include scsi/scsi.h
 #include linux/libata.h
-
-#ifdef CONFIG_PPC_OF
-#include asm/prom.h
-#include asm/pci-bridge.h
-#endif /* CONFIG_PPC_OF */
+#include linux/of.h
 
 #define DRV_NAME   sata_svw
 #define DRV_VERSION2.3
@@ -320,7 +316,6 @@ static u8 k2_stat_check_status(struct ata_port *ap)
return readl(ap-ioaddr.status_addr);
 }
 
-#ifdef CONFIG_PPC_OF
 static int k2_sata_show_info(struct seq_file *m, struct Scsi_Host *shost)
 {
struct ata_port *ap;
@@ -350,14 +345,10 @@ static int k2_sata_show_info(struct seq_file *m, struct 
Scsi_Host *shost)
}
return 0;
 }
-#endif /* CONFIG_PPC_OF */
-
 
 static struct scsi_host_template k2_sata_sht = {
ATA_BMDMA_SHT(DRV_NAME),
-#ifdef CONFIG_PPC_OF
.show_info  = k2_sata_show_info,
-#endif
 };
 
 
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 2/9] fbdev: aty128fb: replace PPC_OF with PPC

2015-03-12 Thread Kevin Hao
The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
Acked-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/fbdev/aty/aty128fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/aty/aty128fb.c 
b/drivers/video/fbdev/aty/aty128fb.c
index aedf2fbf9bf6..0156954bf340 100644
--- a/drivers/video/fbdev/aty/aty128fb.c
+++ b/drivers/video/fbdev/aty/aty128fb.c
@@ -965,7 +965,7 @@ static void __iomem *aty128_find_mem_vbios(struct 
aty128fb_par *par)
 /* fill in known card constants if pll_block is not available */
 static void aty128_timings(struct aty128fb_par *par)
 {
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
/* instead of a table lookup, assume OF has properly
 * setup the PLL registers and use their values
 * to set the XCLK values and reference divider values */
@@ -979,7 +979,7 @@ static void aty128_timings(struct aty128fb_par *par)
if (!par-constants.ref_clk)
par-constants.ref_clk = 2950;
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
x_mpll_ref_fb_div = aty_ld_pll(X_MPLL_REF_FB_DIV);
xclk_cntl = aty_ld_pll(XCLK_CNTL)  0x7;
Nx = (x_mpll_ref_fb_div  0x00ff00)  8;
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 3/9] fbdev: radeon: replace PPC_OF with PPC

2015-03-12 Thread Kevin Hao
The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
Acked-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/fbdev/Kconfig  |  2 +-
 drivers/video/fbdev/aty/radeon_base.c| 24 
 drivers/video/fbdev/aty/radeon_monitor.c | 20 ++--
 drivers/video/fbdev/aty/radeon_pm.c  | 16 
 drivers/video/fbdev/aty/radeonfb.h   |  4 ++--
 5 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index b3dd417b4719..3b818d7a0983 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1333,7 +1333,7 @@ config FB_RADEON
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-   select FB_MACMODES if PPC_OF
+   select FB_MACMODES if PPC
help
  Choose this option if you want to use an ATI Radeon graphics card as
  a framebuffer device.  There are both PCI and AGP versions.  You
diff --git a/drivers/video/fbdev/aty/radeon_base.c 
b/drivers/video/fbdev/aty/radeon_base.c
index 26d80a4486fb..01237c8fcdc6 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -74,7 +74,7 @@
 #include asm/io.h
 #include linux/uaccess.h
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 
 #include asm/pci-bridge.h
 #include ../macmodes.h
@@ -83,7 +83,7 @@
 #include asm/btext.h
 #endif
 
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 #ifdef CONFIG_MTRR
 #include asm/mtrr.h
@@ -418,7 +418,7 @@ static int  radeon_find_mem_vbios(struct radeonfb_info 
*rinfo)
 }
 #endif
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 /*
  * Read XTAL (ref clock), SCLK and MCLK from Open Firmware device
  * tree. Hopefully, ATI OF driver is kind enough to fill these
@@ -448,7 +448,7 @@ static int radeon_read_xtal_OF(struct radeonfb_info *rinfo)
 
return 0;
 }
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
+#endif /* CONFIG_PPC || CONFIG_SPARC */
 
 /*
  * Read PLL infos from chip registers
@@ -653,7 +653,7 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo)
rinfo-pll.ref_div = INPLL(PPLL_REF_DIV)  PPLL_REF_DIV_MASK;
 
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
/*
 * Retrieve PLL infos from Open Firmware first
 */
@@ -661,7 +661,7 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo)
printk(KERN_INFO radeonfb: Retrieved PLL infos from 
Open Firmware\n);
goto found;
}
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
+#endif /* CONFIG_PPC || CONFIG_SPARC */
 
/*
 * Check out if we have an X86 which gave us some PLL informations
@@ -1910,7 +1910,7 @@ static int radeon_set_fbinfo(struct radeonfb_info *rinfo)
  * I put the card's memory at 0 in card space and AGP at some random high
  * local (0xe000 for now) that will be changed by XFree/DRI anyway
  */
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 #undef SET_MC_FB_FROM_APERTURE
 static void fixup_memory_mappings(struct radeonfb_info *rinfo)
 {
@@ -1984,7 +1984,7 @@ static void fixup_memory_mappings(struct radeonfb_info 
*rinfo)
((aper_base + aper_size - 1)  0x) | (aper_base  16),
0x | (agp_base  16));
 }
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 
 static void radeon_identify_vram(struct radeonfb_info *rinfo)
@@ -2236,7 +2236,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
rinfo-family == CHIP_FAMILY_RS200)
rinfo-errata |= CHIP_ERRATA_PLL_DELAY;
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
/* On PPC, we obtain the OF device-node pointer to the firmware
 * data for this chip
 */
@@ -2245,14 +2245,14 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
printk(KERN_WARNING radeonfb (%s): Cannot match card to OF 
node !\n,
   pci_name(rinfo-pdev));
 
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
-#ifdef CONFIG_PPC_OF
+#endif /* CONFIG_PPC || CONFIG_SPARC */
+#ifdef CONFIG_PPC
/* On PPC, the firmware sets up a memory mapping that tends
 * to cause lockups when enabling the engine. We reconfigure
 * the card internal memory mappings properly
 */
fixup_memory_mappings(rinfo);
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
/* Get VRAM size and type */
radeon_identify_vram(rinfo);
diff --git 

[PATCH v3 4/9] fbdev: imsttfb: remove the dependency on PPC_OF

2015-03-12 Thread Kevin Hao
The OF functionality has moved to a common place and be used by many
archs. So we don't need to depend on PPC_OF option any more. This is
a preparation for killing PPC_OF.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
Acked-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/fbdev/imsttfb.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c
index aae10ce74f14..9b167f7ef6c6 100644
--- a/drivers/video/fbdev/imsttfb.c
+++ b/drivers/video/fbdev/imsttfb.c
@@ -1470,15 +1470,13 @@ static int imsttfb_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
unsigned long addr, size;
struct imstt_par *par;
struct fb_info *info;
-#ifdef CONFIG_PPC_OF
struct device_node *dp;

dp = pci_device_to_OF_node(pdev);
if(dp)
printk(KERN_INFO %s: OF name %s\n,__func__, dp-name);
-   else
+   else if (IS_ENABLED(CONFIG_OF))
printk(KERN_ERR imsttfb: no OF node for pci device\n);
-#endif /* CONFIG_PPC_OF */
 
info = framebuffer_alloc(sizeof(struct imstt_par), pdev-dev);
 
@@ -1501,11 +1499,9 @@ static int imsttfb_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
switch (pdev-device) {
case PCI_DEVICE_ID_IMS_TT128: /* IMS,tt128mbA */
par-ramdac = IBM;
-#ifdef CONFIG_PPC_OF
if (dp  ((strcmp(dp-name, IMS,tt128mb8) == 0) ||
   (strcmp(dp-name, IMS,tt128mb8A) == 0)))
par-ramdac = TVP;
-#endif /* CONFIG_PPC_OF */
break;
case PCI_DEVICE_ID_IMS_TT3D:  /* IMS,tt3d */
par-ramdac = TVP;
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 5/9] fbdev: nvidia: remove the dependency on PPC_OF

2015-03-12 Thread Kevin Hao
The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
Acked-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/fbdev/nvidia/Makefile   | 3 +--
 drivers/video/fbdev/nvidia/nv_of.c| 3 ---
 drivers/video/fbdev/nvidia/nv_proto.h | 8 
 drivers/video/fbdev/nvidia/nvidia.c   | 4 
 4 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/Makefile 
b/drivers/video/fbdev/nvidia/Makefile
index ca47432113e0..917d3eb05feb 100644
--- a/drivers/video/fbdev/nvidia/Makefile
+++ b/drivers/video/fbdev/nvidia/Makefile
@@ -5,9 +5,8 @@
 obj-$(CONFIG_FB_NVIDIA)  += nvidiafb.o
 
 nvidiafb-y   := nvidia.o nv_hw.o nv_setup.o \
-   nv_accel.o
+   nv_accel.o nv_of.o
 nvidiafb-$(CONFIG_FB_NVIDIA_I2C) += nv_i2c.o
 nvidiafb-$(CONFIG_FB_NVIDIA_BACKLIGHT)  += nv_backlight.o
-nvidiafb-$(CONFIG_PPC_OF)   += nv_of.o
 
 nvidiafb-objs:= $(nvidiafb-y)
diff --git a/drivers/video/fbdev/nvidia/nv_of.c 
b/drivers/video/fbdev/nvidia/nv_of.c
index 3bc13df4b120..5f3e5179c25a 100644
--- a/drivers/video/fbdev/nvidia/nv_of.c
+++ b/drivers/video/fbdev/nvidia/nv_of.c
@@ -19,9 +19,6 @@
 
 #include asm/io.h
 
-#include asm/prom.h
-#include asm/pci-bridge.h
-
 #include nv_type.h
 #include nv_local.h
 #include nv_proto.h
diff --git a/drivers/video/fbdev/nvidia/nv_proto.h 
b/drivers/video/fbdev/nvidia/nv_proto.h
index ff5c410355ea..878a5ce02299 100644
--- a/drivers/video/fbdev/nvidia/nv_proto.h
+++ b/drivers/video/fbdev/nvidia/nv_proto.h
@@ -42,16 +42,8 @@ int nvidia_probe_i2c_connector(struct fb_info *info, int 
conn,
 #define nvidia_probe_i2c_connector(p, c, edid) (-1)
 #endif
 
-#ifdef CONFIG_PPC_OF
 int nvidia_probe_of_connector(struct fb_info *info, int conn,
  u8 ** out_edid);
-#else
-static inline int nvidia_probe_of_connector(struct fb_info *info, int conn,
- u8 ** out_edid)
-{
-   return -1;
-}
-#endif
 
 /* in nv_accel.c */
 extern void NVResetGraphics(struct fb_info *info);
diff --git a/drivers/video/fbdev/nvidia/nvidia.c 
b/drivers/video/fbdev/nvidia/nvidia.c
index def041204676..4273c6ee8cf6 100644
--- a/drivers/video/fbdev/nvidia/nvidia.c
+++ b/drivers/video/fbdev/nvidia/nvidia.c
@@ -24,10 +24,6 @@
 #ifdef CONFIG_MTRR
 #include asm/mtrr.h
 #endif
-#ifdef CONFIG_PPC_OF
-#include asm/prom.h
-#include asm/pci-bridge.h
-#endif
 #ifdef CONFIG_BOOTX_TEXT
 #include asm/btext.h
 #endif
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 6/9] fbdev: riva: remove the dependency on PPC_OF

2015-03-12 Thread Kevin Hao
The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
Acked-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/fbdev/riva/fbdev.c | 17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index be73727c7227..294a80908c8c 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -44,10 +44,6 @@
 #ifdef CONFIG_MTRR
 #include asm/mtrr.h
 #endif
-#ifdef CONFIG_PPC_OF
-#include asm/prom.h
-#include asm/pci-bridge.h
-#endif
 #ifdef CONFIG_PMAC_BACKLIGHT
 #include asm/machdep.h
 #include asm/backlight.h
@@ -1735,7 +1731,6 @@ static int riva_set_fbinfo(struct fb_info *info)
return (rivafb_check_var(info-var, info));
 }
 
-#ifdef CONFIG_PPC_OF
 static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 {
struct riva_par *par = info-par;
@@ -1766,9 +1761,8 @@ static int riva_get_EDID_OF(struct fb_info *info, struct 
pci_dev *pd)
NVTRACE_LEAVE();
return 0;
 }
-#endif /* CONFIG_PPC_OF */
 
-#if defined(CONFIG_FB_RIVA_I2C)  !defined(CONFIG_PPC_OF)
+#if defined(CONFIG_FB_RIVA_I2C)
 static int riva_get_EDID_i2c(struct fb_info *info)
 {
struct riva_par *par = info-par;
@@ -1828,10 +1822,13 @@ static void riva_update_default_var(struct 
fb_var_screeninfo *var,
 static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
 {
NVTRACE_ENTER();
-#ifdef CONFIG_PPC_OF
-   if (!riva_get_EDID_OF(info, pdev))
+   if (riva_get_EDID_OF(info, pdev)) {
+   NVTRACE_LEAVE();
+   return;
+   }
+   if (IS_ENABLED(CONFIG_OF))
printk(PFX could not retrieve EDID from OF\n);
-#elif defined(CONFIG_FB_RIVA_I2C)
+#if defined(CONFIG_FB_RIVA_I2C)
if (!riva_get_EDID_i2c(info))
printk(PFX could not retrieve EDID from DDC/I2C\n);
 #endif
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 7/9] fbdev: remove the unnecessary includes of ppc specific header files

2015-03-12 Thread Kevin Hao
In the current kernel, we don't need to include these arch specific
header files for ppc.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
Acked-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/fbdev/core/fbmon.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 868facdec638..01ef1b953390 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -33,10 +33,6 @@
 #include video/edid.h
 #include video/of_videomode.h
 #include video/videomode.h
-#ifdef CONFIG_PPC_OF
-#include asm/prom.h
-#include asm/pci-bridge.h
-#endif
 #include ../edid.h
 
 /*
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 8/9] fbdev: kconfig: replace PPC_OF with PPC

2015-03-12 Thread Kevin Hao
The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
Acked-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/fbdev/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 3b818d7a0983..109462303087 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -479,7 +479,7 @@ config FB_ATARI
 
 config FB_OF
bool Open Firmware frame buffer device support
-   depends on (FB = y)  (PPC64 || PPC_OF)  (!PPC_PSERIES || PCI)
+   depends on (FB = y)  PPC  (!PPC_PSERIES || PCI)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v3 9/9] powerpc: kill PPC_OF

2015-03-12 Thread Kevin Hao
We have set CONFIG_PPC_OF to always 'y' in commit 0a498d96a332
(powerpc: set CONFIG_PPC_OF=y always for ARCH=powerpc) nine years
ago. And the arch/ppc also has gone away for many years. The OF
functionality was also moved to a common place and be used by many
archs. So it does make no sense to keep such a option in the current
kernel. Just kill it.

Signed-off-by: Kevin Hao haoke...@gmail.com
Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org
---
 arch/powerpc/Kconfig | 3 ---
 arch/powerpc/Kconfig.debug   | 2 +-
 arch/powerpc/kernel/Makefile | 4 ++--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9b780e0d2c18..fb48a2e2f0b3 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -189,9 +189,6 @@ config ARCH_MAY_HAVE_PC_FDC
bool
default PCI
 
-config PPC_OF
-   def_bool y
-
 config PPC_UDBG_16550
bool
default n
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index ec2e40f2cc11..bfd823abff93 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -117,7 +117,7 @@ config BDI_SWITCH
 
 config BOOTX_TEXT
bool Support for early boot text console (BootX or OpenFirmware only)
-   depends on PPC_OF  PPC_BOOK3S
+   depends on PPC_BOOK3S
help
  Say Y here to see progress messages from the boot firmware in text
  mode. Requires either BootX or Open Firmware.
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 502cf69b6c89..c1ebbdaac28f 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -33,7 +33,8 @@ obj-y := cputable.o ptrace.o 
syscalls.o \
   signal.o sysfs.o cacheinfo.o time.o \
   prom.o traps.o setup-common.o \
   udbg.o misc.o io.o dma.o \
-  misc_$(CONFIG_WORD_SIZE).o vdso32/
+  misc_$(CONFIG_WORD_SIZE).o vdso32/ \
+  of_platform.o prom_parse.o
 obj-$(CONFIG_PPC64)+= setup_64.o sys_ppc32.o \
   signal_64.o ptrace32.o \
   paca.o nvram_64.o firmware.o
@@ -47,7 +48,6 @@ obj-$(CONFIG_PPC64)   += vdso64/
 obj-$(CONFIG_ALTIVEC)  += vecemu.o
 obj-$(CONFIG_PPC_970_NAP)  += idle_power4.o
 obj-$(CONFIG_PPC_P7_NAP)   += idle_power7.o
-obj-$(CONFIG_PPC_OF)   += of_platform.o prom_parse.o
 procfs-y   := proc_powerpc.o
 obj-$(CONFIG_PROC_FS)  += $(procfs-y)
 rtaspci-$(CONFIG_PPC64)-$(CONFIG_PCI)  := rtas_pci.o
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC V2 04/12] i2c: opal: make use of the new infrastructure for quirks

2015-03-12 Thread Wolfram Sang

 I think we can't land up here by-passing the check for quirks so above
 checks are duplicated here..

True.

So, as Ben seems OK with write-then-anything, can you send me your
changes as an incremental patch to mine with your Signed-off, please?

Thanks,

   Wolfram



signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 4/4] mm: numa: Slow PTE scan rate if migration failures occur

2015-03-12 Thread Mel Gorman
On Tue, Mar 10, 2015 at 04:55:52PM -0700, Linus Torvalds wrote:
 On Mon, Mar 9, 2015 at 12:19 PM, Dave Chinner da...@fromorbit.com wrote:
  On Mon, Mar 09, 2015 at 09:52:18AM -0700, Linus Torvalds wrote:
 
  What's your virtual environment setup? Kernel config, and
  virtualization environment to actually get that odd fake NUMA thing
  happening?
 
  I don't have the exact .config with me (test machines at home
  are shut down because I'm half a world away), but it's pretty much
  this (copied and munged from a similar test vm on my laptop):
 
 [ snip snip ]
 
 Ok, I hate debugging by symptoms anyway, so I didn't do any of this,
 and went back to actually *thinking* about the code instead of trying
 to reproduce this and figure things out by trial and error.
 
 And I think I figured it out.
 SNIP

I believe you're correct and it matches what was observed. I'm still
travelling and wireless is dirt but managed to queue a test using pmd_dirty

  3.19.0 4.0.0-rc1  
   4.0.0-rc1
 vanilla   vanilla  
  ptewrite-v1r20
Time User-NUMA01  25695.96 (  0.00%)32883.59 (-27.97%)
24012.80 (  6.55%)
Time User-NUMA01_THEADLOCAL   17404.36 (  0.00%)17453.20 ( -0.28%)
17950.54 ( -3.14%)
Time User-NUMA02   2037.65 (  0.00%) 2063.70 ( -1.28%) 
2046.88 ( -0.45%)
Time User-NUMA02_SMT981.02 (  0.00%)  983.70 ( -0.27%)  
983.68 ( -0.27%)
Time System-NUMA01  194.70 (  0.00%)  602.44 (-209.42%) 
 158.90 ( 18.39%)
Time System-NUMA01_THEADLOCAL98.52 (  0.00%)   78.10 ( 20.73%)  
107.66 ( -9.28%)
Time System-NUMA029.28 (  0.00%)6.47 ( 30.28%)  
  9.25 (  0.32%)
Time System-NUMA02_SMT3.79 (  0.00%)5.06 (-33.51%)  
  3.92 ( -3.43%)
Time Elapsed-NUMA01 558.84 (  0.00%)  755.96 (-35.27%)  
532.41 (  4.73%)
Time Elapsed-NUMA01_THEADLOCAL  382.54 (  0.00%)  382.22 (  0.08%)  
390.48 ( -2.08%)
Time Elapsed-NUMA02  49.83 (  0.00%)   49.38 (  0.90%)  
 49.79 (  0.08%)
Time Elapsed-NUMA02_SMT  46.59 (  0.00%)   47.70 ( -2.38%)  
 47.77 ( -2.53%)
Time CPU-NUMA014632.00 (  0.00%) 4429.00 (  4.38%) 
4539.00 (  2.01%)
Time CPU-NUMA01_THEADLOCAL 4575.00 (  0.00%) 4586.00 ( -0.24%) 
4624.00 ( -1.07%)
Time CPU-NUMA024107.00 (  0.00%) 4191.00 ( -2.05%) 
4129.00 ( -0.54%)
Time CPU-NUMA02_SMT2113.00 (  0.00%) 2072.00 (  1.94%) 
2067.00 (  2.18%)

  3.19.0   4.0.0-rc1   4.0.0-rc1
 vanilla vanillaptewrite-v1r20
User46119.1253384.2944994.10
System306.41  692.14  279.78
Elapsed  1039.88 1236.87 1022.92

There are still some difference but it's much closer to what it was.
The balancing stats are almost looking similar to 3.19

NUMA base PTE updates222840103   304513172   230724075
NUMA huge PMD updates   434894  594467  450274
NUMA page range updates  445505831   608880276   461264363
NUMA hint faults601358  733491  626176
NUMA hint local faults  371571  511530  359215
NUMA hint local percent 61  69  57
NUMA pages migrated707317726366701 6829196

XFS repair on the same machine is not fully restore either but a big
enough move in the right direction to indicate this was the relevant
change.

xfsrepair
   3.19.0 4.0.0-rc1 
4.0.0-rc1
  vanilla   vanilla
ptewrite-v1r20
Ameanreal-fsmark1166.28 (  0.00%) 1166.63 ( -0.03%) 1184.97 
( -1.60%)
Ameansyst-fsmark4025.87 (  0.00%) 4020.94 (  0.12%) 4071.10 
( -1.12%)
Ameanreal-xfsrepair  447.66 (  0.00%)  507.85 (-13.45%)  460.94 
( -2.97%)
Ameansyst-xfsrepair  202.93 (  0.00%)  519.88 (-156.19%)  
282.45 (-39.19%)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC V2 00/12] i2c: describe adapter quirks in a generic way

2015-03-12 Thread Wolfram Sang

 For QUP driver. 
 
 Reviewed-by: Ivan T. Ivanov iiva...@mm-sol.com
 Tested-by: Ivan T. Ivanov iiva...@mm-sol.com

Great, thanks for testing!



signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC V2 12/12] i2c: bcm-iproc: make use of the new infrastructure for quirks

2015-03-12 Thread Wolfram Sang

 Change on the iproc i2c driver looks good to me. Sanity tested the
 change from Wolfram's i2c/quirks branch on Cygnus 958300K combo board.
 Sanity tested with an attempt to transfer large amount of I2C data to
 ensure the transfer is denied by the i2c-core:
 
 / # cat /dev/i2c-0
 [  657.310261] i2c i2c-0: quirk: msg too long (addr 0x, size 4096, read)
 
 Reviewed-by: Ray Jui r...@broadcom.com
 Tested-by: Ray Jui r...@broadcom.com

Thanks for testing, and especially describing your test! Much
appreciated.



signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC V2 03/12] i2c: at91: make use of the new infrastructure for quirks

2015-03-12 Thread Wolfram Sang

 You can add my 
 
 Acked-by and Tested-By: Ludovic Desroches ludovic.desroc...@atmel.com
 
 Tested on sama5d3, some problems with at24 eeprom on sama5d4 but it
 doesn't come from the i2c quirks patch series.

Thanks for testing! Are the eeprom problems something which needs fixing
upstream?



signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/2 v5] cpufreq: qoriq: Make the driver usable on all QorIQ platforms

2015-03-12 Thread Yuantian.Tang
From: Tang Yuantian yuantian.t...@freescale.com

Freescale introduced new ARM core-based SoCs which support dynamic
frequency switch feature. DFS on new SoCs are compatible with current
PowerPC CoreNet platforms. In order to support those new platforms,
this driver needs to be updated. The main changes include:

1. Changed the names of functions in driver.
2. Added two new functions get_cpu_physical_id() and get_bus_freq().
3. Used a new way to get the CPU mask which share clock wire.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
Acked-by: Viresh Kumar viresh.ku...@linaro.org
---
v5:
- rebased to 4.0.-rc3
- put Kconfig and Makefile entry to the following rename patch
v4:
- resolve unmet direct dependencies warning
v3:
- put the menu entries into Kconfig
v2:
- split the name change into a separete patch
- use policy-driver_data instead of per_cpu variable

 drivers/cpufreq/ppc-corenet-cpufreq.c | 161 +-
 1 file changed, 99 insertions(+), 62 deletions(-)

diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c 
b/drivers/cpufreq/ppc-corenet-cpufreq.c
index 7cb4b76..9fd51c8 100644
--- a/drivers/cpufreq/ppc-corenet-cpufreq.c
+++ b/drivers/cpufreq/ppc-corenet-cpufreq.c
@@ -1,7 +1,7 @@
 /*
  * Copyright 2013 Freescale Semiconductor, Inc.
  *
- * CPU Frequency Scaling driver for Freescale PowerPC corenet SoCs.
+ * CPU Frequency Scaling driver for Freescale QorIQ SoCs.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -20,12 +20,11 @@
 #include linux/of.h
 #include linux/slab.h
 #include linux/smp.h
-#include sysdev/fsl_soc.h
 
 #include asm/smp.h   /* for get_hard_smp_processor_id() in UP configs */
 
 /**
- * struct cpu_data - per CPU data struct
+ * struct cpu_data
  * @parent: the parent node of cpu clock
  * @table: frequency table
  */
@@ -69,17 +68,78 @@ static const struct soc_data sdata[] = {
 static u32 min_cpufreq;
 static const u32 *fmask;
 
-static DEFINE_PER_CPU(struct cpu_data *, cpu_data);
+#if defined(CONFIG_ARM)
+static int get_cpu_physical_id(int cpu)
+{
+   return topology_core_id(cpu);
+}
+#else
+static int get_cpu_physical_id(int cpu)
+{
+   return get_hard_smp_processor_id(cpu);
+}
+#endif
+
+static u32 get_bus_freq(void)
+{
+   struct device_node *soc;
+   u32 sysfreq;
+
+   soc = of_find_node_by_type(NULL, soc);
+   if (!soc)
+   return 0;
+
+   if (of_property_read_u32(soc, bus-frequency, sysfreq))
+   sysfreq = 0;
+
+   of_node_put(soc);
 
-/* cpumask in a cluster */
-static DEFINE_PER_CPU(cpumask_var_t, cpu_mask);
+   return sysfreq;
+}
 
-#ifndef CONFIG_SMP
-static inline const struct cpumask *cpu_core_mask(int cpu)
+static struct device_node *cpu_to_clk_node(int cpu)
 {
-   return cpumask_of(0);
+   struct device_node *np, *clk_np;
+
+   if (!cpu_present(cpu))
+   return NULL;
+
+   np = of_get_cpu_node(cpu, NULL);
+   if (!np)
+   return NULL;
+
+   clk_np = of_parse_phandle(np, clocks, 0);
+   if (!clk_np)
+   return NULL;
+
+   of_node_put(np);
+
+   return clk_np;
+}
+
+/* traverse cpu nodes to get cpu mask of sharing clock wire */
+static void set_affected_cpus(struct cpufreq_policy *policy)
+{
+   struct device_node *np, *clk_np;
+   struct cpumask *dstp = policy-cpus;
+   int i;
+
+   np = cpu_to_clk_node(policy-cpu);
+   if (!np)
+   return;
+
+   for_each_present_cpu(i) {
+   clk_np = cpu_to_clk_node(i);
+   if (!clk_np)
+   continue;
+
+   if (clk_np == np)
+   cpumask_set_cpu(i, dstp);
+
+   of_node_put(clk_np);
+   }
+   of_node_put(np);
 }
-#endif
 
 /* reduce the duplicated frequencies in frequency table */
 static void freq_table_redup(struct cpufreq_frequency_table *freq_table,
@@ -107,6 +167,7 @@ static void freq_table_sort(struct cpufreq_frequency_table 
*freq_table,
int i, j, ind;
unsigned int freq, max_freq;
struct cpufreq_frequency_table table;
+
for (i = 0; i  count - 1; i++) {
max_freq = freq_table[i].frequency;
ind = i;
@@ -131,7 +192,7 @@ static void freq_table_sort(struct cpufreq_frequency_table 
*freq_table,
}
 }
 
-static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
+static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
struct device_node *np;
int i, count, ret;
@@ -147,10 +208,8 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy 
*policy)
return -ENODEV;
 
data = kzalloc(sizeof(*data), GFP_KERNEL);
-   if (!data) {
-   pr_err(%s: no memory\n, __func__);
+   if (!data)
goto err_np;
-   }
 
policy-clk = of_clk_get(np, 

[PATCH 2/2 v5] cpufreq: qoriq: rename the driver

2015-03-12 Thread Yuantian.Tang
From: Tang Yuantian yuantian.t...@freescale.com

This driver works on all QorIQ platforms which include
ARM-based cores and PPC-based cores.
Rename it in order to represent better.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
Acked-by: Viresh Kumar viresh.ku...@linaro.org
---
v5:
- rebased to 4.0-rc3
- added Kconfig and Makefile entry
v3, v4
- none
v2:
- use -C -M options when format-patch

 drivers/cpufreq/Kconfig| 8 
 drivers/cpufreq/Kconfig.powerpc| 9 -
 drivers/cpufreq/Makefile   | 2 +-
 drivers/cpufreq/{ppc-corenet-cpufreq.c = qoriq-cpufreq.c} | 0
 4 files changed, 9 insertions(+), 10 deletions(-)
 rename drivers/cpufreq/{ppc-corenet-cpufreq.c = qoriq-cpufreq.c} (100%)

diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index a171fef..659879a 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -293,5 +293,13 @@ config SH_CPU_FREQ
  If unsure, say N.
 endif
 
+config QORIQ_CPUFREQ
+   tristate CPU frequency scaling driver for Freescale QorIQ SoCs
+   depends on OF  COMMON_CLK  (PPC_E500MC || ARM)
+   select CLK_QORIQ
+   help
+ This adds the CPUFreq driver support for Freescale QorIQ SoCs
+ which are capable of changing the CPU's frequency dynamically.
+
 endif
 endmenu
diff --git a/drivers/cpufreq/Kconfig.powerpc b/drivers/cpufreq/Kconfig.powerpc
index 7ea2441..3a0595b 100644
--- a/drivers/cpufreq/Kconfig.powerpc
+++ b/drivers/cpufreq/Kconfig.powerpc
@@ -23,15 +23,6 @@ config CPU_FREQ_MAPLE
  This adds support for frequency switching on Maple 970FX
  Evaluation Board and compatible boards (IBM JS2x blades).
 
-config PPC_CORENET_CPUFREQ
-   tristate CPU frequency scaling driver for Freescale E500MC SoCs
-   depends on PPC_E500MC  OF  COMMON_CLK
-   select CLK_QORIQ
-   help
- This adds the CPUFreq driver support for Freescale e500mc,
- e5500 and e6500 series SoCs which are capable of changing
- the CPU's frequency dynamically.
-
 config CPU_FREQ_PMAC
bool Support for Apple PowerBooks
depends on ADB_PMU  PPC32
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 82a1821..26df0ad 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -85,7 +85,7 @@ obj-$(CONFIG_CPU_FREQ_CBE)+= ppc-cbe-cpufreq.o
 ppc-cbe-cpufreq-y  += ppc_cbe_cpufreq_pervasive.o 
ppc_cbe_cpufreq.o
 obj-$(CONFIG_CPU_FREQ_CBE_PMI) += ppc_cbe_cpufreq_pmi.o
 obj-$(CONFIG_CPU_FREQ_MAPLE)   += maple-cpufreq.o
-obj-$(CONFIG_PPC_CORENET_CPUFREQ)   += ppc-corenet-cpufreq.o
+obj-$(CONFIG_QORIQ_CPUFREQ)+= qoriq-cpufreq.o
 obj-$(CONFIG_CPU_FREQ_PMAC)+= pmac32-cpufreq.o
 obj-$(CONFIG_CPU_FREQ_PMAC64)  += pmac64-cpufreq.o
 obj-$(CONFIG_PPC_PASEMI_CPUFREQ)   += pasemi-cpufreq.o
diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c 
b/drivers/cpufreq/qoriq-cpufreq.c
similarity index 100%
rename from drivers/cpufreq/ppc-corenet-cpufreq.c
rename to drivers/cpufreq/qoriq-cpufreq.c
-- 
2.1.0.27.g96db324

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCHv2] powerpc: comvert relocs_check to a shell script using grep

2015-03-12 Thread Stephen Rothwell
This runs a bit faster and removes another use of perl from
the kernel build.

Signed-off-by: Stephen Rothwell s...@canb.auug.org.au
---

v2: address ShellCheck comments from Michael

 arch/powerpc/Makefile|  4 +--
 arch/powerpc/relocs_check.pl | 66 
 arch/powerpc/relocs_check.sh | 59 +++
 3 files changed, 61 insertions(+), 68 deletions(-)
 delete mode 100755 arch/powerpc/relocs_check.pl
 create mode 100755 arch/powerpc/relocs_check.sh

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 132d9c681d6a..1e868023b2c3 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -248,10 +248,10 @@ boot := arch/$(ARCH)/boot
 
 ifeq ($(CONFIG_RELOCATABLE),y)
 quiet_cmd_relocs_check = CALL$
-  cmd_relocs_check = perl $ $(OBJDUMP) $(obj)/vmlinux
+  cmd_relocs_check = $(CONFIG_SHELL) $ $(OBJDUMP) $(obj)/vmlinux
 
 PHONY += relocs_check
-relocs_check: arch/powerpc/relocs_check.pl vmlinux
+relocs_check: arch/powerpc/relocs_check.sh vmlinux
$(call cmd,relocs_check)
 
 zImage: relocs_check
diff --git a/arch/powerpc/relocs_check.pl b/arch/powerpc/relocs_check.pl
deleted file mode 100755
index 3f46e8b9c56d..
--- a/arch/powerpc/relocs_check.pl
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright © 2009 IBM Corporation
-
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version
-# 2 of the License, or (at your option) any later version.
-
-# This script checks the relocations of a vmlinux for suspicious
-# relocations.
-
-use strict;
-use warnings;
-
-if ($#ARGV != 1) {
-   die $0 [path to objdump] [path to vmlinux]\n;
-}
-
-# Have Kbuild supply the path to objdump so we handle cross compilation.
-my $objdump = shift;
-my $vmlinux = shift;
-my $bad_relocs_count = 0;
-my $bad_relocs = ;
-my $old_binutils = 0;
-
-open(FD, $objdump -R $vmlinux|) or die;
-while (FD) {
-   study $_;
-
-   # Only look at relocation lines.
-   next if (!/\s+R_/);
-
-   # These relocations are okay
-   # On PPC64:
-   #   R_PPC64_RELATIVE, R_PPC64_NONE, R_PPC64_ADDR64
-   # On PPC:
-   #   R_PPC_RELATIVE, R_PPC_ADDR16_HI, 
-   #   R_PPC_ADDR16_HA,R_PPC_ADDR16_LO,
-   #   R_PPC_NONE
-
-   next if (/\bR_PPC64_RELATIVE\b/ or /\bR_PPC64_NONE\b/ or
-/\bR_PPC64_ADDR64\s+mach_/);
-   next if (/\bR_PPC_ADDR16_LO\b/ or /\bR_PPC_ADDR16_HI\b/ or
-/\bR_PPC_ADDR16_HA\b/ or /\bR_PPC_RELATIVE\b/ or
-/\bR_PPC_NONE\b/);
-
-   # If we see this type of relocation it's an idication that
-   # we /may/ be using an old version of binutils.
-   if (/R_PPC64_UADDR64/) {
-   $old_binutils++;
-   }
-
-   $bad_relocs_count++;
-   $bad_relocs .= $_;
-}
-
-if ($bad_relocs_count) {
-   print WARNING: $bad_relocs_count bad relocations\n;
-   print $bad_relocs;
-}
-
-if ($old_binutils) {
-   print WARNING: You need at least binutils = 2.19 to build a .
- CONFIG_RELOCATABLE kernel\n;
-}
diff --git a/arch/powerpc/relocs_check.sh b/arch/powerpc/relocs_check.sh
new file mode 100755
index ..182eae9cc40d
--- /dev/null
+++ b/arch/powerpc/relocs_check.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Copyright © 2015 IBM Corporation
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+
+# This script checks the relocations of a vmlinux for suspicious
+# relocations.
+
+# based on relocs_check.pl
+# Copyright © 2009 IBM Corporation
+
+if [ ${#*} -lt 2 ]; then
+   echo $0 [path to objdump] [path to vmlinux] 12
+   exit 1
+fi
+
+# Have Kbuild supply the path to objdump so we handle cross compilation.
+objdump=$1
+vmlinux=$2
+
+bad_relocs=$(
+$objdump -R $vmlinux |
+   # Only look at relocation lines.
+   grep -E '\R_' |
+   # These relocations are okay
+   # On PPC64:
+   #   R_PPC64_RELATIVE, R_PPC64_NONE
+   #   R_PPC64_ADDR64 mach_name
+   # On PPC:
+   #   R_PPC_RELATIVE, R_PPC_ADDR16_HI,
+   #   R_PPC_ADDR16_HA,R_PPC_ADDR16_LO,
+   #   R_PPC_NONE
+   grep -F -w -v 'R_PPC64_RELATIVE
+R_PPC64_NONE
+R_PPC_ADDR16_LO
+R_PPC_ADDR16_HI
+R_PPC_ADDR16_HA
+R_PPC_RELATIVE
+R_PPC_NONE' |
+   grep -E -v '\R_PPC64_ADDR64[[:space:]]+mach_'
+)
+
+if [ -z $bad_relocs ]; then
+   exit 0
+fi
+
+num_bad=$(echo $bad_relocs | wc -l)
+echo WARNING: $num_bad bad relocations
+echo $bad_relocs
+
+# If we see this type of relocation it's an idication that
+# we /may/ be using an old version of binutils.
+if echo $bad_relocs | grep -q -F -w R_PPC64_UADDR64; then
+   echo WARNING: You 

[PATCH 2/2] selftests/powerpc: Add a test of the switch_endian() syscall

2015-03-12 Thread Michael Ellerman
This adds a test of the switch_endian() syscall we added in the previous
commit.

We test it by calling the endian switch syscall, and then executing some
code in the other endian to check everything went as expected. That code
checks registers we expect to be maintained are, and then writes to
stdout and then does exit(0).

If the endian switch failed to happen that code sequence will be illegal
and cause the test to abort.

Signed-off-by: Michael Ellerman m...@ellerman.id.au
---
 tools/testing/selftests/powerpc/Makefile   |   2 +-
 tools/testing/selftests/powerpc/syscalls/Makefile  |  15 ++
 .../selftests/powerpc/syscalls/endian-test.S   | 247 +
 3 files changed, 263 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/powerpc/syscalls/Makefile
 create mode 100644 tools/testing/selftests/powerpc/syscalls/endian-test.S

diff --git a/tools/testing/selftests/powerpc/Makefile 
b/tools/testing/selftests/powerpc/Makefile
index 1d5e7ad2c460..5da93b7d1330 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -13,7 +13,7 @@ CFLAGS := -Wall -O2 -flto -Wall -Werror 
-DGIT_VERSION='$(GIT_VERSION)' -I$(CUR
 
 export CC CFLAGS
 
-TARGETS = pmu copyloops mm tm primitives stringloops
+TARGETS = pmu copyloops mm tm primitives stringloops syscalls
 
 endif
 
diff --git a/tools/testing/selftests/powerpc/syscalls/Makefile 
b/tools/testing/selftests/powerpc/syscalls/Makefile
new file mode 100644
index ..b74201fa4f15
--- /dev/null
+++ b/tools/testing/selftests/powerpc/syscalls/Makefile
@@ -0,0 +1,15 @@
+PROGS := endian-test
+
+endian-test: ASFLAGS += -O2 -Wall -g -nostdlib -m64
+
+all: $(PROGS)
+
+run_tests: all
+   @-for PROG in $(PROGS); do \
+   ./$$PROG; \
+   done;
+
+clean:
+   rm -f $(PROGS)
+
+.PHONY: all run_tests clean
diff --git a/tools/testing/selftests/powerpc/syscalls/endian-test.S 
b/tools/testing/selftests/powerpc/syscalls/endian-test.S
new file mode 100644
index ..0beca323247a
--- /dev/null
+++ b/tools/testing/selftests/powerpc/syscalls/endian-test.S
@@ -0,0 +1,247 @@
+#include ppc-asm.h
+#include asm/unistd.h
+
+#ifndef __NR_switch_endian
+#define __NR_switch_endian 363
+#endif
+
+   .data
+   .balign 8
+message:
+   .ascii success: endian-test\n
+
+   .section .toc
+   .balign 8
+pattern:
+   .llong 0x
+
+   .text
+FUNC_START(_start)
+   /* Load some addresses to start with */
+   ld  r14, message@got(%r2)
+   ld  r15, pattern@toc(%r2)
+
+   /* Setup CR, only CR2-CR4 are maintained */
+   lis r3, 0x00FF
+   ori r3, r3, 0xF000
+   mtcrr3
+
+   /* Load the pattern slightly modified into the registers */
+   mr  r3, r15
+   addir4, r15, 4
+
+   addir5, r15, 32
+   mtlrr5
+
+   addir5, r15, 5
+   addir6, r15, 6
+   addir7, r15, 7
+   addir8, r15, 8
+
+   /* r9 - r12 are clobbered */
+
+   addir13, r15, 13
+
+   /* Skip r14  r15 we're using them */
+
+   addir16, r15, 16
+   addir17, r15, 17
+   addir18, r15, 18
+   addir19, r15, 19
+   addir20, r15, 20
+   addir21, r15, 21
+   addir22, r15, 22
+   addir23, r15, 23
+   addir24, r15, 24
+   addir25, r15, 25
+   addir26, r15, 26
+   addir27, r15, 27
+   addir28, r15, 28
+   addir29, r15, 29
+   addir30, r15, 30
+   addir31, r15, 31
+
+   /*
+* Call the syscall to switch endian.
+* It clobbers r9-r12, XER, CTR and CR0-1,5-7.
+*/
+   li r0, __NR_switch_endian
+   sc
+
+   # cmpdr15,r3
+   .long 0x00182f7c
+   # bne 1f
+   .long 0x50018240
+   # addir3,r15,4
+   .long 0x04006f38
+   # cmpdr3,r4
+   .long 0x0020237c
+   # bne 1f
+   .long 0x44018240
+   # lis r3,0x00FF
+   .long 0xff00603c
+   # ori r3,r3,0xF000
+   .long 0x00f06360
+   # mfcrr4
+   .long 0x2600807c
+   # and r4,r4,r3
+   .long 0x3818847c
+   # cmpwr3,r4
+   .long 0x0020037c
+   # addir3,r15,34
+   .long 0x22006f38
+   # bne 1f
+   .long 0x28018240
+   # addir3,r15,32
+   .long 0x20006f38
+   # mflrr4
+   .long 0xa602887c
+   # cmpdr3,r4
+   .long 0x0020237c
+   # bne 1f
+   .long 0x18018240
+   # addir3,r15,5
+   .long 0x05006f38
+   # cmpdr3,r5
+   .long 0x0028237c
+   # bne 1f
+   .long 0x0c018240
+   # addir3,r15,6
+   .long 0x06006f38
+   # cmpdr3,r6
+   .long 0x0030237c
+   # bne 1f
+   .long 0x00018240
+   # addir3,r15,7
+   .long 0x07006f38
+   # cmpdr3,r7
+   .long 0x0038237c
+   # bne 1f
+   .long 0xf4008240
+   

[PATCH 1/2] powerpc: Add a proper syscall for switching endianness

2015-03-12 Thread Michael Ellerman
We currently have a special syscall for switching endianness. This is
syscall number 0x1ebe, which is handled explicitly in the 64-bit syscall
exception entry.

That has a few problems, firstly the syscall number is outside of the
usual range, which confuses various tools. For example strace doesn't
recognise the syscall at all.

Secondly it's handled explicitly as a special case in the syscall
exception entry, which is complicated enough without it.

As a first step toward removing the special syscall, we need to add a
regular syscall that implements the same functionality.

The logic is simple, it simply toggles the MSR_LE bit in the userspace
MSR. This is the same as the special syscall, with the caveat that the
special syscall clobbers fewer registers.

This version clobbers r9-r12, XER, CTR, and CR0-1,5-7.

Signed-off-by: Michael Ellerman m...@ellerman.id.au

fixup
---
 arch/powerpc/include/asm/systbl.h  |  1 +
 arch/powerpc/include/asm/unistd.h  |  2 +-
 arch/powerpc/include/uapi/asm/unistd.h |  1 +
 arch/powerpc/kernel/entry_64.S |  5 +
 arch/powerpc/kernel/syscalls.c | 17 +
 5 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/systbl.h 
b/arch/powerpc/include/asm/systbl.h
index 91062eef582f..c3ee21a1d9cf 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -367,3 +367,4 @@ SYSCALL_SPU(getrandom)
 SYSCALL_SPU(memfd_create)
 SYSCALL_SPU(bpf)
 COMPAT_SYS(execveat)
+PPC_SYS(switch_endian)
diff --git a/arch/powerpc/include/asm/unistd.h 
b/arch/powerpc/include/asm/unistd.h
index 36b79c31eedd..f4f8b667d75b 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -12,7 +12,7 @@
 #include uapi/asm/unistd.h
 
 
-#define __NR_syscalls  363
+#define __NR_syscalls  364
 
 #define __NR__exit __NR_exit
 #define NR_syscalls__NR_syscalls
diff --git a/arch/powerpc/include/uapi/asm/unistd.h 
b/arch/powerpc/include/uapi/asm/unistd.h
index ef5b5b1f3123..e4aa173dae62 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -385,5 +385,6 @@
 #define __NR_memfd_create  360
 #define __NR_bpf   361
 #define __NR_execveat  362
+#define __NR_switch_endian 363
 
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index d180caf2d6de..afbc20019c2e 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -356,6 +356,11 @@ _GLOBAL(ppc64_swapcontext)
bl  sys_swapcontext
b   .Lsyscall_exit
 
+_GLOBAL(ppc_switch_endian)
+   bl  save_nvgprs
+   bl  sys_switch_endian
+   b   .Lsyscall_exit
+
 _GLOBAL(ret_from_fork)
bl  schedule_tail
REST_NVGPRS(r1)
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index b2702e87db0d..5fa92706444b 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -121,3 +121,20 @@ long ppc_fadvise64_64(int fd, int advice, u32 offset_high, 
u32 offset_low,
return sys_fadvise64(fd, (u64)offset_high  32 | offset_low,
 (u64)len_high  32 | len_low, advice);
 }
+
+long sys_switch_endian(void)
+{
+   struct thread_info *ti;
+
+   current-thread.regs-msr ^= MSR_LE;
+
+   /*
+* Set TIF_RESTOREALL so that r3 isn't clobbered on return to
+* userspace. That also has the effect of restoring the non-volatile
+* GPRs, so we saved them on the way in here.
+*/
+   ti = current_thread_info();
+   ti-flags |= _TIF_RESTOREALL;
+
+   return 0;
+}
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv2 2/8] perf probe: Improve detection of file/function name in the probe pattern

2015-03-12 Thread Ananth N Mavinakayanahalli
On Thu, Mar 12, 2015 at 05:24:14PM -0300, Arnaldo Carvalho de Melo wrote:
 Em Mon, Dec 15, 2014 at 08:20:32PM +0530, Naveen N. Rao escreveu:
  Currently, perf probe considers patterns including a '.' to be a file.
  However, this causes problems on powerpc ABIv1 where all functions have
  a leading '.':
  
$ perf probe -F | grep schedule_timeout_interruptible
.schedule_timeout_interruptible
$ perf probe .schedule_timeout_interruptible
Semantic error :File always requires line number or lazy pattern.
  Error: Command Parse Error.
  
  Fix this by checking the probe pattern in more detail.
 
 Masami, can I have your Acked-by or Reviewed-by?

Arnaldo,

FWIW, I have reviewed this code...

Reviewed-by: Ananth N Mavinakayanahalli ana...@in.ibm.com

 
 
 - Arnaldo
 
  Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com
  ---
   tools/perf/util/probe-event.c | 23 ---
   1 file changed, 20 insertions(+), 3 deletions(-)
  
  diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
  index 28eb141..9943ff3 100644
  --- a/tools/perf/util/probe-event.c
  +++ b/tools/perf/util/probe-event.c
  @@ -999,6 +999,24 @@ static int parse_perf_probe_point(char *arg, struct 
  perf_probe_event *pev)
  arg = tmp;
  }
   
  +   /*
  +* Check arg is function or file name and copy it.
  +*
  +* We consider arg to be a file spec if and only if it satisfies
  +* all of the below criteria::
  +* - it does not include any of +@%,
  +* - it includes one of :;, and
  +* - it has a period '.' in the name.
  +*
  +* Otherwise, we consider arg to be a function specification.
  +*/
  +   c = 0;
  +   if (!strpbrk(arg, +@%)  (ptr = strpbrk(arg, ;:)) != NULL) {
  +   /* This is a file spec if it includes a '.' before ; or : */
  +   if (memchr(arg, '.', ptr-arg))
  +   c = 1;
  +   }
  +
  ptr = strpbrk(arg, ;:+@%);
  if (ptr) {
  nc = *ptr;
  @@ -1009,10 +1027,9 @@ static int parse_perf_probe_point(char *arg, struct 
  perf_probe_event *pev)
  if (tmp == NULL)
  return -ENOMEM;
   
  -   /* Check arg is function or file and copy it */
  -   if (strchr(tmp, '.'))   /* File */
  +   if (c == 1)
  pp-file = tmp;
  -   else/* Function */
  +   else
  pp-function = tmp;
   
  /* Parse other options */
  -- 
  2.1.3

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC] powerpc: use ticket spin lock for !CONFIG_PPC_SPLPAR

2015-03-12 Thread Torsten Duwe
On Thu, Mar 12, 2015 at 10:13:27PM +1100, Benjamin Herrenschmidt wrote:
 On Thu, 2015-03-12 at 18:55 +0800, Kevin Hao wrote:
  I know Torsten Duwe has tried to add the ticket spinlock for powerpc
  one year ago [1]. But it make no progress due to the conflict between

OMG, time flies.

  PPC_SPLPAR and lockref. We still don't find a better way to handle
  this. But instead of waiting forever for a perfect solution, can't we
  just use the ticket spinlock for the !CONFIG_PPC_SPLPAR?

I was actually thinking about squeezing it all (incl. lockref) into 64 bits,
or making it a bit larger, keeping the holder outside the cache line, or ...
Then priorities shifted.

 I would do the ifdef'ing differently, something like
 
 CONFIG_PPC_HAS_LOCK_OWNER
 
 CONFIG_PPC_TICKET_LOCKS depends on !PPC_HAS_LOCK_OWNER
 
 and use these two in the code... with SPLPAR select'ing HAS_LOCK_OWNER

Or avoid ifdef'ing and give pseries its own, platform-specific lock 
implementation?
It's more work in the build framework but clearer in the C source. Just a 
though.

But generally, which platforms would benefit most from this change?
I must admit my access to hardware variety is somewhat limited ;-)

Torsten

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 5/8] tty: cpm_uart: replace CONFIG_8xx by CONFIG_CPM1

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 drivers/tty/serial/Kconfig | 2 +-
 drivers/tty/serial/cpm_uart/Makefile   | 2 +-
 drivers/tty/serial/cpm_uart/cpm_uart.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index c9dbc62..6086586 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -868,7 +868,7 @@ config SERIAL_PMACZILOG_CONSOLE
 
 config SERIAL_CPM
tristate CPM SCC/SMC serial port support
-   depends on CPM2 || 8xx
+   depends on CPM2 || CPM1
select SERIAL_CORE
help
  This driver supports the SCC and SMC serial ports on Motorola 
diff --git a/drivers/tty/serial/cpm_uart/Makefile 
b/drivers/tty/serial/cpm_uart/Makefile
index e072724..896a5d5 100644
--- a/drivers/tty/serial/cpm_uart/Makefile
+++ b/drivers/tty/serial/cpm_uart/Makefile
@@ -6,6 +6,6 @@ obj-$(CONFIG_SERIAL_CPM) += cpm_uart.o
 
 # Select the correct platform objects.
 cpm_uart-objs-$(CONFIG_CPM2)   += cpm_uart_cpm2.o
-cpm_uart-objs-$(CONFIG_8xx)+= cpm_uart_cpm1.o
+cpm_uart-objs-$(CONFIG_CPM1)   += cpm_uart_cpm1.o
 
 cpm_uart-objs  := cpm_uart_core.o $(cpm_uart-objs-y)
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h 
b/drivers/tty/serial/cpm_uart/cpm_uart.h
index cf34d26..0ad027b 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart.h
+++ b/drivers/tty/serial/cpm_uart/cpm_uart.h
@@ -19,7 +19,7 @@
 
 #if defined(CONFIG_CPM2)
 #include cpm_uart_cpm2.h
-#elif defined(CONFIG_8xx)
+#elif defined(CONFIG_CPM1)
 #include cpm_uart_cpm1.h
 #endif
 
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/8] powerpc: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 arch/powerpc/Kconfig  | 10 +-
 arch/powerpc/Makefile |  2 +-
 arch/powerpc/boot/Makefile|  4 ++--
 arch/powerpc/boot/util.S  |  6 +++---
 arch/powerpc/include/asm/cache.h  |  2 +-
 arch/powerpc/include/asm/cputable.h   |  4 ++--
 arch/powerpc/include/asm/fs_pd.h  |  2 +-
 arch/powerpc/include/asm/pgtable-ppc32.h  |  2 +-
 arch/powerpc/include/asm/ppc_asm.h|  4 ++--
 arch/powerpc/include/asm/reg.h| 10 +-
 arch/powerpc/include/asm/timex.h  |  4 ++--
 arch/powerpc/kernel/Makefile  |  2 +-
 arch/powerpc/kernel/cputable.c|  4 ++--
 arch/powerpc/kernel/irq.c |  2 +-
 arch/powerpc/kernel/kgdb.c|  4 ++--
 arch/powerpc/kernel/misc_32.S |  4 ++--
 arch/powerpc/kernel/traps.c   |  6 +++---
 arch/powerpc/kernel/vdso32/gettimeofday.S |  2 +-
 arch/powerpc/mm/fault.c   |  4 ++--
 arch/powerpc/mm/init_32.c |  4 ++--
 arch/powerpc/mm/mem.c |  2 +-
 arch/powerpc/mm/mmu_decl.h| 12 ++--
 arch/powerpc/mm/tlb_nohash_low.S  |  2 +-
 arch/powerpc/platforms/8xx/Kconfig|  3 +--
 arch/powerpc/platforms/Kconfig.cputype|  2 +-
 arch/powerpc/sysdev/Makefile  |  2 +-
 arch/powerpc/sysdev/fsl_soc.c |  3 ++-
 arch/powerpc/sysdev/fsl_soc.h |  3 ++-
 arch/powerpc/xmon/xmon.c  |  2 +-
 29 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9b780e0..0ed5b4e 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -327,7 +327,7 @@ config HUGETLB_PAGE_SIZE_VARIABLE
 
 config MATH_EMULATION
bool Math emulation
-   depends on 4xx || 8xx || PPC_MPC832x || BOOKE
+   depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE
---help---
  Some PowerPC chips designed for embedded applications do not have
  a floating-point unit and therefore do not implement the
@@ -797,9 +797,9 @@ config PPC_PCI_CHOICE
 
 config PCI
bool PCI support if PPC_PCI_CHOICE
-   default y if !40x  !CPM2  !8xx  !PPC_83xx \
+   default y if !40x  !CPM2  !PPC_8xx  !PPC_83xx \
 !PPC_85xx  !PPC_86xx  !GAMECUBE_COMMON
-   default PCI_QSPAN if !4xx  !CPM2  8xx
+   default PCI_QSPAN if !4xx  !CPM2  PPC_8xx
select GENERIC_PCI_IOMAP
help
  Find out whether your system includes a PCI bus. PCI is the name of
@@ -815,7 +815,7 @@ config PCI_SYSCALL
 
 config PCI_QSPAN
bool QSpan PCI
-   depends on !4xx  !CPM2  8xx
+   depends on !4xx  !CPM2  PPC_8xx
select PPC_I8259
help
  Say Y here if you have a system based on a Motorola 8xx-series
@@ -1033,7 +1033,7 @@ config CONSISTENT_SIZE
 
 config PIN_TLB
bool Pinned Kernel TLBs (860 ONLY)
-   depends on ADVANCED_OPTIONS  8xx
+   depends on ADVANCED_OPTIONS  PPC_8xx
 endmenu
 
 if PPC64
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index fc502e0..bd6bd46 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -211,7 +211,7 @@ KBUILD_AFLAGS += $(cpu-as-y)
 KBUILD_CFLAGS += $(cpu-as-y)
 
 head-y := 
arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
-head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
+head-$(CONFIG_PPC_8xx) := arch/powerpc/kernel/head_8xx.o
 head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o
 head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o
 head-$(CONFIG_FSL_BOOKE)   := arch/powerpc/kernel/head_fsl_booke.o
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 8a5bc1c..99c2276 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -78,7 +78,7 @@ src-wlib-y := string.S crt0.S crtsavres.S stdio.c main.c \
uartlite.c mpc52xx-psc.c
 src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
 src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
-src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c
+src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c
 src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
 src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
 
@@ -95,7 +95,7 @@ src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c 
treeboot-bamboo.c \
  

RE: [PATCH 4/4 RFC] fsl/msi: Add interface to reserve/free msi bank

2015-03-12 Thread bharat.bhus...@freescale.com


 -Original Message-
 From: Wood Scott-B07421
 Sent: Thursday, March 12, 2015 5:48 AM
 To: Bhushan Bharat-R65777
 Cc: linuxppc-...@ozlabs.org
 Subject: Re: [PATCH 4/4 RFC] fsl/msi: Add interface to reserve/free msi
 bank
 
 On Tue, 2015-03-03 at 10:47 +0530, Bharat Bhushan wrote:
  This patch allows a context (different from kernel context) to reserve
  a MSI bank for itself. And then the devices in the context will share
  the MSI bank.
 
  VFIO meta driver is one of typical user of these APIs. It will reserve
  a MSI bank for MSI interrupt support of direct assignment PCI devices
  to a Guest. Patches for same will follow this patch.
 
  Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com
  ---
   arch/powerpc/include/asm/device.h  |   2 +
   arch/powerpc/include/asm/fsl_msi.h |  26 ++
   arch/powerpc/sysdev/fsl_msi.c  | 169
 +++--
   arch/powerpc/sysdev/fsl_msi.h  |   1 +
   4 files changed, 173 insertions(+), 25 deletions(-)  create mode
  100644 arch/powerpc/include/asm/fsl_msi.h
 
  diff --git a/arch/powerpc/include/asm/device.h
  b/arch/powerpc/include/asm/device.h
  index 38faede..1c2bfd7 100644
  --- a/arch/powerpc/include/asm/device.h
  +++ b/arch/powerpc/include/asm/device.h
  @@ -40,6 +40,8 @@ struct dev_archdata {  #ifdef CONFIG_FAIL_IOMMU
  int fail_iommu;
   #endif
  +
  +   void *context;
   };
 
 This needs a comment and probably a more specific name.

Ok

 
  @@ -200,6 +185,12 @@ static struct fsl_msi
  *fsl_msi_get_reserved_msi_bank(struct pci_dev *pdev)  {
  struct fsl_msi *msi_data = NULL;
  void *context = NULL;
  +   struct device *dev = pdev-dev;
  +
  +   /* Device assigned to userspace if there is valid context */
  +   if (dev-archdata.context) {
  +   context = dev-archdata.context;
  +   }
 
 No {}

Ok, leftover of print debugging :)

 
 
  list_for_each_entry(msi_data, msi_head, list) {
  if ((msi_data-reserved == MSI_RESERVED)  @@ -208,13
 +199,133 @@
  static struct fsl_msi *fsl_msi_get_reserved_msi_bank(struct pci_dev
 *pdev)
  }
 
  /* If no MSI bank allocated for kernel owned device, allocate one
 */
  -   msi_data = fsl_msi_allocate_msi_bank(NULL);
  -   if (msi_data)
  -   return msi_data;
  +   if (!context) {
  +   msi_data = fsl_msi_allocate_msi_bank(NULL);
  +   if (msi_data)
  +   return msi_data;
  +   }
 
  return NULL;
   }
 
  +/* API to set context to which the device belongs */ int
  +fsl_msi_set_msi_bank_in_dev(struct device *dev, void *data) {
  +   dev-archdata.context = data;
  +   return 0;
  +}
 
 Do we really need msi to appear twice in every function name?

No, will remove later msi.

 
  +
  +/*  This API Allows a MSI bank to be reserved for a context.
  + *  All devices in same context will share the allocated
  + *  MSI bank.
  + *  Typically this function will be called from meta
  + *  driver like VFIO with a valid context.
  + */
  +struct fsl_msi *fsl_msi_reserve_msi_bank(void *context) {
  +   struct fsl_msi *msi_data;
  +
  +   if (!context)
  +   return NULL;
  +
  +   /* Check if msi-bank already allocated for the context */
  +   list_for_each_entry(msi_data, msi_head, list) {
  +   if (msi_data-reserved == MSI_FREE)
  +   continue;
  +
  +   if (context == msi_data-context)
  +   return msi_data;
 
 The reserved == MSI_FREE check doesn't add anything because if it's free
 then the context check will fail.

ok

 
  +static int is_msi_bank_reserved(struct fsl_msi *msi)
 
 s/int/bool/

Ok

 
 
  +/*
  + * This function configures PAMU window for MSI page with
  + * given iova. Also same iova will be used as msi-address
  + * when configuring msi-message in the devices using this
  + * msi bank.
  + */
  +int fsl_msi_set_msi_bank_region(struct iommu_domain *domain,
  +   void *context , int win,
 
 Whitespace
 
  @@ -225,12 +336,17 @@ static void fsl_compose_msi_msg(struct pci_dev
 *pdev, int hwirq,
  int len;
  const __be64 *reg;
 
  -   /* If the msi-address-64 property exists, then use it */
  -   reg = of_get_property(hose-dn, msi-address-64, len);
  -   if (reg  (len == sizeof(u64)))
  -   address = be64_to_cpup(reg);
  -   else
  -   address = msi_data-msiir;
  +   if (pdev-dev.archdata.context) {
  +   address = msi_data-iova;
  +   } else {
  +   /* If the msi-address-64 property exists, then use it */
  +   reg = of_get_property(hose-dn, msi-address-64, len);
  +   if (reg  (len == sizeof(u64)))
  +   address = be64_to_cpup(reg);
  +   else
  +   address = fsl_pci_immrbar_base(hose) +
  +   (msi_data-msiir  0xf);
  +   }
 
 You removed the call to fsl_pci_immrbar_base in patch 1/4 and are
 reintroducing it here.  If this call is needed, how does it work in
 between those two 

[PATCH 2/8] um: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 arch/um/sys-ppc/misc.S | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/um/sys-ppc/misc.S b/arch/um/sys-ppc/misc.S
index 1364b7d..163e0b2 100644
--- a/arch/um/sys-ppc/misc.S
+++ b/arch/um/sys-ppc/misc.S
@@ -18,7 +18,7 @@
 #include asm/processor.h
 #include ppc_asm.h
 
-#if defined(CONFIG_4xx) || defined(CONFIG_8xx)
+#if defined(CONFIG_4xx) || defined(CONFIG_PPC_8xx)
 #define CACHE_LINE_SIZE16
 #define LG_CACHE_LINE_SIZE 4
 #define MAX_COPY_PREFETCH  1
@@ -26,7 +26,7 @@
 #define CACHE_LINE_SIZE32
 #define LG_CACHE_LINE_SIZE 5
 #define MAX_COPY_PREFETCH  4
-#endif /* CONFIG_4xx || CONFIG_8xx */
+#endif /* CONFIG_4xx || CONFIG_PPC_8xx */
 
.text
 
@@ -38,7 +38,7 @@
 _GLOBAL(clear_page)
li  r0,4096/CACHE_LINE_SIZE
mtctr   r0
-#ifdef CONFIG_8xx
+#ifdef CONFIG_PPC_8xx
li  r4, 0
 1: stw r4, 0(r3)
stw r4, 4(r3)
@@ -72,7 +72,7 @@ _GLOBAL(copy_page)
addir4,r4,-4
li  r5,4
 
-#ifndef CONFIG_8xx
+#ifndef CONFIG_PPC_8xx
 #if MAX_COPY_PREFETCH  1
li  r0,MAX_COPY_PREFETCH
li  r11,4
@@ -84,12 +84,12 @@ _GLOBAL(copy_page)
dcbtr5,r4
li  r11,CACHE_LINE_SIZE+4
 #endif /* MAX_COPY_PREFETCH */
-#endif /* CONFIG_8xx */
+#endif /* CONFIG_PPC_8xx */
 
li  r0,4096/CACHE_LINE_SIZE
mtctr   r0
 1:
-#ifndef CONFIG_8xx
+#ifndef CONFIG_PPC_8xx
dcbtr11,r4
dcbzr5,r3
 #endif
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/8] video: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 drivers/video/console/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index ba97efc..6ee84c3 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -6,7 +6,7 @@ menu Console display driver support
 
 config VGA_CONSOLE
bool VGA text console if EXPERT || !X86
-   depends on !4xx  !8xx  !SPARC  !M68K  !PARISC  !FRV  \
+   depends on !4xx  !PPC_8xx  !SPARC  !M68K  !PARISC  !FRV  \
!SUPERH  !BLACKFIN  !AVR32  !MN10300  !CRIS  \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) 
 \
!ARM64
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 7/8] isdn: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 drivers/isdn/hardware/mISDN/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/hardware/mISDN/Kconfig 
b/drivers/isdn/hardware/mISDN/Kconfig
index 09df54f..ad9deab 100644
--- a/drivers/isdn/hardware/mISDN/Kconfig
+++ b/drivers/isdn/hardware/mISDN/Kconfig
@@ -13,7 +13,7 @@ config MISDN_HFCPCI
 
 config MISDN_HFCMULTI
tristate Support for HFC multiport cards (HFC-4S/8S/E1)
-   depends on PCI || 8xx
+   depends on PCI || PPC_8xx
depends on MISDN
help
  Enable support for cards with Cologne Chip AG's HFC multiport
@@ -28,7 +28,7 @@ config MISDN_HFCMULTI_8xx
depends on MISDN
depends on MISDN_HFCMULTI
depends on 8xx
-   default 8xx
+   default PPC_8xx
help
  Enable support for the XHFC embedded solution from Speech Design.
 
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [PATCH 3/4 RFC] fsl/msi: Add MSI bank allocation for kernel owned devices

2015-03-12 Thread bharat.bhus...@freescale.com


 -Original Message-
 From: Wood Scott-B07421
 Sent: Thursday, March 12, 2015 4:53 AM
 To: Bhushan Bharat-R65777
 Cc: linuxppc-...@ozlabs.org
 Subject: Re: [PATCH 3/4 RFC] fsl/msi: Add MSI bank allocation for kernel
 owned devices
 
 On Tue, 2015-03-03 at 10:47 +0530, Bharat Bhushan wrote:
  With this patch a context can allocate a MSI bank and use the
  allocated MSI-bank for the devices in that context.
 
  kernel/host context is NULL, So all devices owned by kernel will
  share a MSI bank allocated with context = NULL.
 
  This patch is in direction to have separate MSI bank for kernel
  context and userspace/VM context. We do not want two software context
  (kernel and VMs) to share a MSI bank for safe/reliable interrupts with
  full isolation. Follow up patch will add interface to allocate a MSI
  bank for userspace/VM context.
 
  NOTE: This RFC patch allows only one MSI bank to be allocated for
  kernel context. Which seems to be sufficient to me. But if we see this
  is limiting some real usecase scanerio then this limitation can be
  removed
 
  One issue which still need to addressed is when to free kernel context
  allocated MSI bank? Say all MSI capable devices are assigned to
  VM/userspace then there is no need to have any MSI bank reserved for
  kernel context.
 
  Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com
  ---
   arch/powerpc/sysdev/fsl_msi.c | 88
  ++-
   arch/powerpc/sysdev/fsl_msi.h |  4 ++
   2 files changed, 83 insertions(+), 9 deletions(-)
 
  diff --git a/arch/powerpc/sysdev/fsl_msi.c
  b/arch/powerpc/sysdev/fsl_msi.c index 32ba1e3..027aeeb 100644
  --- a/arch/powerpc/sysdev/fsl_msi.c
  +++ b/arch/powerpc/sysdev/fsl_msi.c
  @@ -142,6 +142,79 @@ static void fsl_teardown_msi_irqs(struct pci_dev
 *pdev)
  return;
   }
 
  +/*
  + * Allocate a MSI Bank for the requested context.
  + * NULL context means that this request is to allocate
  + * MSI bank for kernel owned devices. And currently we
  + * assume that one MSI bank is sufficient for kernel.
  + */
  +static struct fsl_msi *fsl_msi_allocate_msi_bank(void *context) {
  +   struct fsl_msi *msi_data;
  +
  +   /* Kernel context (NULL) can reserve only one msi bank */
  +   if (!context) {
  +   list_for_each_entry(msi_data, msi_head, list) {
  +   if ((msi_data-reserved == MSI_RESERVED) 
  +   (msi_data-context == NULL))
  +   return NULL;
  +   }
 
 Unnecessary parentheses
 
 Is there any reason why the kernel bank needs to participate in this
 mechanism at all?  Set it aside at MSI driver init, and don't put it on
 the list.  I know you've previously said that you want to support configs
 where the kernel doesn't get any banks, but that can just be a boot
 option that tells the MSI code to not set aside a bank for the kernel.
 It would simplify the code.

I think we cannot completely remove the MSI bank from kernel practically. So I 
can make the kernel msi bank out of list.

 
 With the patchset as is, how would one indicate whether kernel devices
 should get a bank?

For kernel owned device, in fsl_setup_msi_irqs() we check if there is a 
reserved MSI bank, if not then reserve a msi bank. If reserve fails then 
setup_msi_irq() fails. I think there is no fallback to Legacy interrupt.

  Specifically, when the kernel does have an MSI-
 capable device but we'd prefer to use legacy interrupts to keep MSIs
 available to VFIO.

Do we want this?

 
  +   }
  +
  +   list_for_each_entry(msi_data, msi_head, list) {
  +   if (msi_data-reserved == MSI_FREE) {
  +   msi_data-reserved = MSI_RESERVED;
  +   msi_data-context = context;
  +   return msi_data;
  +   }
  +   }
 
 What prevents races from parallel callers?

Will add a lock.

 
  +/* FIXME: Assumption that host kernel will allocate only one MSI bank
  +*/
 
 It's not a FIXME if we think the limitation is not burdensome.

Ok

 
  + __attribute__ ((unused)) static int fsl_msi_free_msi_bank(void
  + *context)
 
 static int __maybe_unused fsl_msi_free_msi_bank(void *context)
 
 Why are you adding this function then removing it in the next patch?

Will fix this

 
  +   /* If no MSI bank allocated for kernel owned device, allocate one
 */
  +   msi_data = fsl_msi_allocate_msi_bank(NULL);
  +   if (msi_data)
  +   return msi_data;
  +
  +   return NULL;
 
 return fsl_msi_allocate_msi_bank(NULL);

Ok

 
 
  +}
  +
   static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
  struct msi_msg *msg,
  struct fsl_msi *fsl_msi_data)
  @@ -174,7 +247,7 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev,
 int nvec, int type)
  struct pci_controller *hose = pci_bus_to_host(pdev-bus);
  struct device_node *np;
  phandle phandle = 0;
  -   int rc, hwirq = -ENOMEM;
  +   int rc = -ENODEV, hwirq = -ENOMEM;
 
 

Re: [v2,00/11] Freescale DPAA FMan FLIB(s)

2015-03-12 Thread Kumar Gala

On Mar 11, 2015, at 12:03 AM, Igal.Liberman igal.liber...@freescale.com wrote:

 From: Igal Liberman igal.liber...@freescale.com
 
 The Freescale Data Path Acceleration Architecture (DPAA) is a set of
 hardware components on specific QorIQ multicore processors. This
 architecture provides the infrastructure to support simplified
 sharing of networking interfaces and accelerators by multiple CPU
 cores and the accelerators.
 
 One of the DPAA accelerators is the Frame Manager (FMan) which
 enables the Ethernet network interfaces.
 
 This patch presents the FMan Foundation Libraries (FLIB) headers.
 The FMan FLIB adds basic support for the DPAA FMan hardware register
 access.
 
 Igal Liberman (7):
  soc/fman: Add the FMan FLIB headers
  soc/fman: Add the FMan FLIB
  soc/fman: Add the FMan port FLIB
  soc/fman: Add the FMan MAC FLIB
  soc/fman: Add the FMan parser and KeyGen FLIB(s)
  soc/fman: Add the FMan RTC FLIB
  soc/fman: Add the FMan SP FLIB
 
 Madalin Bucur (4):
  soc/fman: Add the FMan port FLIB headers
  soc/fman: Add the FMan MAC FLIB headers
  soc/fman: Add the FMan parser and KeyGen FLIB headers
  soc/fman: Add the FMan RTC FLIB header
 
 drivers/soc/Kconfig|1 +
 drivers/soc/Makefile   |1 +
 drivers/soc/fsl/Kconfig|1 +
 drivers/soc/fsl/Makefile   |1 +
 drivers/soc/fsl/fman/Kconfig   |   35 +
 drivers/soc/fsl/fman/Makefile  |   11 +
 drivers/soc/fsl/fman/flib/common/general.h |   41 +
 drivers/soc/fsl/fman/flib/fman_common.h|   73 +
 drivers/soc/fsl/fman/flib/fsl_enet.h   |  275 
 drivers/soc/fsl/fman/flib/fsl_fman.h   |  802 ++
 drivers/soc/fsl/fman/flib/fsl_fman_dtsec.h | 1016 +
 drivers/soc/fsl/fman/flib/fsl_fman_dtsec_mii_acc.h |  103 ++
 drivers/soc/fsl/fman/flib/fsl_fman_kg.h|  505 +++
 drivers/soc/fsl/fman/flib/fsl_fman_memac.h |  494 +++
 drivers/soc/fsl/fman/flib/fsl_fman_memac_mii_acc.h |   76 +
 drivers/soc/fsl/fman/flib/fsl_fman_port.h  |  601 
 drivers/soc/fsl/fman/flib/fsl_fman_prs.h   |  106 ++
 drivers/soc/fsl/fman/flib/fsl_fman_rtc.h   |  414 ++
 drivers/soc/fsl/fman/flib/fsl_fman_sp.h|  132 ++
 drivers/soc/fsl/fman/flib/fsl_fman_tgec.h  |  483 ++
 drivers/soc/fsl/fman/fman.c| 1355 +
 drivers/soc/fsl/fman/mac/Makefile  |5 +
 drivers/soc/fsl/fman/mac/fman_crc32.c  |  116 ++
 drivers/soc/fsl/fman/mac/fman_crc32.h  |   39 +
 drivers/soc/fsl/fman/mac/fman_dtsec.c  |  838 +++
 drivers/soc/fsl/fman/mac/fman_dtsec_mii_acc.c  |  168 +++
 drivers/soc/fsl/fman/mac/fman_memac.c  |  510 +++
 drivers/soc/fsl/fman/mac/fman_memac_mii_acc.c  |  217 +++
 drivers/soc/fsl/fman/mac/fman_tgec.c   |  371 +
 drivers/soc/fsl/fman/pcd/Makefile  |3 +
 drivers/soc/fsl/fman/pcd/fman_kg.c |  849 +++
 drivers/soc/fsl/fman/pcd/fman_prs.c|  126 ++
 drivers/soc/fsl/fman/port/Makefile |3 +
 drivers/soc/fsl/fman/port/fman_port.c  | 1535 
 drivers/soc/fsl/fman/rtc/Makefile  |3 +
 drivers/soc/fsl/fman/rtc/fman_rtc.c|  353 +
 drivers/soc/fsl/fman/sp/Makefile   |3 +
 drivers/soc/fsl/fman/sp/fman_sp.c  |  203 +++
 38 files changed, 11868 insertions(+)
 create mode 100644 drivers/soc/fsl/Kconfig
 create mode 100644 drivers/soc/fsl/Makefile
 create mode 100644 drivers/soc/fsl/fman/Kconfig
 create mode 100644 drivers/soc/fsl/fman/Makefile
 create mode 100644 drivers/soc/fsl/fman/flib/common/general.h
 create mode 100644 drivers/soc/fsl/fman/flib/fman_common.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_enet.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_dtsec.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_dtsec_mii_acc.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_kg.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_memac.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_memac_mii_acc.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_port.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_prs.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_rtc.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_sp.h
 create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_tgec.h
 create mode 100644 drivers/soc/fsl/fman/fman.c
 create mode 100644 drivers/soc/fsl/fman/mac/Makefile
 create mode 100644 drivers/soc/fsl/fman/mac/fman_crc32.c
 create mode 100644 drivers/soc/fsl/fman/mac/fman_crc32.h
 create mode 100644 drivers/soc/fsl/fman/mac/fman_dtsec.c
 

Re: [PATCH 4/4] mm: numa: Slow PTE scan rate if migration failures occur

2015-03-12 Thread Linus Torvalds
On Thu, Mar 12, 2015 at 6:10 AM, Mel Gorman mgor...@suse.de wrote:

 I believe you're correct and it matches what was observed. I'm still
 travelling and wireless is dirt but managed to queue a test using pmd_dirty

Ok, thanks.

I'm not entirely happy with that change, and I suspect the whole
heuristic should be looked at much more (maybe it should also look at
whether it's executable, for example), but it's a step in the right
direction.

So I committed it and added a comment, and wrote a commit log about
it. I suspect any further work is post-4.0-release, unless somebody
comes up with something small and simple and obviously better.

 Linus
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 6/8] mtd: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 drivers/mtd/maps/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index ba801d2..e715ae9 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -242,7 +242,7 @@ config MTD_L440GX
 
 config MTD_CFI_FLAGADM
tristate CFI Flash device mapping on FlagaDM
-   depends on 8xx  MTD_CFI
+   depends on PPC_8xx  MTD_CFI
help
  Mapping for the Flaga digital module. If you don't have one, ignore
  this setting.
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 4/8] net: freescale: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 2 +-
 drivers/net/ethernet/freescale/fs_enet/mac-scc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c 
b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
index b34214e..0e02bb4 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
@@ -38,7 +38,7 @@
 #include asm/irq.h
 #include asm/uaccess.h
 
-#ifdef CONFIG_8xx
+#ifdef CONFIG_PPC_8xx
 #include asm/8xx_immap.h
 #include asm/pgtable.h
 #include asm/cpm1.h
diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c 
b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
index 7a184e8..eec8963 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
@@ -37,7 +37,7 @@
 #include asm/irq.h
 #include asm/uaccess.h
 
-#ifdef CONFIG_8xx
+#ifdef CONFIG_PPC_8xx
 #include asm/8xx_immap.h
 #include asm/pgtable.h
 #include asm/cpm1.h
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 0/8] powerpc/8xx: Getting rid of CONFIG_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Patchset is composed of the following patches:
[1/8] powerpc: replace CONFIG_8xx by CONFIG_PPC_8xx
[2/8] um: replace CONFIG_8xx by CONFIG_PPC_8xx
[3/8] video: replace CONFIG_8xx by CONFIG_PPC_8xx
[4/8] net: freescale: replace CONFIG_8xx by CONFIG_PPC_8xx
[5/8] tty: cpm_uart: replace CONFIG_8xx by CONFIG_CPM1
[6/8] mtd: replace CONFIG_8xx by CONFIG_PPC_8xx
[7/8] isdn: replace CONFIG_8xx by CONFIG_PPC_8xx
[8/8] powerpc: get rid of CONFIG_8xx

All but the last one are independant and can be applied in any
order. Only the 8th one requires the first 7 patches to be applied.

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 arch/powerpc/Kconfig | 10 +-
 arch/powerpc/Makefile|  2 +-
 arch/powerpc/boot/Makefile   |  4 ++--
 arch/powerpc/boot/util.S |  6 +++---
 arch/powerpc/include/asm/cache.h |  2 +-
 arch/powerpc/include/asm/cputable.h  |  4 ++--
 arch/powerpc/include/asm/fs_pd.h |  2 +-
 arch/powerpc/include/asm/pgtable-ppc32.h |  2 +-
 arch/powerpc/include/asm/ppc_asm.h   |  4 ++--
 arch/powerpc/include/asm/reg.h   | 10 +-
 arch/powerpc/include/asm/timex.h |  4 ++--
 arch/powerpc/kernel/Makefile |  2 +-
 arch/powerpc/kernel/cputable.c   |  4 ++--
 arch/powerpc/kernel/irq.c|  2 +-
 arch/powerpc/kernel/kgdb.c   |  4 ++--
 arch/powerpc/kernel/misc_32.S|  4 ++--
 arch/powerpc/kernel/traps.c  |  6 +++---
 arch/powerpc/kernel/vdso32/gettimeofday.S|  2 +-
 arch/powerpc/mm/fault.c  |  4 ++--
 arch/powerpc/mm/init_32.c|  4 ++--
 arch/powerpc/mm/mem.c|  2 +-
 arch/powerpc/mm/mmu_decl.h   | 12 ++--
 arch/powerpc/mm/tlb_nohash_low.S |  2 +-
 arch/powerpc/platforms/8xx/Kconfig   |  3 +--
 arch/powerpc/platforms/Kconfig.cputype   |  7 +--
 arch/powerpc/sysdev/Makefile |  2 +-
 arch/powerpc/sysdev/fsl_soc.c|  3 ++-
 arch/powerpc/sysdev/fsl_soc.h|  3 ++-
 arch/powerpc/xmon/xmon.c |  2 +-
 arch/um/sys-ppc/misc.S   | 12 ++--
 drivers/isdn/hardware/mISDN/Kconfig  |  4 ++--
 drivers/mtd/maps/Kconfig |  2 +-
 drivers/net/ethernet/freescale/fs_enet/mac-fec.c |  2 +-
 drivers/net/ethernet/freescale/fs_enet/mac-scc.c |  2 +-
 drivers/tty/serial/Kconfig   |  2 +-
 drivers/tty/serial/cpm_uart/Makefile |  2 +-
 drivers/tty/serial/cpm_uart/cpm_uart.h   |  2 +-
 drivers/video/console/Kconfig|  2 +-
 38 files changed, 72 insertions(+), 76 deletions(-)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 8/8] powerpc: get rid of CONFIG_8xx

2015-03-12 Thread Christophe Leroy
Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc

It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

---
 arch/powerpc/platforms/Kconfig.cputype | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/platforms/Kconfig.cputype 
b/arch/powerpc/platforms/Kconfig.cputype
index 6d481ff..beca3ce 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -32,7 +32,6 @@ config PPC_85xx
 config PPC_8xx
bool Freescale 8xx
select FSL_SOC
-   select 8xx
select PPC_LIB_RHEAP
 
 config 40x
@@ -157,10 +156,6 @@ config TUNE_CELL
  itself, so the resulting kernel will keep running on all other
  machines.
 
-# this is temp to handle compat with arch=ppc
-config 8xx
-   bool
-
 config E500
select FSL_EMB_PERFMON
select PPC_FSL_BOOK3E
-- 
2.1.0

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [v2,04/11] soc/fman: Add the FMan port FLIB

2015-03-12 Thread Kumar Gala

On Mar 11, 2015, at 12:04 AM, Igal.Liberman igal.liber...@freescale.com wrote:

 From: Igal Liberman igal.liber...@freescale.com

commit message?

 
 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 ---
 drivers/soc/fsl/fman/Kconfig  |   10 +
 drivers/soc/fsl/fman/Makefile |2 +
 drivers/soc/fsl/fman/port/Makefile|3 +
 drivers/soc/fsl/fman/port/fman_port.c | 1535 +
 4 files changed, 1550 insertions(+)
 create mode 100644 drivers/soc/fsl/fman/port/Makefile
 create mode 100644 drivers/soc/fsl/fman/port/fman_port.c

Should merge this with the header patch 3/11.

Docs for the “public” functions would be good.

- k

 
 diff --git a/drivers/soc/fsl/fman/Kconfig b/drivers/soc/fsl/fman/Kconfig
 index 6e8b0a6..b4c98ef 100644
 --- a/drivers/soc/fsl/fman/Kconfig
 +++ b/drivers/soc/fsl/fman/Kconfig
 @@ -5,3 +5,13 @@ menuconfig FSL_FMAN
   help
   Freescale Data-Path Acceleration Architecture Frame Manager
   (FMan) support
 +
 +if FSL_FMAN
 +
 +config FSL_FMAN_PORT
 + bool FMan port
 + default n
 + help
 + Freescale DPAA FMan port support
 +
 +endif# FSL_FMAN
 diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
 index e7a0575..437a325 100644
 --- a/drivers/soc/fsl/fman/Makefile
 +++ b/drivers/soc/fsl/fman/Makefile
 @@ -3,3 +3,5 @@ subdir-ccflags-$(CONFIG_FSL_FMAN) += 
 -I$(srctree)/drivers/soc/fsl/fman/flib
 obj-$(CONFIG_FSL_FMAN)+= fsl_fman.o
 
 fsl_fman-objs := fman.o
 +
 +obj-$(CONFIG_FSL_FMAN_PORT)  += port/
 diff --git a/drivers/soc/fsl/fman/port/Makefile 
 b/drivers/soc/fsl/fman/port/Makefile
 new file mode 100644
 index 000..0062fed
 --- /dev/null
 +++ b/drivers/soc/fsl/fman/port/Makefile
 @@ -0,0 +1,3 @@
 +obj-$(CONFIG_FSL_FMAN_PORT)  += fsl_fman_port.o
 +
 +fsl_fman_port-objs   := fman_port.o
 diff --git a/drivers/soc/fsl/fman/port/fman_port.c 
 b/drivers/soc/fsl/fman/port/fman_port.c
 new file mode 100644
 index 000..cc05dc0
 --- /dev/null
 +++ b/drivers/soc/fsl/fman/port/fman_port.c
 @@ -0,0 +1,1535 @@
 +/*
 + * Copyright 2008 - 2015 Freescale Semiconductor Inc.
 + *
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions are 
 met:
 + * * Redistributions of source code must retain the above copyright
 + *notice, this list of conditions and the following disclaimer.
 + * * Redistributions in binary form must reproduce the above copyright
 + *notice, this list of conditions and the following disclaimer in the
 + *documentation and/or other materials provided with the distribution.
 + * * Neither the name of Freescale Semiconductor nor the
 + *names of its contributors may be used to endorse or promote products
 + *derived from this software without specific prior written permission.
 + *
 + * ALTERNATIVELY, this software may be distributed under the terms of the
 + * GNU General Public License (GPL) as published by the Free Software
 + * Foundation, either version 2 of that License or (at your option) any
 + * later version.
 + *
 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
 SERVICES;
 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 AND
 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
 THIS
 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 + */
 +
 +#include common/general.h
 +
 +#include fman_common.h
 +#include fsl_fman_port.h
 +
 +/* problem Eyal: the following should not be here*/

??? Eyal ???

 +#define NIA_FM_CTL_AC_NO_IPACC_PRE_BMI_ENQ_FRAME 0x0028
 +
 +static uint32_t get_no_pcd_nia_bmi_ac_enc_frame(struct fman_port_cfg *cfg)
 +{
 + if (cfg-errata_A006675)
 + return NIA_ENG_FM_CTL |
 + NIA_FM_CTL_AC_NO_IPACC_PRE_BMI_ENQ_FRAME;
 + else
 + return NIA_ENG_BMI | NIA_BMI_AC_ENQ_FRAME;
 +}
 +
 

[snip]

 +int fman_port_add_congestion_grps(struct fman_port *port,
 +   uint32_t grps_map[FMAN_PORT_CG_MAP_NUM])

Passing an array this way is usually bad form.

 +{
 + int i;
 + uint32_t __iomem *grp_map_reg;
 + uint32_t tmp;
 + uint8_t max_grp_map_num;
 +
 + switch (port-type) {
 + case E_FMAN_PORT_TYPE_RX:
 + case E_FMAN_PORT_TYPE_RX_10G:
 + if (port-fm_rev_maj == 4)
 + max_grp_map_num = 1;
 

Re: [PATCH 7/8] isdn: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread Sergei Shtylyov

Hello.

On 03/12/2015 06:24 PM, Christophe Leroy wrote:


Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx
In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
communication co-processor



arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
# this is temp to handle compat with arch=ppc



It looks like not many places still have that old CONFIG_8xx used,
so it is likely to be a good time to get rid of it completely ?



Signed-off-by: Christophe Leroy christophe.le...@c-s.fr


[...]


diff --git a/drivers/isdn/hardware/mISDN/Kconfig 
b/drivers/isdn/hardware/mISDN/Kconfig
index 09df54f..ad9deab 100644
--- a/drivers/isdn/hardware/mISDN/Kconfig
+++ b/drivers/isdn/hardware/mISDN/Kconfig

[...]

@@ -28,7 +28,7 @@ config MISDN_HFCMULTI_8xx
depends on MISDN
depends on MISDN_HFCMULTI
depends on 8xx


   Eh, how about this one?


-   default 8xx
+   default PPC_8xx
help
  Enable support for the XHFC embedded solution from Speech Design.


WBR, Sergei

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv2 6/8] perf tools powerpc: Fix PPC64 ELF ABIv2 symbol decoding

2015-03-12 Thread Arnaldo Carvalho de Melo
Em Mon, Dec 15, 2014 at 08:20:36PM +0530, Naveen N. Rao escreveu:
 PPC64 ELF ABIv2 has a Global Entry Point (GEP) and a Local Entry Point
 (LEP). For purposes of probing, we need the LEP. Offset to the LEP is
 encoded in st_other.
 
 Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com
 Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com
 ---
 Changes from previous patchset:
 Simplified logic by adding dependancy on HAVE_ARCH_SYMBOL_HANDLING. Also
 generalized arch_elf_sym_decode() to be suitable for other architectures in
 future.
 
  tools/perf/arch/powerpc/util/sym-handling.c | 10 ++
  tools/perf/util/symbol-elf.c|  2 ++
  tools/perf/util/symbol.h|  6 ++
  3 files changed, 18 insertions(+)
 
 diff --git a/tools/perf/arch/powerpc/util/sym-handling.c 
 b/tools/perf/arch/powerpc/util/sym-handling.c
 index 0a77825..a27bfaf 100644
 --- a/tools/perf/arch/powerpc/util/sym-handling.c
 +++ b/tools/perf/arch/powerpc/util/sym-handling.c
 @@ -1,8 +1,10 @@
  /*
   * Special symbol handling for PowerPC:
   * - Handle dot symbols on ABIv1
 + * - Decode offset from Global entry point to Local entry point on ABIv2
   *
   * Copyright (C) 2014 Naveen N Rao, IBM Corporation.
 + * Copyright (C) 2014 Ananth N Mavinakayanahalli, IBM Corporation.
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
 @@ -26,3 +28,11 @@ int probe_function_filter(struct map *map __maybe_unused, 
 struct symbol *sym)
   }
   return 1;
  }
 +
 +inline void arch_elf_sym_decode(GElf_Sym *sym __maybe_unused)
 +{
 +#if defined(_CALL_ELF)  _CALL_ELF == 2
 + if (sym  sym-st_other)
 + sym-st_value += PPC64_LOCAL_ENTRY_OFFSET(sym-st_other);
 +#endif
 +}
 diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
 index 7ac4e4c..557b63b 100644
 --- a/tools/perf/util/symbol-elf.c
 +++ b/tools/perf/util/symbol-elf.c
 @@ -902,6 +902,8 @@ int dso__load_sym(struct dso *dso, struct map *map,
   (sym.st_value  1))
   --sym.st_value;
  
 + arch_elf_sym_decode(sym);
 +

arch_elf_sym_adjust()? 

But this is done the right way, i.e. provide a way for arches to do
adjustments specific to their ABIs, thanks!

- Arnaldo

   if (dso-kernel || kmodule) {
   char dso_name[PATH_MAX];
  
 diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
 index 9d602e9..9e03cdf 100644
 --- a/tools/perf/util/symbol.h
 +++ b/tools/perf/util/symbol.h
 @@ -294,4 +294,10 @@ int compare_proc_modules(const char *from, const char 
 *to);
  int setup_list(struct strlist **list, const char *list_str,
  const char *list_name);
  
 +#ifdef HAVE_ARCH_SYMBOL_HANDLING
 +extern void arch_elf_sym_decode(GElf_Sym *sym __maybe_unused);
 +#else
 +static inline void arch_elf_sym_decode(GElf_Sym *sym __maybe_unused) { }
 +#endif
 +
  #endif /* __PERF_SYMBOL */
 -- 
 2.1.3
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv2 8/8] perf probe powerpc: Fixup function entry if using kallsyms lookup

2015-03-12 Thread Arnaldo Carvalho de Melo
Em Mon, Dec 15, 2014 at 08:20:38PM +0530, Naveen N. Rao escreveu:
 On powerpc ABIv2, if no debug-info is found and we use kallsyms, we need
 to fixup the function entry to point to the local entry point. Use
 offset of 8 since current toolchains always generate 2 instructions (8
 bytes).
 

So perhaps we should rename ARCH_SYMBOL_HANDLING to ARCH_ABI_SYMBOL_FIXUPS?

 Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com
 ---
 Changes:
 Generalize and introduce helper to post-process trace point.
 
  tools/perf/arch/powerpc/util/sym-handling.c | 17 +
  tools/perf/util/probe-event.c   |  1 +
  tools/perf/util/probe-event.h   | 10 ++
  3 files changed, 28 insertions(+)
 
 diff --git a/tools/perf/arch/powerpc/util/sym-handling.c 
 b/tools/perf/arch/powerpc/util/sym-handling.c
 index 22fc2e6..30c8797 100644
 --- a/tools/perf/arch/powerpc/util/sym-handling.c
 +++ b/tools/perf/arch/powerpc/util/sym-handling.c
 @@ -45,3 +45,20 @@ inline bool prefer_symtab(void)
   return false;
  #endif
  }
 +
 +void arch_fix_tev_from_maps(struct perf_probe_event *pev __maybe_unused,
 + struct probe_trace_event *tev __maybe_unused,
 + struct map *map __maybe_unused)
 +{
 +#if defined(_CALL_ELF)  _CALL_ELF == 2
 + /*
 +  * If we used kallsyms, we should fixup the function entry address here.
 +  * ppc64 ABIv2 local entry point is currently always 2 instructions (8 
 bytes)
 +  * after the global entry point. Fix this if it ever changes.
 +  */
 + if (!pev-uprobes  map-dso-symtab_type == 
 DSO_BINARY_TYPE__KALLSYMS) {
 + tev-point.address += 8;
 + tev-point.offset += 8;
 + }
 +#endif
 +}
 diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
 index dfc3151..85f37a4 100644
 --- a/tools/perf/util/probe-event.c
 +++ b/tools/perf/util/probe-event.c
 @@ -2340,6 +2340,7 @@ static int find_probe_trace_events_from_map(struct 
 perf_probe_event *pev,
   strdup_or_goto(pev-args[i].type,
   nomem_out);
   }
 + arch_fix_tev_from_maps(pev, tev, map);
   }
  
  out:
 diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
 index 5f92906..335a6a4 100644
 --- a/tools/perf/util/probe-event.h
 +++ b/tools/perf/util/probe-event.h
 @@ -147,6 +147,16 @@ extern bool prefer_symtab(void);
  static inline bool prefer_symtab(void) { return false; };
  #endif
  
 +#ifdef HAVE_ARCH_SYMBOL_HANDLING
 +extern void arch_fix_tev_from_maps(struct perf_probe_event *pev 
 __maybe_unused,
 +struct probe_trace_event *tev __maybe_unused,
 +struct map *map __maybe_unused);
 +#else
 +static inline void arch_fix_tev_from_maps(struct perf_probe_event *pev 
 __maybe_unused,
 +   struct probe_trace_event *tev 
 __maybe_unused,
 +   struct map *map __maybe_unused) { }
 +#endif
 +
  /* Maximum index number of event-name postfix */
  #define MAX_EVENT_INDEX  1024
  
 -- 
 2.1.3
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC,1/8] soc/fman: Add FMan MURAM support

2015-03-12 Thread Kumar Gala

On Mar 11, 2015, at 12:07 AM, Igal.Liberman igal.liber...@freescale.com wrote:

 From: Igal Liberman igal.liber...@freescale.com
 
 Add Frame Manager Multi-User RAM support.
 
 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 ---
 drivers/soc/fsl/fman/Kconfig|1 +
 drivers/soc/fsl/fman/Makefile   |5 +-
 drivers/soc/fsl/fman/fm_muram.c |  174 +++
 drivers/soc/fsl/fman/inc/fm_muram_ext.h |   98 +
 4 files changed, 276 insertions(+), 2 deletions(-)
 create mode 100644 drivers/soc/fsl/fman/fm_muram.c
 create mode 100644 drivers/soc/fsl/fman/inc/fm_muram_ext.h
 

use lib/genalloc instead of rheap

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [v2,02/11] soc/fman: Add the FMan FLIB

2015-03-12 Thread Kumar Gala

On Mar 11, 2015, at 12:04 AM, Igal.Liberman igal.liber...@freescale.com wrote:

 From: Igal Liberman igal.liber...@freescale.com
 
 Signed-off-by: Igal Liberman igal.liber...@freescale.com
 ---
 drivers/soc/Kconfig   |1 +
 drivers/soc/Makefile  |1 +
 drivers/soc/fsl/Kconfig   |1 +
 drivers/soc/fsl/Makefile  |1 +
 drivers/soc/fsl/fman/Kconfig  |7 +
 drivers/soc/fsl/fman/Makefile |5 +
 drivers/soc/fsl/fman/fman.c   | 1355 +
 7 files changed, 1371 insertions(+)
 create mode 100644 drivers/soc/fsl/Kconfig
 create mode 100644 drivers/soc/fsl/Makefile
 create mode 100644 drivers/soc/fsl/fman/Kconfig
 create mode 100644 drivers/soc/fsl/fman/Makefile
 create mode 100644 drivers/soc/fsl/fman/fman.c
 
 diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
 index 76d6bd4..674a6e6 100644
 --- a/drivers/soc/Kconfig
 +++ b/drivers/soc/Kconfig
 @@ -1,5 +1,6 @@
 menu SOC (System On Chip) specific Drivers
 
 +source drivers/soc/fsl/Kconfig
 source drivers/soc/qcom/Kconfig
 source drivers/soc/ti/Kconfig
 source drivers/soc/versatile/Kconfig
 diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
 index 063113d..42836ee 100644
 --- a/drivers/soc/Makefile
 +++ b/drivers/soc/Makefile
 @@ -2,6 +2,7 @@
 # Makefile for the Linux Kernel SOC specific device drivers.
 #
 
 +obj-$(CONFIG_FSL_SOC)+= fsl/
 obj-$(CONFIG_ARCH_QCOM)   += qcom/
 obj-$(CONFIG_ARCH_TEGRA)  += tegra/
 obj-$(CONFIG_SOC_TI)  += ti/
 diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
 new file mode 100644
 index 000..38c08ae
 --- /dev/null
 +++ b/drivers/soc/fsl/Kconfig
 @@ -0,0 +1 @@

Should probably just wrap this with an 

if FSL_SOC

 +source drivers/soc/fsl/fman/Kconfig”

endif #FSL_SOC

Than you can drop all downstream options always needing to depend on FSL_SOC

 diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
 new file mode 100644
 index 000..20ab5d0
 --- /dev/null
 +++ b/drivers/soc/fsl/Makefile
 @@ -0,0 +1 @@
 +obj-$(CONFIG_FSL_FMAN)   += fman/
 diff --git a/drivers/soc/fsl/fman/Kconfig b/drivers/soc/fsl/fman/Kconfig
 new file mode 100644
 index 000..6e8b0a6
 --- /dev/null
 +++ b/drivers/soc/fsl/fman/Kconfig
 @@ -0,0 +1,7 @@
 +menuconfig FSL_FMAN
 + bool Freescale DPAA Frame Manager
 + depends on FSL_SOC || COMPILE_TEST
 + default n
 + help
 + Freescale Data-Path Acceleration Architecture Frame Manager
 + (FMan) support
 diff --git a/drivers/soc/fsl/fman/Makefile b/drivers/soc/fsl/fman/Makefile
 new file mode 100644
 index 000..e7a0575
 --- /dev/null
 +++ b/drivers/soc/fsl/fman/Makefile
 @@ -0,0 +1,5 @@
 +subdir-ccflags-$(CONFIG_FSL_FMAN) += -I$(srctree)/drivers/soc/fsl/fman/flib
 +
 +obj-$(CONFIG_FSL_FMAN)   += fsl_fman.o
 +
 +fsl_fman-objs:= fman.o
 diff --git a/drivers/soc/fsl/fman/fman.c b/drivers/soc/fsl/fman/fman.c
 new file mode 100644
 index 000..138b2da
 --- /dev/null
 +++ b/drivers/soc/fsl/fman/fman.c
 @@ -0,0 +1,1355 @@
 +/*
 + * Copyright 2008 - 2015 Freescale Semiconductor Inc.
 + *
 + * Redistribution and use in source and binary forms, with or without
 + * modification, are permitted provided that the following conditions are 
 met:
 + * * Redistributions of source code must retain the above copyright
 + *notice, this list of conditions and the following disclaimer.
 + * * Redistributions in binary form must reproduce the above copyright
 + *notice, this list of conditions and the following disclaimer in the
 + *documentation and/or other materials provided with the distribution.
 + * * Neither the name of Freescale Semiconductor nor the
 + *names of its contributors may be used to endorse or promote products
 + *derived from this software without specific prior written permission.
 + *
 + * ALTERNATIVELY, this software may be distributed under the terms of the
 + * GNU General Public License (GPL) as published by the Free Software
 + * Foundation, either version 2 of that License or (at your option) any
 + * later version.
 + *
 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
 SERVICES;
 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 AND
 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
 THIS
 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 + */
 +
 +#include “fsl_fman.h


Any docs on all 

Re: [PATCH 0/8] powerpc/8xx: Getting rid of CONFIG_8xx

2015-03-12 Thread Geert Uytterhoeven
On Thu, Mar 12, 2015 at 4:24 PM, Christophe Leroy
christophe.le...@c-s.fr wrote:
 Two config options exist to define powerpc MPC8xx:
 * CONFIG_PPC_8xx
 * CONFIG_8xx
 In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
 communication co-processor

 arch/powerpc/platforms/Kconfig.cputype has contained the following
 comment about CONFIG_8xx item for some years:
 # this is temp to handle compat with arch=ppc

 It looks like not many places still have that old CONFIG_8xx used,
 so it is likely to be a good time to get rid of it completely ?

We also have CONFIG_40x,. CONFIG_44x, and CONFIG_4xx.
There's no CONFIG_PPC_4* though.

Do we want (some) consistency?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say programmer or something like that.
-- Linus Torvalds
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv2 3/8] perf probe powerpc: Fix symbol fixup issues due to ELF type

2015-03-12 Thread Arnaldo Carvalho de Melo
Em Mon, Dec 15, 2014 at 08:20:33PM +0530, Naveen N. Rao escreveu:
 If using the symbol table, symbol addresses are not being fixed up
 properly, resulting in probes being placed at wrong addresses:
 
   # perf probe do_fork
   Added new event:
 probe:do_fork(on do_fork)
 
   You can now use it in all perf tools, such as:
 
 perf record -e probe:do_fork -aR sleep 1
 
   # cat /sys/kernel/debug/tracing/kprobe_events
   p:probe/do_fork _text+635952
   # printf %x 635952
   9b430
   # grep do_fork /boot/System.map
   c00ab430 T .do_fork
 
 Fix by checking for ELF type ET_DYN used by ppc64 kernels.

Sorry if this was answered already, its been a while since this was
posted/discussed... Are you completely sure this is not a problem on
!ppc?

Woudln't it be more conservative to somehow only adjust symbols for this
ET_DYN type if the arch is ppc? I.e. something like moving that
adjust_symbols logic to be arch_adjust_symbols(), provide a default and
then override it for ppc to include also ET_DYN?

Looking at the other patches...

- Arnaldo
 
 Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com
 ---
  tools/perf/util/symbol-elf.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
 index 06fcd1b..7ac4e4c 100644
 --- a/tools/perf/util/symbol-elf.c
 +++ b/tools/perf/util/symbol-elf.c
 @@ -683,7 +683,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, 
 const char *name,
NULL) != NULL);
   } else {
   ss-adjust_symbols = ehdr.e_type == ET_EXEC ||
 -  ehdr.e_type == ET_REL;
 +  ehdr.e_type == ET_REL ||
 +  ehdr.e_type == ET_DYN;
   }
  
   ss-name   = strdup(name);
 -- 
 2.1.3
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv2 2/8] perf probe: Improve detection of file/function name in the probe pattern

2015-03-12 Thread Arnaldo Carvalho de Melo
Em Thu, Mar 12, 2015 at 05:24:14PM -0300, Arnaldo Carvalho de Melo escreveu:
 Em Mon, Dec 15, 2014 at 08:20:32PM +0530, Naveen N. Rao escreveu:
  Currently, perf probe considers patterns including a '.' to be a file.
  However, this causes problems on powerpc ABIv1 where all functions have
  a leading '.':
  
$ perf probe -F | grep schedule_timeout_interruptible
.schedule_timeout_interruptible
$ perf probe .schedule_timeout_interruptible
Semantic error :File always requires line number or lazy pattern.
  Error: Command Parse Error.
  
  Fix this by checking the probe pattern in more detail.
 
 Masami, can I have your Acked-by or Reviewed-by?

It is limited to powerpc, but I would even so be happy if you could look
at it,

Thanks,

- Arnaldo
 
  Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com
  ---
   tools/perf/util/probe-event.c | 23 ---
   1 file changed, 20 insertions(+), 3 deletions(-)
  
  diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
  index 28eb141..9943ff3 100644
  --- a/tools/perf/util/probe-event.c
  +++ b/tools/perf/util/probe-event.c
  @@ -999,6 +999,24 @@ static int parse_perf_probe_point(char *arg, struct 
  perf_probe_event *pev)
  arg = tmp;
  }
   
  +   /*
  +* Check arg is function or file name and copy it.
  +*
  +* We consider arg to be a file spec if and only if it satisfies
  +* all of the below criteria::
  +* - it does not include any of +@%,
  +* - it includes one of :;, and
  +* - it has a period '.' in the name.
  +*
  +* Otherwise, we consider arg to be a function specification.
  +*/
  +   c = 0;
  +   if (!strpbrk(arg, +@%)  (ptr = strpbrk(arg, ;:)) != NULL) {
  +   /* This is a file spec if it includes a '.' before ; or : */
  +   if (memchr(arg, '.', ptr-arg))
  +   c = 1;
  +   }
  +
  ptr = strpbrk(arg, ;:+@%);
  if (ptr) {
  nc = *ptr;
  @@ -1009,10 +1027,9 @@ static int parse_perf_probe_point(char *arg, struct 
  perf_probe_event *pev)
  if (tmp == NULL)
  return -ENOMEM;
   
  -   /* Check arg is function or file and copy it */
  -   if (strchr(tmp, '.'))   /* File */
  +   if (c == 1)
  pp-file = tmp;
  -   else/* Function */
  +   else
  pp-function = tmp;
   
  /* Parse other options */
  -- 
  2.1.3
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv2 2/8] perf probe: Improve detection of file/function name in the probe pattern

2015-03-12 Thread Arnaldo Carvalho de Melo
Em Mon, Dec 15, 2014 at 08:20:32PM +0530, Naveen N. Rao escreveu:
 Currently, perf probe considers patterns including a '.' to be a file.
 However, this causes problems on powerpc ABIv1 where all functions have
 a leading '.':
 
   $ perf probe -F | grep schedule_timeout_interruptible
   .schedule_timeout_interruptible
   $ perf probe .schedule_timeout_interruptible
   Semantic error :File always requires line number or lazy pattern.
 Error: Command Parse Error.
 
 Fix this by checking the probe pattern in more detail.

Masami, can I have your Acked-by or Reviewed-by?


- Arnaldo
 
 Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com
 ---
  tools/perf/util/probe-event.c | 23 ---
  1 file changed, 20 insertions(+), 3 deletions(-)
 
 diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
 index 28eb141..9943ff3 100644
 --- a/tools/perf/util/probe-event.c
 +++ b/tools/perf/util/probe-event.c
 @@ -999,6 +999,24 @@ static int parse_perf_probe_point(char *arg, struct 
 perf_probe_event *pev)
   arg = tmp;
   }
  
 + /*
 +  * Check arg is function or file name and copy it.
 +  *
 +  * We consider arg to be a file spec if and only if it satisfies
 +  * all of the below criteria::
 +  * - it does not include any of +@%,
 +  * - it includes one of :;, and
 +  * - it has a period '.' in the name.
 +  *
 +  * Otherwise, we consider arg to be a function specification.
 +  */
 + c = 0;
 + if (!strpbrk(arg, +@%)  (ptr = strpbrk(arg, ;:)) != NULL) {
 + /* This is a file spec if it includes a '.' before ; or : */
 + if (memchr(arg, '.', ptr-arg))
 + c = 1;
 + }
 +
   ptr = strpbrk(arg, ;:+@%);
   if (ptr) {
   nc = *ptr;
 @@ -1009,10 +1027,9 @@ static int parse_perf_probe_point(char *arg, struct 
 perf_probe_event *pev)
   if (tmp == NULL)
   return -ENOMEM;
  
 - /* Check arg is function or file and copy it */
 - if (strchr(tmp, '.'))   /* File */
 + if (c == 1)
   pp-file = tmp;
 - else/* Function */
 + else
   pp-function = tmp;
  
   /* Parse other options */
 -- 
 2.1.3
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv2 4/8] perf probe powerpc: Handle powerpc dot symbols

2015-03-12 Thread Arnaldo Carvalho de Melo
Em Mon, Dec 15, 2014 at 08:20:34PM +0530, Naveen N. Rao escreveu:
 Fix up various perf aspects related to ppc64's usage of dot functions:
 - ignore leading '.' when generating event names and when looking for
   existing events.
 - use the proper prefix when ignoring SyS symbol lookups.
 
 Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com
 ---
  tools/perf/util/probe-event.c | 8 
  tools/perf/util/symbol.c  | 6 ++
  2 files changed, 14 insertions(+)
 
 diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
 index 9943ff3..74b7fef 100644
 --- a/tools/perf/util/probe-event.c
 +++ b/tools/perf/util/probe-event.c
 @@ -2080,6 +2080,10 @@ static int get_new_event_name(char *buf, size_t len, 
 const char *base,
  {
   int i, ret;
  
 + /* Skip the leading dot on powerpc */
 + if (*base == '.')
 + base++;
 +
   /* Try no suffix */
   ret = e_snprintf(buf, len, %s, base);
   if (ret  0) {
 @@ -2538,6 +2542,10 @@ int del_perf_probe_events(struct strlist *dellist)
   event = str;
   }
  
 + /* Skip the leading dot on powerpc */

Ok, but this is not powerpc specific code, is it?

 + if (event  *event == '.')
 + event++;
 +
   ret = e_snprintf(buf, 128, %s:%s, group, event);
   if (ret  0) {
   pr_err(Failed to copy event.);
 diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
 index c24c5b8..e7b9bae 100644
 --- a/tools/perf/util/symbol.c
 +++ b/tools/perf/util/symbol.c
 @@ -139,6 +139,12 @@ static int choose_best_symbol(struct symbol *syma, 
 struct symbol *symb)
   if (na = 10  !strncmp(syma-name, compat_SyS, 10))
   return SYMBOL_B;
  
 + /* On powerpc, ignore the dot variants */
 + if (na = 4  !strncmp(syma-name, .SyS, 4))
 + return SYMBOL_B;
 + if (na = 11  !strncmp(syma-name, .compat_SyS, 11))
 + return SYMBOL_B;
 +
   return SYMBOL_A;
  }
  
 -- 
 2.1.3
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] mm: kill kmemcheck

2015-03-12 Thread Steven Rostedt
On Thu, 12 Mar 2015 14:49:52 +1100
Michael Ellerman m...@ellerman.id.au wrote:
 
 From Documentation/kasan.txt:
 
 therefore you will need a certain version of GCC  4.9.2
 
 AFAIK gcc 4.9.3 hasn't been released yet. (Or does it mean = 4.9.2 ?)

It means 4.9.2. I also feel that this makes it too premature to remove
kmemcheck, as not everyone (including myself) has the latest and
greatest gcc on their systems.

 
 Can we perhaps wait until there is a released version of GCC that supports
 KASan? And maybe then a touch longer so folks can test it works on their
 platforms?
 

Note, I replied to this cutting out the Cc's to the individuals so that
it can have a wider audience! (figure out what I mean by that). You can
see my reply on LKML (hint, you wont see the original email, or this
current thread for that matter).

-- Steve
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [v2,00/11] Freescale DPAA FMan FLIB(s)

2015-03-12 Thread igal.liber...@freescale.com
Hello, 

In v2 of DPAA FMan FLIBs we've made the following updates:
- Split the header patch ([v2,01/11] soc/fman: Add the FMan FLIB headers) from 
one big patch to smaller patches - Kumar's feedback.
- Removed the KILOBYTE defines - Kumar's feedback.
- Addressed several comments from Scott on [v2,02/11] soc/fman: Add the FMan 
FLIB.

Best regards,
Igal Liberman.

 -Original Message-
 From: Igal.Liberman [mailto:igal.liber...@freescale.com]
 Sent: Wednesday, March 11, 2015 7:04 AM
 To: linuxppc-dev@lists.ozlabs.org; net...@vger.kernel.org; linux-
 ker...@vger.kernel.org
 Cc: Wood Scott-B07421; Liberman Igal-B31950
 Subject: [v2,00/11] Freescale DPAA FMan FLIB(s)
 
 From: Igal Liberman igal.liber...@freescale.com
 
 The Freescale Data Path Acceleration Architecture (DPAA) is a set of
 hardware components on specific QorIQ multicore processors. This
 architecture provides the infrastructure to support simplified sharing of
 networking interfaces and accelerators by multiple CPU cores and the
 accelerators.
 
 One of the DPAA accelerators is the Frame Manager (FMan) which enables
 the Ethernet network interfaces.
 
 This patch presents the FMan Foundation Libraries (FLIB) headers.
 The FMan FLIB adds basic support for the DPAA FMan hardware register
 access.
 
 Igal Liberman (7):
   soc/fman: Add the FMan FLIB headers
   soc/fman: Add the FMan FLIB
   soc/fman: Add the FMan port FLIB
   soc/fman: Add the FMan MAC FLIB
   soc/fman: Add the FMan parser and KeyGen FLIB(s)
   soc/fman: Add the FMan RTC FLIB
   soc/fman: Add the FMan SP FLIB
 
 Madalin Bucur (4):
   soc/fman: Add the FMan port FLIB headers
   soc/fman: Add the FMan MAC FLIB headers
   soc/fman: Add the FMan parser and KeyGen FLIB headers
   soc/fman: Add the FMan RTC FLIB header
 
  drivers/soc/Kconfig|1 +
  drivers/soc/Makefile   |1 +
  drivers/soc/fsl/Kconfig|1 +
  drivers/soc/fsl/Makefile   |1 +
  drivers/soc/fsl/fman/Kconfig   |   35 +
  drivers/soc/fsl/fman/Makefile  |   11 +
  drivers/soc/fsl/fman/flib/common/general.h |   41 +
  drivers/soc/fsl/fman/flib/fman_common.h|   73 +
  drivers/soc/fsl/fman/flib/fsl_enet.h   |  275 
  drivers/soc/fsl/fman/flib/fsl_fman.h   |  802 ++
  drivers/soc/fsl/fman/flib/fsl_fman_dtsec.h | 1016 +
  drivers/soc/fsl/fman/flib/fsl_fman_dtsec_mii_acc.h |  103 ++
  drivers/soc/fsl/fman/flib/fsl_fman_kg.h|  505 +++
  drivers/soc/fsl/fman/flib/fsl_fman_memac.h |  494 +++
  drivers/soc/fsl/fman/flib/fsl_fman_memac_mii_acc.h |   76 +
  drivers/soc/fsl/fman/flib/fsl_fman_port.h  |  601 
  drivers/soc/fsl/fman/flib/fsl_fman_prs.h   |  106 ++
  drivers/soc/fsl/fman/flib/fsl_fman_rtc.h   |  414 ++
  drivers/soc/fsl/fman/flib/fsl_fman_sp.h|  132 ++
  drivers/soc/fsl/fman/flib/fsl_fman_tgec.h  |  483 ++
  drivers/soc/fsl/fman/fman.c| 1355 +
  drivers/soc/fsl/fman/mac/Makefile  |5 +
  drivers/soc/fsl/fman/mac/fman_crc32.c  |  116 ++
  drivers/soc/fsl/fman/mac/fman_crc32.h  |   39 +
  drivers/soc/fsl/fman/mac/fman_dtsec.c  |  838 +++
  drivers/soc/fsl/fman/mac/fman_dtsec_mii_acc.c  |  168 +++
  drivers/soc/fsl/fman/mac/fman_memac.c  |  510 +++
  drivers/soc/fsl/fman/mac/fman_memac_mii_acc.c  |  217 +++
  drivers/soc/fsl/fman/mac/fman_tgec.c   |  371 +
  drivers/soc/fsl/fman/pcd/Makefile  |3 +
  drivers/soc/fsl/fman/pcd/fman_kg.c |  849 +++
  drivers/soc/fsl/fman/pcd/fman_prs.c|  126 ++
  drivers/soc/fsl/fman/port/Makefile |3 +
  drivers/soc/fsl/fman/port/fman_port.c  | 1535
 
  drivers/soc/fsl/fman/rtc/Makefile  |3 +
  drivers/soc/fsl/fman/rtc/fman_rtc.c|  353 +
  drivers/soc/fsl/fman/sp/Makefile   |3 +
  drivers/soc/fsl/fman/sp/fman_sp.c  |  203 +++
  38 files changed, 11868 insertions(+)
  create mode 100644 drivers/soc/fsl/Kconfig  create mode 100644
 drivers/soc/fsl/Makefile  create mode 100644 drivers/soc/fsl/fman/Kconfig
 create mode 100644 drivers/soc/fsl/fman/Makefile  create mode 100644
 drivers/soc/fsl/fman/flib/common/general.h
  create mode 100644 drivers/soc/fsl/fman/flib/fman_common.h
  create mode 100644 drivers/soc/fsl/fman/flib/fsl_enet.h
  create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman.h
  create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_dtsec.h
  create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_dtsec_mii_acc.h
  create mode 100644 drivers/soc/fsl/fman/flib/fsl_fman_kg.h
  create mode 100644 

Re: [PATCH 4/4] mm: numa: Slow PTE scan rate if migration failures occur

2015-03-12 Thread Mel Gorman
On Thu, Mar 12, 2015 at 09:20:36AM -0700, Linus Torvalds wrote:
 On Thu, Mar 12, 2015 at 6:10 AM, Mel Gorman mgor...@suse.de wrote:
 
  I believe you're correct and it matches what was observed. I'm still
  travelling and wireless is dirt but managed to queue a test using pmd_dirty
 
 Ok, thanks.
 
 I'm not entirely happy with that change, and I suspect the whole
 heuristic should be looked at much more (maybe it should also look at
 whether it's executable, for example), but it's a step in the right
 direction.
 

I can follow up when I'm back in work properly. As you have already pulled
this in directly, can you also consider pulling in mm: thp: return the
correct value for change_huge_pmd please? The other two patches were very
minor can be resent through the normal paths later.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 4/8] net: freescale: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread David Miller
From: Christophe Leroy christophe.le...@c-s.fr
Date: Thu, 12 Mar 2015 16:23:54 +0100 (CET)

 Two config options exist to define powerpc MPC8xx:
 * CONFIG_PPC_8xx
 * CONFIG_8xx
 In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
 communication co-processor
 
 arch/powerpc/platforms/Kconfig.cputype has contained the following
 comment about CONFIG_8xx item for some years:
 # this is temp to handle compat with arch=ppc
 
 It looks like not many places still have that old CONFIG_8xx used,
 so it is likely to be a good time to get rid of it completely ?
 
 Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

Acked-by: David S. Miller da...@davemloft.net
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 7/8] isdn: replace CONFIG_8xx by CONFIG_PPC_8xx

2015-03-12 Thread David Miller
From: Christophe Leroy christophe.le...@c-s.fr
Date: Thu, 12 Mar 2015 16:24:09 +0100 (CET)

 Two config options exist to define powerpc MPC8xx:
 * CONFIG_PPC_8xx
 * CONFIG_8xx
 In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
 communication co-processor
 
 arch/powerpc/platforms/Kconfig.cputype has contained the following
 comment about CONFIG_8xx item for some years:
 # this is temp to handle compat with arch=ppc
 
 It looks like not many places still have that old CONFIG_8xx used,
 so it is likely to be a good time to get rid of it completely ?
 
 Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

Acked-by: David S. Miller da...@davemloft.net
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] mm: kill kmemcheck

2015-03-12 Thread Sasha Levin
On 03/12/2015 03:07 AM, Pekka Enberg wrote:
 Hi Sasha,
 
 On 3/11/15 1:43 PM, Sasha Levin wrote:
 As discussed on LSF/MM, kill kmemcheck.

 KASan is a replacement that is able to work without the limitation of
 kmemcheck (single CPU, slow). KASan is already upstream.

 We are also not aware of any users of kmemcheck (or users who don't consider
 KASan as a suitable replacement).

 I've build tested it using all[yes,no,mod]config and fuzzed a bit with this
 patch applied, didn't notice any bad behaviour.

 Signed-off-by: Sasha Levin sasha.le...@oracle.com
 
 Can you elaborate on what exactly was discussed at LSF/MM? Preferably in the 
 commit log. ;-)

There wasn't a long discussion about removing kmemcheck, it just followed up
a KASan topic and the question of whether kmemcheck can be deprecated now
that KASan is merged came up.

No one at the room didn't use it, knew a user of it, or couldn't describe a
usecase where kmemcheck was superior to KASan - so the conclusion was to try
and replace it.

The only thing I can really put in the changelog is a reference to the KASan
docs and to ask folks to complain loudly if we missed a usecase.


Thanks,
Sasha
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] mm: kill kmemcheck

2015-03-12 Thread Sasha Levin
On 03/11/2015 11:49 PM, Michael Ellerman wrote:
 On Wed, 2015-03-11 at 07:43 -0400, Sasha Levin wrote:
 As discussed on LSF/MM, kill kmemcheck.

 KASan is a replacement that is able to work without the limitation of
 kmemcheck (single CPU, slow). KASan is already upstream.

 We are also not aware of any users of kmemcheck (or users who don't consider
 KASan as a suitable replacement).
 
 From Documentation/kasan.txt:
 
 therefore you will need a certain version of GCC  4.9.2
 
 AFAIK gcc 4.9.3 hasn't been released yet. (Or does it mean = 4.9.2 ?)
 
 Can we perhaps wait until there is a released version of GCC that supports
 KASan? And maybe then a touch longer so folks can test it works on their
 platforms?

I think this is just an off-by-one in the documentation. The cover letter for
the KASan patchset stated:

KASAN uses compile-time instrumentation for checking every memory 
access, therefore you
will need a fresh GCC = v4.9.2


Thanks,
Sasha

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 1/5] of/fdt: split off FDT self reservation from memreserve processing

2015-03-12 Thread Rob Herring
On Wed, Mar 11, 2015 at 11:00 AM, Ard Biesheuvel
ard.biesheu...@linaro.org wrote:
 This splits off the reservation of the memory occupied by the FDT
 binary itself from the processing of the memory reservations it
 contains. This is necessary because the physical address of the FDT,
 which is needed to perform the reservation, may not be known to the
 FDT driver core, i.e., it may be mapped outside the linear direct
 mapping, in which case __pa() returns a bogus value.

 Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
 Cc: Paul Mackerras pau...@samba.org
 Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org

Not really the direction I like going by moving more things back to
arch code, but I haven't come up with any better suggestion so:

Acked-by: Rob Herring r...@kernel.org

BTW, I do want to move early_init_fdt_scan_reserved_mem out of the
arch code as well. Other arches don't call it, but it should be
harmless if they never use the reserved memory regions.

Rob

 ---
  arch/arm/mm/init.c |  1 +
  arch/arm64/mm/init.c   |  1 +
  arch/powerpc/kernel/prom.c |  1 +
  drivers/of/fdt.c   | 19 ++-
  include/linux/of_fdt.h |  2 ++
  5 files changed, 19 insertions(+), 5 deletions(-)

 diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
 index 1609b022a72f..0b8657c36fe4 100644
 --- a/arch/arm/mm/init.c
 +++ b/arch/arm/mm/init.c
 @@ -317,6 +317,7 @@ void __init arm_memblock_init(const struct machine_desc 
 *mdesc)
 if (mdesc-reserve)
 mdesc-reserve();

 +   early_init_fdt_reserve_self();
 early_init_fdt_scan_reserved_mem();

 /* reserve memory for DMA contiguous allocations */
 diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
 index ae85da6307bb..fa2389b0f7f0 100644
 --- a/arch/arm64/mm/init.c
 +++ b/arch/arm64/mm/init.c
 @@ -170,6 +170,7 @@ void __init arm64_memblock_init(void)
 memblock_reserve(__virt_to_phys(initrd_start), initrd_end - 
 initrd_start);
  #endif

 +   early_init_fdt_reserve_self();
 early_init_fdt_scan_reserved_mem();

 /* 4GB maximum for 32-bit only capable devices */
 diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
 index b8e15c678960..093ccfb384af 100644
 --- a/arch/powerpc/kernel/prom.c
 +++ b/arch/powerpc/kernel/prom.c
 @@ -573,6 +573,7 @@ static void __init early_reserve_mem_dt(void)
 int len;
 const __be32 *prop;

 +   early_init_fdt_reserve_self();
 early_init_fdt_scan_reserved_mem();

 dt_root = of_get_flat_dt_root();
 diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
 index 3a896c9aeb74..bbb35cdb06e8 100644
 --- a/drivers/of/fdt.c
 +++ b/drivers/of/fdt.c
 @@ -561,11 +561,6 @@ void __init early_init_fdt_scan_reserved_mem(void)
 if (!initial_boot_params)
 return;

 -   /* Reserve the dtb region */
 -   early_init_dt_reserve_memory_arch(__pa(initial_boot_params),
 - fdt_totalsize(initial_boot_params),
 - 0);
 -
 /* Process header /memreserve/ fields */
 for (n = 0; ; n++) {
 fdt_get_mem_rsv(initial_boot_params, n, base, size);
 @@ -579,6 +574,20 @@ void __init early_init_fdt_scan_reserved_mem(void)
  }

  /**
 + * early_init_fdt_reserve_self() - reserve the memory used by the FDT blob
 + */
 +void __init early_init_fdt_reserve_self(void)
 +{
 +   if (!initial_boot_params)
 +   return;
 +
 +   /* Reserve the dtb region */
 +   early_init_dt_reserve_memory_arch(__pa(initial_boot_params),
 + fdt_totalsize(initial_boot_params),
 + 0);
 +}
 +
 +/**
   * of_scan_flat_dt - scan flattened tree blob and call callback on each.
   * @it: callback function
   * @data: context data pointer
 diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
 index 0ff360d5b3b3..6ef6b33238d3 100644
 --- a/include/linux/of_fdt.h
 +++ b/include/linux/of_fdt.h
 @@ -62,6 +62,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, 
 const char *uname,
  extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
  int depth, void *data);
  extern void early_init_fdt_scan_reserved_mem(void);
 +extern void early_init_fdt_reserve_self(void);
  extern void early_init_dt_add_memory_arch(u64 base, u64 size);
  extern int early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t 
 size,
  bool no_map);
 @@ -89,6 +90,7 @@ extern u64 fdt_translate_address(const void *blob, int 
 node_offset);
  extern void of_fdt_limit_memory(int limit);
  #else /* CONFIG_OF_FLATTREE */
  static inline void early_init_fdt_scan_reserved_mem(void) {}
 +static inline void early_init_fdt_reserve_self(void) {}
  static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
  static inline 

[RFC] powerpc: e6500 optimised copy_to_user/copy_from_user

2015-03-12 Thread Kim Phillips
This mimics commit a66086b8197da8dc83b698642d5947ff850e708d powerpc:
POWER7 optimised copy_to_user/copy_from_user using VMX, but for
the e6500, or BOOK3S_64.  Changes have been made for the smaller
cacheline size (64 bytes on e6500), and data cache block touch (dcbt)
instructions have been rewritten to prefetch 8 lines ahead, based
on preliminary benchmark results and perf -e L1-dcache-prefetches
and misses observations.

We see a gain of 5% in large netperf benchmarks between two T4240s,
both in terms of throughput, and latency.  The same netperf
lo(opback) test improves 27%.

Anton's microbenchmark results show a clear linear improvement path
with sizes 32KB and above, where, below that, the additional overhead
over the existing copyuser_64 implementation shows its head: e.g., 6%
for 1448 byte copies.  The observed transfer sizes under large,
netperf benchmarks show the TCP stack is invoking copies on the
order of a few 10's of KB, however. 1MB transfers are 30% better-off
on wall clock time.

RFC because of the following known issues:
- unsure if PPC_BOOK3E_64 vs. PPC_BOOK3S_64 build-time switch to
  re-target __copy_tofrom_user_vmx is appropriate (ppc64_defconfig
  builds fine, however)
- syscalls report deficits when folding vmx_unaligned_copy to a 64B
  cacheline (undone for this RFC)
- any consideration for the e5500?
- asm branch label re-enumeration
- ..I'm sure I've missed another couple of things, possibly
including how to fix lower-sized transfer performance

Signed-off-by: Kim Phillips kim.phill...@freescale.com
---
applies to Linus' ToT today (commit 09d35919b06),
since Scott's tree seems a bit outdated.

 arch/powerpc/include/asm/cputable.h |   2 +-
 arch/powerpc/lib/Makefile   |   5 +-
 arch/powerpc/lib/copyuser_64.S  |   2 +-
 arch/powerpc/lib/copyuser_e6500.S   | 768 
 arch/powerpc/lib/copyuser_power7.S  |   2 +-
 5 files changed, 775 insertions(+), 4 deletions(-)
 create mode 100644 arch/powerpc/lib/copyuser_e6500.S

diff --git a/arch/powerpc/include/asm/cputable.h 
b/arch/powerpc/include/asm/cputable.h
index 5cf5a6d..66ca94a 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -391,7 +391,7 @@ extern const char *powerpc_base_platform;
CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \
-   CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT)
+   CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT | CPU_FTR_VMX_COPY)
 #define CPU_FTRS_GENERIC_32(CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
 
 /* 64-bit CPUs */
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 7902802..c85e05d 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -15,12 +15,15 @@ obj-y += string.o alloc.o crtsavres.o ppc_ksyms.o 
code-patching.o \
 obj-$(CONFIG_PPC32)+= div64.o copy_32.o
 
 obj64-y+= copypage_64.o copyuser_64.o usercopy_64.o mem_64.o 
hweight_64.o \
-  copyuser_power7.o string_64.o copypage_power7.o memcpy_power7.o \
+  string_64.o copypage_power7.o memcpy_power7.o \
   memcpy_64.o memcmp_64.o
 
 obj64-$(CONFIG_SMP)+= locks.o
 obj64-$(CONFIG_ALTIVEC)+= vmx-helper.o
 
+obj64-$(CONFIG_PPC_BOOK3S_64)  += copyuser_power7.o
+obj64-$(CONFIG_PPC_BOOK3E_64)  += copyuser_e6500.o
+
 ifeq ($(CONFIG_GENERIC_CSUM),)
 obj-y  += checksum_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_PPC64)+= checksum_wrappers_64.o
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index f09899e..0cf9253 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -22,7 +22,7 @@ _GLOBAL_TOC(__copy_tofrom_user)
 BEGIN_FTR_SECTION
nop
 FTR_SECTION_ELSE
-   b   __copy_tofrom_user_power7
+   b   __copy_tofrom_user_vmx
 ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY)
 _GLOBAL(__copy_tofrom_user_base)
/* first check for a whole page copy on a page boundary */
diff --git a/arch/powerpc/lib/copyuser_e6500.S 
b/arch/powerpc/lib/copyuser_e6500.S
new file mode 100644
index 000..efd4251
--- /dev/null
+++ b/arch/powerpc/lib/copyuser_e6500.S
@@ -0,0 +1,768 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, 

Re: [PATCH 1/2 v4] cpufreq: qoriq: Make the driver usable on all QorIQ platforms

2015-03-12 Thread Rafael J. Wysocki
On Tuesday, March 03, 2015 11:38:51 AM yuantian.t...@freescale.com wrote:
 From: Tang Yuantian yuantian.t...@freescale.com
 
 Freescale introduced new ARM core-based SoCs which support dynamic
 frequency switch feature. DFS on new SoCs are compatible with current
 PowerPC CoreNet platforms. In order to support those new platforms,
 this driver needs to be updated. The main changes include:
 
 1. Changed the names of functions in driver.
 2. Added two new functions get_cpu_physical_id() and get_bus_freq().
 3. Used a new way to get the CPU mask which share clock wire.
 
 Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
 Acked-by: Viresh Kumar viresh.ku...@linaro.org

That doesn't apply for me on top of 4.0-rc3.  Can you please rebase and
resubmit?


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC] powerpc: use ticket spin lock for !CONFIG_PPC_SPLPAR

2015-03-12 Thread Benjamin Herrenschmidt
On Thu, 2015-03-12 at 18:55 +0800, Kevin Hao wrote:
 I know Torsten Duwe has tried to add the ticket spinlock for powerpc
 one year ago [1]. But it make no progress due to the conflict between
 PPC_SPLPAR and lockref. We still don't find a better way to handle
 this. But instead of waiting forever for a perfect solution, can't we
 just use the ticket spinlock for the !CONFIG_PPC_SPLPAR?
 
 This is a very rough patch based on arm64 codes. I want to make sure
 that this is acceptable before going step further. This just passed
 build and boot test on a fsl t4240rdb board. I have done a simple
 performance benchmark by running the following command ten times before
 and after applying this patch:
   ./perf bench sched messaging
 
 BeforeAfter
 Averaged total time [sec]:  0.403 0.367
 
 So we can see a ~9% performance enhancing. This patch depends on this
 one [2].

I would do the ifdef'ing differently, something like

CONFIG_PPC_HAS_LOCK_OWNER

CONFIG_PPC_TICKET_LOCKS depends on !PPC_HAS_LOCK_OWNER

and use these two in the code... with SPLPAR select'ing HAS_LOCK_OWNER

 [1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-February/115195.html
 [2] http://patchwork.ozlabs.org/patch/447563/
 
 Signed-off-by: Kevin Hao haoke...@gmail.com
 ---
  arch/powerpc/include/asm/spinlock.h   | 79 
 ++-
  arch/powerpc/include/asm/spinlock_types.h | 16 +++
  arch/powerpc/lib/locks.c  |  2 +-
  3 files changed, 95 insertions(+), 2 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/spinlock.h 
 b/arch/powerpc/include/asm/spinlock.h
 index d303cdad2519..3faf2507abe9 100644
 --- a/arch/powerpc/include/asm/spinlock.h
 +++ b/arch/powerpc/include/asm/spinlock.h
 @@ -54,6 +54,7 @@
  #define SYNC_IO
  #endif
  
 +#ifdef CONFIG_PPC_SPLPAR
  static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
  {
   return lock.slock == 0;
 @@ -89,6 +90,40 @@ static inline unsigned long 
 __arch_spin_trylock(arch_spinlock_t *lock)
   return tmp;
  }
  
 +#else
 +static inline int arch_spin_value_unlocked(arch_spinlock_t lock)
 +{
 + return lock.owner == lock.next;
 +}
 +
 +static inline int arch_spin_is_locked(arch_spinlock_t *lock)
 +{
 + return !arch_spin_value_unlocked(READ_ONCE(*lock));
 +}
 +
 +static inline unsigned long __arch_spin_trylock(arch_spinlock_t *lock)
 +{
 + unsigned int tmp;
 + arch_spinlock_t lockval;
 +
 + __asm__ __volatile__ (
 +1:   PPC_LWARX(%0,0,%2,1) \n\
 + rotlwi  %1,%0,16\n\
 + xor.%1,%1,%0\n\
 + bne-2f\n\
 + add %0,%0,%3\n\
 + stwcx.  %0,0,%2\n\
 + bne-1b\n
 + PPC_ACQUIRE_BARRIER
 +2:
 + : =r (lockval), =r (tmp)
 + : r (lock), r (1  TICKET_SHIFT)
 + : cr0, memory);
 +
 + return tmp;
 +}
 +#endif
 +
  static inline int arch_spin_trylock(arch_spinlock_t *lock)
  {
   CLEAR_IO_SYNC;
 @@ -120,6 +155,7 @@ extern void __rw_yield(arch_rwlock_t *lock);
  #define SHARED_PROCESSOR 0
  #endif
  
 +#ifdef CONFIG_PPC_SPLPAR
  static inline void arch_spin_lock(arch_spinlock_t *lock)
  {
   CLEAR_IO_SYNC;
 @@ -155,16 +191,57 @@ void arch_spin_lock_flags(arch_spinlock_t *lock, 
 unsigned long flags)
   local_irq_restore(flags_dis);
   }
  }
 +#else
 +#define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
 +
 +static inline int arch_spin_is_contended(arch_spinlock_t *lock)
 +{
 + arch_spinlock_t lockval = READ_ONCE(*lock);
 + return (lockval.next - lockval.owner)  1;
 +}
 +#define arch_spin_is_contended   arch_spin_is_contended
 +
 +static inline void arch_spin_lock(arch_spinlock_t *lock)
 +{
 + unsigned int tmp;
 + arch_spinlock_t lockval;
 +
 + CLEAR_IO_SYNC;
 + __asm__ __volatile__ (
 +1:   PPC_LWARX(%0,0,%2,1) \n\
 + add %1,%0,%4\n\
 + stwcx.  %1,0,%2\n\
 + bne-1b\n\
 + rotlwi  %1,%0,16\n\
 + cmpw%1,%0\n\
 + beq 3f\n\
 + rlwinm  %0,%0,16,16,31\n\
 +2:   or  1,1,1\n\
 + lhz %1,0(%3)\n\
 + cmpw%1,%0\n\
 + bne 2b\n\
 + or  2,2,2\n\
 +3:
 + PPC_ACQUIRE_BARRIER
 + : =r (lockval), =r (tmp)
 + : r(lock), r (lock-owner), r (1  TICKET_SHIFT)
 + : cr0, memory);
 +}
 +#endif
  
  static inline void arch_spin_unlock(arch_spinlock_t *lock)
  {
   SYNC_IO;
   __asm__ __volatile__(# arch_spin_unlock\n\t
   PPC_RELEASE_BARRIER: : :memory);
 +#ifdef CONFIG_PPC_SPLPAR
   lock-slock = 0;
 +#else
 + lock-owner++;
 +#endif
  }
  
 -#ifdef CONFIG_PPC64
 +#ifdef CONFIG_PPC_SPLPAR
  extern void arch_spin_unlock_wait(arch_spinlock_t *lock);
  #else
  #define arch_spin_unlock_wait(lock) \
 diff --git a/arch/powerpc/include/asm/spinlock_types.h 
 b/arch/powerpc/include/asm/spinlock_types.h
 index 

Re: [PATCH v6 07/30] PCI: Pass PCI domain number combined with root bus number

2015-03-12 Thread Yijing Wang
On 2015/3/12 9:34, Bjorn Helgaas wrote:
 On Mon, Mar 09, 2015 at 10:34:04AM +0800, Yijing Wang wrote:
 Now we could pass PCI domain combined with bus number
 in u32 argu. Because in arm/arm64, PCI domain number
 is assigned by pci_bus_assign_domain_nr(). So we leave
 pci_scan_root_bus() and pci_create_root_bus() in arm/arm64
 unchanged.
 
 I'm not buying this.  If you're using this PCI_DOMBUS() thing (and I'm not
 convinced that's a good idea yet), I'm not happy with most code being
 
   pci_scan_root_bus(..., PCI_DOMBUS(hose-index, next_busno), ...)

Yes, it looks a little ugly. Which do you prefer, use a container structure or
put all args into function directly ?


 
 but ARM being
 
   pci_scan_root_bus(..., sys-busnr, ...)
 
 That just looks like a mistake.  Make ARM use PCI_DOMBUS(0, sys-busnr) if
 you want, but at least make it look like you did a thorough job.

For arm, I assumed the pci_host_assign_domain_nr() would update its domain,
but it may made the code obscure.

 
 A new function pci_host_assign_domain_nr()
 will be introduced for arm/arm64 to assign domain number
 in later patch.

 Signed-off-by: Yijing Wang wangyij...@huawei.com
 CC: Richard Henderson r...@twiddle.net
 CC: Ivan Kokshaysky i...@jurassic.park.msu.ru
 CC: Matt Turner matts...@gmail.com
 CC: Tony Luck tony.l...@intel.com
 CC: Fenghua Yu fenghua...@intel.com
 CC: Michal Simek mon...@monstr.eu
 CC: Ralf Baechle r...@linux-mips.org
 CC: Benjamin Herrenschmidt b...@kernel.crashing.org
 CC: Paul Mackerras pau...@samba.org
 CC: Michael Ellerman m...@ellerman.id.au
 CC: Sebastian Ott seb...@linux.vnet.ibm.com
 CC: Gerald Schaefer gerald.schae...@de.ibm.com
 CC: David S. Miller da...@davemloft.net
 CC: Chris Metcalf cmetc...@ezchip.com
 CC: Thomas Gleixner t...@linutronix.de
 CC: Konrad Rzeszutek Wilk konrad.w...@oracle.com
 CC: linux-al...@vger.kernel.org
 CC: linux-ker...@vger.kernel.org
 CC: linux-i...@vger.kernel.org
 CC: linux-m...@linux-mips.org
 CC: linuxppc-dev@lists.ozlabs.org
 CC: linux-s...@vger.kernel.org
 CC: linux...@vger.kernel.org
 CC: sparcli...@vger.kernel.org
 CC: xen-de...@lists.xenproject.org
 Signed-off-by: Bjorn Helgaas bhelg...@google.com
 ---
  arch/alpha/kernel/pci.c  |5 +++--
  arch/alpha/kernel/sys_nautilus.c |4 ++--
  arch/ia64/pci/pci.c  |4 ++--
  arch/ia64/sn/kernel/io_init.c|5 +++--
  arch/microblaze/pci/pci-common.c |5 +++--
  arch/mips/pci/pci.c  |4 ++--
  arch/powerpc/kernel/pci-common.c |5 +++--
  arch/s390/pci/pci.c  |5 +++--
  arch/sh/drivers/pci/pci.c|5 +++--
  arch/sparc/kernel/pci.c  |5 +++--
  arch/tile/kernel/pci.c   |5 +++--
  arch/tile/kernel/pci_gx.c|5 +++--
  arch/x86/pci/acpi.c  |7 ---
  arch/x86/pci/common.c|3 ++-
  drivers/pci/xen-pcifront.c   |5 +++--
  15 files changed, 42 insertions(+), 30 deletions(-)

 diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
 index 5c845ad..deb0a36 100644
 --- a/arch/alpha/kernel/pci.c
 +++ b/arch/alpha/kernel/pci.c
 @@ -336,8 +336,9 @@ common_init_pci(void)
  pci_add_resource_offset(resources, hose-mem_space,
  hose-mem_space-start);
  
 -bus = pci_scan_root_bus(NULL, next_busno, alpha_mv.pci_ops,
 -hose, resources);
 +bus = pci_scan_root_bus(NULL,
 +PCI_DOMBUS(hose-index, next_busno),
 +alpha_mv.pci_ops, hose, resources);
  if (!bus)
  continue;
  hose-bus = bus;
 diff --git a/arch/alpha/kernel/sys_nautilus.c 
 b/arch/alpha/kernel/sys_nautilus.c
 index 700686d..be0bbeb 100644
 --- a/arch/alpha/kernel/sys_nautilus.c
 +++ b/arch/alpha/kernel/sys_nautilus.c
 @@ -206,10 +206,10 @@ nautilus_init_pci(void)
  unsigned long memtop = max_low_pfn  PAGE_SHIFT;
  
  /* Scan our single hose.  */
 -bus = pci_scan_bus(0, alpha_mv.pci_ops, hose);
 +bus = pci_scan_bus(PCI_DOMBUS(hose-index, 0),
 +alpha_mv.pci_ops, hose);
  if (!bus)
  return;
 -
  hose-bus = bus;
  pcibios_claim_one_bus(bus);
  
 diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
 index 48cc657..675749f 100644
 --- a/arch/ia64/pci/pci.c
 +++ b/arch/ia64/pci/pci.c
 @@ -465,8 +465,8 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root 
 *root)
   * should handle the case here, but it appears that IA64 hasn't
   * such quirk. So we just ignore the case now.
   */
 -pbus = pci_create_root_bus(NULL, bus, pci_root_ops, controller,
 -   info-resources);
 +pbus = pci_create_root_bus(NULL, PCI_DOMBUS(domain, bus),
 +pci_root_ops, controller, info-resources);
  if (!pbus) {
  pci_free_resource_list(info-resources);
  __release_pci_root_info(info);
 diff --git 

Re: [RFC] powerpc: e6500 optimised copy_to_user/copy_from_user

2015-03-12 Thread Michael Ellerman
On Thu, 2015-03-12 at 17:45 -0500, Kim Phillips wrote:
 This mimics commit a66086b8197da8dc83b698642d5947ff850e708d powerpc:
 POWER7 optimised copy_to_user/copy_from_user using VMX, but for
 the e6500, or BOOK3S_64.  Changes have been made for the smaller
 cacheline size (64 bytes on e6500), and data cache block touch (dcbt)
 instructions have been rewritten to prefetch 8 lines ahead, based
 on preliminary benchmark results and perf -e L1-dcache-prefetches
 and misses observations.
 
 We see a gain of 5% in large netperf benchmarks between two T4240s,
 both in terms of throughput, and latency.  The same netperf
 lo(opback) test improves 27%.
 
 Anton's microbenchmark results show a clear linear improvement path
 with sizes 32KB and above, where, below that, the additional overhead
 over the existing copyuser_64 implementation shows its head: e.g., 6%
 for 1448 byte copies.  The observed transfer sizes under large,
 netperf benchmarks show the TCP stack is invoking copies on the
 order of a few 10's of KB, however. 1MB transfers are 30% better-off
 on wall clock time.
 
 RFC because of the following known issues:
 - unsure if PPC_BOOK3E_64 vs. PPC_BOOK3S_64 build-time switch to
   re-target __copy_tofrom_user_vmx is appropriate (ppc64_defconfig
   builds fine, however)

That's fine, a combined kernel is not really on the horizon.

 - syscalls report deficits when folding vmx_unaligned_copy to a 64B
   cacheline (undone for this RFC)
 - any consideration for the e5500?
 - asm branch label re-enumeration
 - ..I'm sure I've missed another couple of things, possibly
 including how to fix lower-sized transfer performance

Well the big issue for me is the code duplication. The diff between the
original and yours is not small, but it looks like doing a combined version
*should* be possible?

If you take out the 8 line prefetch changes it looks like it's just the
cacheline size that is the issue?

cheers



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/8] powerpc/8xx: Getting rid of CONFIG_8xx

2015-03-12 Thread Michael Ellerman
On Thu, 2015-03-12 at 16:24 +0100, Christophe Leroy wrote:
 Two config options exist to define powerpc MPC8xx:
 * CONFIG_PPC_8xx
 * CONFIG_8xx
 In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as
 communication co-processor
 
 arch/powerpc/platforms/Kconfig.cputype has contained the following
 comment about CONFIG_8xx item for some years:
 # this is temp to handle compat with arch=ppc
 
 It looks like not many places still have that old CONFIG_8xx used,
 so it is likely to be a good time to get rid of it completely ?
 
 Patchset is composed of the following patches:
 [1/8] powerpc: replace CONFIG_8xx by CONFIG_PPC_8xx
 [2/8] um: replace CONFIG_8xx by CONFIG_PPC_8xx
 [3/8] video: replace CONFIG_8xx by CONFIG_PPC_8xx
 [4/8] net: freescale: replace CONFIG_8xx by CONFIG_PPC_8xx
 [5/8] tty: cpm_uart: replace CONFIG_8xx by CONFIG_CPM1
 [6/8] mtd: replace CONFIG_8xx by CONFIG_PPC_8xx
 [7/8] isdn: replace CONFIG_8xx by CONFIG_PPC_8xx
 [8/8] powerpc: get rid of CONFIG_8xx
 
 All but the last one are independant and can be applied in any
 order. Only the 8th one requires the first 7 patches to be applied.

Sounds good.

I only see 0, 4 and 7 on linuxppc-dev for some reason.

You'll need to collect ACKs, or get the individual patches merged, and then we
can take patch 8 through the powerpc tree once those are all in - probably for
4.2.

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

new decimal conversion - seeking testers

2015-03-12 Thread Rasmus Villemoes
Hi,

I've proposed a new implementation of decimal conversion for
lib/vsprintf.c; see
http://thread.gmane.org/gmane.linux.kernel/1892035/focus=1905478.
Benchmarking so far shows 25-50% (depending on distribution of input
numbers) improvement on x86_64 and 10-30% on various 32 bit platforms.

Since the new code plays a little endianness game I would really
appreciate it if someone here would run the test and verification code
on ppc.

The code is on github, https://github.com/Villemoes/dec, and it should
be as simple as

   git clone https://github.com/Villemoes/dec.git
   cd dec
   make
   ./test   # benchmark
   ./verify # correctness

though I can't blame you if you want to inspect the code before
compiling and running something some stranger asks you to download :-)
See also the README file.

If 'make' doesn't work out-of-the-box, I'd also like to hear from you.

Thanks,
Rasmus
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: new decimal conversion - seeking testers

2015-03-12 Thread Nishanth Aravamudan
On 13.03.2015 [00:09:19 +0100], Rasmus Villemoes wrote:
 Hi,
 
 I've proposed a new implementation of decimal conversion for
 lib/vsprintf.c; see
 http://thread.gmane.org/gmane.linux.kernel/1892035/focus=1905478.
 Benchmarking so far shows 25-50% (depending on distribution of input
 numbers) improvement on x86_64 and 10-30% on various 32 bit platforms.
 
 Since the new code plays a little endianness game I would really
 appreciate it if someone here would run the test and verification code
 on ppc.
 
 The code is on github, https://github.com/Villemoes/dec, and it should
 be as simple as
 
git clone https://github.com/Villemoes/dec.git
cd dec
make
./test   # benchmark
./verify # correctness
 
 though I can't blame you if you want to inspect the code before
 compiling and running something some stranger asks you to download :-)
 See also the README file.
 
 If 'make' doesn't work out-of-the-box, I'd also like to hear from you.

On a ppc64le box:

./test 
Distribution  Function nsecs/conv   Conv/1 sec  
uniform([10, 2^64-1]) linux_put_dec   56.04 17785895
uniform([10, 2^64-1]) rv_put_dec  31.97 31190888
  +/-   -42.94%  +75.37%
3 + neg_binom(0.05)   linux_put_dec   29.55 32986465
3 + neg_binom(0.05)   rv_put_dec  24.61 39416630
  +/-   -16.71%  +19.49%
3 + neg_binom(0.10)   linux_put_dec   22.16 43993836
3 + neg_binom(0.10)   rv_put_dec  18.76 50767222
  +/-   -15.34%  +15.40%
3 + neg_binom(0.15)   linux_put_dec   18.97 51272565
3 + neg_binom(0.15)   rv_put_dec  16.18 58328176
  +/-   -14.70%  +13.76%
3 + neg_binom(0.20)   linux_put_dec   16.79 57792783
3 + neg_binom(0.20)   rv_put_dec  14.03 66418077
  +/-   -16.45%  +14.92%
3 + neg_binom(0.50)   linux_put_dec   10.81 89762669
3 + neg_binom(0.50)   rv_put_dec   9.40104336963
  +/-   -13.08%  +16.24%

./verify 
Using 16 threads
Checking [10, 100] and [18446744063709551615,
18446744073709551615]
Thread 9: low range ok
Thread 13: low range ok
Thread 10: low range ok
Thread 15: low range ok
Thread 7: low range ok
Thread 5: low range ok
Thread 14: low range ok
Thread 0: low range ok
Thread 3: low range ok
Thread 1: low range ok
Thread 2: low range ok
Thread 4: low range ok
Thread 8: low range ok
Thread 12: low range ok
Thread 6: low range ok
Thread 11: low range ok
Thread 9: high range ok
Thread 10: high range ok
Thread 7: high range ok
Thread 13: high range ok
Thread 0: high range ok
Thread 14: high range ok
Thread 15: high range ok
Thread 5: high range ok
Thread 1: high range ok
Thread 8: high range ok
Thread 11: high range ok
Thread 6: high range ok
Thread 2: high range ok
Thread 12: high range ok
Thread 3: high range ok
Thread 4: high range ok
Thread 9: mid range ok
Thread 0: mid range ok
Thread 14: mid range ok
Thread 7: mid range ok
Thread 10: mid range ok
Thread 8: mid range ok
Thread 2: mid range ok
Thread 11: mid range ok
Thread 13: mid range ok
Thread 1: mid range ok
Thread 6: mid range ok
Thread 15: mid range ok
Thread 5: mid range ok
Thread 4: mid range ok
Thread 3: mid range ok
Thread 12: mid range ok
Distribution of lengths checked:
1   5
2   101
3   900
4   9000
5   9
6   90
7   900
8   9000
9   9
10  90
11  81
12  848
13  8384
14  83808
15  838192
16  8381904
17  83819040
18  838190304
19  8381903184
20  17866643425

On a ppc64 box:

./test 
Distribution  Function nsecs/conv   Conv/1 sec  
uniform([10, 2^64-1]) linux_put_dec   48.97 20478528
uniform([10, 2^64-1]) rv_put_dec  32.14 31915074
  +/-   -34.37%  +55.85%
3 + neg_binom(0.05)   linux_put_dec   25.60 38732189
3 + neg_binom(0.05)   rv_put_dec  20.18 48828445
  +/-   -21.18%  +26.07%
3 + neg_binom(0.10)   linux_put_dec   18.70 52648284
3 + neg_binom(0.10)   rv_put_dec  15.60 62915143
  +/-   -16.56%  +19.50%
3 + neg_binom(0.15)   linux_put_dec   15.27 64695363
3 + neg_binom(0.15)   rv_put_dec  13.34 73279482
  +/-   -12.62%  +13.27%
3 + neg_binom(0.20)   linux_put_dec   13.25 74240237

Re: [PATCH] spi: fsl-spi: use of_iomap() to map parameter ram on CPM1

2015-03-12 Thread leroy christophe


Le 06/03/2015 12:44, Mark Brown a écrit :

On Wed, Mar 04, 2015 at 09:00:39AM +0100, leroy christophe wrote:

Le 03/03/2015 19:44, Mark Brown a écrit :

Why are we using of_iomap() rather than a generic I/O mapping function
here?

because all drivers for powerpc seems to be using of_iomap(), as on powerpc
the HW is described by the bootloader in a OF device tree.
Today, of_iomap() is at least used in FSL SPI, FSL UART, SPI mpc52xx, UART
mpc52xx, i2c-mpc, i2c-cpm, freescale ethernet drivers, etc 
Is it not correct ?

It's legacy, all that code is really old.  Modern code is written in as
architecture and firmware neutral a fashion as possible to make things
more consistent and maintainable.

This patch is only a small bug fix.
That driver already contains calls to of_iomap() and other related of_ 
functions.

Is it worth rewriting the driver for just a small bug fix ?

Christophe
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/2] powerpc: Enable power monitor feature in defconfig for supported platforms

2015-03-12 Thread Jia Hongtao
Signed-off-by: Jia Hongtao hongtao@freescale.com
---
 arch/powerpc/configs/corenet32_smp_defconfig | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 7370990..36970c8 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -119,6 +119,7 @@ CONFIG_SPI_GPIO=y
 CONFIG_SPI_FSL_SPI=y
 CONFIG_SPI_FSL_ESPI=y
 CONFIG_SENSORS_LM90=y
+CONFIG_SENSORS_INA2XX=y
 CONFIG_USB_HID=m
 CONFIG_USB=y
 CONFIG_USB_MON=y
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 4cfc3e8..6194a11 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -104,6 +104,7 @@ CONFIG_SPI_GPIO=y
 CONFIG_SPI_FSL_SPI=y
 CONFIG_SPI_FSL_ESPI=y
 CONFIG_SENSORS_LM90=y
+CONFIG_SENSORS_INA2XX=y
 CONFIG_USB_HID=m
 CONFIG_USB=y
 CONFIG_USB_MON=y
-- 
2.1.0.27.g96db324

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/2] powerpc: Enable thermal monitor feature in defconfig for supported platforms

2015-03-12 Thread Jia Hongtao
Signed-off-by: Jia Hongtao hongtao@freescale.com
---
 arch/powerpc/configs/corenet32_smp_defconfig | 2 +-
 arch/powerpc/configs/corenet64_smp_defconfig | 2 +-
 arch/powerpc/configs/mpc85xx_defconfig   | 3 +--
 arch/powerpc/configs/mpc85xx_smp_defconfig   | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index ca7957b..7370990 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -118,7 +118,7 @@ CONFIG_SPI=y
 CONFIG_SPI_GPIO=y
 CONFIG_SPI_FSL_SPI=y
 CONFIG_SPI_FSL_ESPI=y
-# CONFIG_HWMON is not set
+CONFIG_SENSORS_LM90=y
 CONFIG_USB_HID=m
 CONFIG_USB=y
 CONFIG_USB_MON=y
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 04737aa..4cfc3e8 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -103,7 +103,7 @@ CONFIG_SPI=y
 CONFIG_SPI_GPIO=y
 CONFIG_SPI_FSL_SPI=y
 CONFIG_SPI_FSL_ESPI=y
-# CONFIG_HWMON is not set
+CONFIG_SENSORS_LM90=y
 CONFIG_USB_HID=m
 CONFIG_USB=y
 CONFIG_USB_MON=y
diff --git a/arch/powerpc/configs/mpc85xx_defconfig 
b/arch/powerpc/configs/mpc85xx_defconfig
index 8535c34..6ecf7bd 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -150,8 +150,7 @@ CONFIG_SPI=y
 CONFIG_SPI_FSL_SPI=y
 CONFIG_SPI_FSL_ESPI=y
 CONFIG_GPIO_MPC8XXX=y
-CONFIG_HWMON=m
-CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM90=y
 CONFIG_FB=y
 CONFIG_FB_FSL_DIU=y
 # CONFIG_VGA_CONSOLE is not set
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig 
b/arch/powerpc/configs/mpc85xx_smp_defconfig
index c45ad2e..b6c7111 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -143,7 +143,7 @@ CONFIG_SPI=y
 CONFIG_SPI_FSL_SPI=y
 CONFIG_SPI_FSL_ESPI=y
 CONFIG_GPIO_MPC8XXX=y
-# CONFIG_HWMON is not set
+CONFIG_SENSORS_LM90=y
 CONFIG_FB=y
 CONFIG_FB_FSL_DIU=y
 # CONFIG_VGA_CONSOLE is not set
-- 
2.1.0.27.g96db324

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc: comvert relocs_check to a shell script using grep

2015-03-12 Thread Michael Ellerman
On Thu, 2015-03-12 at 15:10 +1100, Stephen Rothwell wrote:
 This runs a bit faster and removes another use of perl from
 the kernel build.
 
 Signed-off-by: Stephen Rothwell s...@canb.auug.org.au
 ---
  arch/powerpc/Makefile|  4 +--
  arch/powerpc/relocs_check.pl | 66 
 
  arch/powerpc/relocs_check.sh | 58 ++

Always good to see less Perl!

ShellCheck says:

   1  #!/bin/sh
   2  
   3  # Copyright © 2015 IBM Corporation
   4  
   5  # This program is free software; you can redistribute it and/or
   6  # modify it under the terms of the GNU General Public License
   7  # as published by the Free Software Foundation; either version
   8  # 2 of the License, or (at your option) any later version.
   9  
  10  # This script checks the relocations of a vmlinux for suspicious
  11  # relocations.
  12  
  13  # based on relocs_check.pl
  14  # Copyright © 2009 IBM Corporation
  15  
  16  if [ ${#*} -lt 2 ]; then
  17 printf %s [path to objdump] [path to vmlinux]\n $0 12
   ^––SC2086 Double 
quote to prevent globbing and word splitting.
   
https://github.com/koalaman/shellcheck/wiki/SC2086

  18 exit 1
  19  fi
  20  
  21  # Have Kbuild supply the path to objdump so we handle cross compilation.
  22  objdump=$1
  23  vmlinux=$2
  24  
  25  bad_relocs=$(
  26  $objdump -R $vmlinux |
  27 # Only look at relocation lines.
  28 grep -E '\R_' |
  29 # These relocations are okay
  30 # On PPC64:
  31 #   R_PPC64_RELATIVE, R_PPC64_NONE
  32 #   R_PPC64_ADDR64 mach_name
  33 # On PPC:
  34 #   R_PPC_RELATIVE, R_PPC_ADDR16_HI,
  35 #   R_PPC_ADDR16_HA,R_PPC_ADDR16_LO,
  36 #   R_PPC_NONE
  37 grep -F -w -v 'R_PPC64_RELATIVE
  38  R_PPC64_NONE
  39  R_PPC_ADDR16_LO
  40  R_PPC_ADDR16_HI
  41  R_PPC_ADDR16_HA
  42  R_PPC_RELATIVE
  43  R_PPC_NONE' |
  44 grep -E -v '\R_PPC64_ADDR64[[:space:]]+mach_'
  45  )
  46  
  47  if [ -z $bad_relocs ]; then
  48 exit 0
  49  fi
  50  
  51  printf WARNING: %d bad relocations\n $(printf $bad_relocs\n | wc -l)
 ^––SC2046 Quote this to prevent 
word splitting.
 
https://github.com/koalaman/shellcheck/wiki/SC2046
  ^––SC2059 Don't use 
variables in the printf format string. Use printf ..%s.. $foo.
  
https://github.com/koalaman/shellcheck/wiki/SC2059
  52  printf $bad_relocs\n
 ^––SC2059 Don't use variables in the printf format string. Use 
printf ..%s.. $foo.
 https://github.com/koalaman/shellcheck/wiki/SC2059
  53  
  54  # If we see this type of relocation it's an idication that
  55  # we /may/ be using an old version of binutils.
  56  if echo $bad_relocs\n | grep -q -F -w R_PPC64_UADDR64; then
  ^––SC2028 echo won't expand escape sequences. 
Consider printf.
  https://github.com/koalaman/shellcheck/wiki/SC2028
  57 printf WARNING: You need at least binutils = 2.19 to build a 
CONFIG_RELOCATABLE kernel\n
  58  fi
  59


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/powernv: Remove powernv RTAS support

2015-03-12 Thread Michael Ellerman
The powernv code has some conditional support for running on bare metal
machines that have no OPAL firmware, but provide RTAS.

No released machines ever supported that, and even in the lab it was
just a transitional hack in the days when OPAL was still being
developed.

So remove the code.

Signed-off-by: Michael Ellerman m...@ellerman.id.au
---
 arch/powerpc/platforms/powernv/Kconfig |  7 ---
 arch/powerpc/platforms/powernv/pci.c   | 98 +++---
 arch/powerpc/platforms/powernv/setup.c | 19 ---
 arch/powerpc/platforms/powernv/smp.c   | 13 -
 4 files changed, 19 insertions(+), 118 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/Kconfig 
b/arch/powerpc/platforms/powernv/Kconfig
index 45a8ed0585cd..4b044d8cb49a 100644
--- a/arch/powerpc/platforms/powernv/Kconfig
+++ b/arch/powerpc/platforms/powernv/Kconfig
@@ -19,10 +19,3 @@ config PPC_POWERNV
select CPU_FREQ_GOV_CONSERVATIVE
select PPC_DOORBELL
default y
-
-config PPC_POWERNV_RTAS
-   depends on PPC_POWERNV
-   bool Support for RTAS based PowerNV platforms such as BML
-   default y
-   select PPC_ICS_RTAS
-   select PPC_RTAS
diff --git a/arch/powerpc/platforms/powernv/pci.c 
b/arch/powerpc/platforms/powernv/pci.c
index 54323d6b5166..c8939ad221f9 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -679,66 +679,13 @@ void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
tbl-it_type = TCE_PCI;
 }
 
-static struct iommu_table *pnv_pci_setup_bml_iommu(struct pci_controller *hose)
-{
-   struct iommu_table *tbl;
-   const __be64 *basep, *swinvp;
-   const __be32 *sizep;
-
-   basep = of_get_property(hose-dn, linux,tce-base, NULL);
-   sizep = of_get_property(hose-dn, linux,tce-size, NULL);
-   if (basep == NULL || sizep == NULL) {
-   pr_err(PCI: %s has missing tce entries !\n,
-  hose-dn-full_name);
-   return NULL;
-   }
-   tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, hose-node);
-   if (WARN_ON(!tbl))
-   return NULL;
-   pnv_pci_setup_iommu_table(tbl, __va(be64_to_cpup(basep)),
- be32_to_cpup(sizep), 0, IOMMU_PAGE_SHIFT_4K);
-   iommu_init_table(tbl, hose-node);
-   iommu_register_group(tbl, pci_domain_nr(hose-bus), 0);
-
-   /* Deal with SW invalidated TCEs when needed (BML way) */
-   swinvp = of_get_property(hose-dn, linux,tce-sw-invalidate-info,
-NULL);
-   if (swinvp) {
-   tbl-it_busno = be64_to_cpu(swinvp[1]);
-   tbl-it_index = (unsigned long)ioremap(be64_to_cpup(swinvp), 8);
-   tbl-it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
-   }
-   return tbl;
-}
-
-static void pnv_pci_dma_fallback_setup(struct pci_controller *hose,
-  struct pci_dev *pdev)
-{
-   struct device_node *np = pci_bus_to_OF_node(hose-bus);
-   struct pci_dn *pdn;
-
-   if (np == NULL)
-   return;
-   pdn = PCI_DN(np);
-   if (!pdn-iommu_table)
-   pdn-iommu_table = pnv_pci_setup_bml_iommu(hose);
-   if (!pdn-iommu_table)
-   return;
-   set_iommu_table_base_and_group(pdev-dev, pdn-iommu_table);
-}
-
 static void pnv_pci_dma_dev_setup(struct pci_dev *pdev)
 {
struct pci_controller *hose = pci_bus_to_host(pdev-bus);
struct pnv_phb *phb = hose-private_data;
 
-   /* If we have no phb structure, try to setup a fallback based on
-* the device-tree (RTAS PCI for example)
-*/
if (phb  phb-dma_dev_setup)
phb-dma_dev_setup(phb, pdev);
-   else
-   pnv_pci_dma_fallback_setup(hose, pdev);
 }
 
 int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)
@@ -784,38 +731,31 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x3b9, 
pnv_p7ioc_rc_quirk);
 void __init pnv_pci_init(void)
 {
struct device_node *np;
+   bool found_ioda = false;
 
pci_add_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
-   /* OPAL absent, try POPAL first then RTAS detection of PHBs */
-   if (!firmware_has_feature(FW_FEATURE_OPAL)) {
-#ifdef CONFIG_PPC_POWERNV_RTAS
-   init_pci_config_tokens();
-   find_and_init_phbs();
-#endif /* CONFIG_PPC_POWERNV_RTAS */
-   }
-   /* OPAL is here, do our normal stuff */
-   else {
-   int found_ioda = 0;
+   /* If we don't have OPAL, eg. in sim, just skip PCI probe */
+   if (!firmware_has_feature(FW_FEATURE_OPAL))
+   return;
 
-   /* Look for IODA IO-Hubs. We don't support mixing IODA
-* and p5ioc2 due to the need to change some global
-* probing flags
-*/
-   for_each_compatible_node(np, NULL, ibm,ioda-hub) {
-   pnv_pci_init_ioda_hub(np);
-