Re: [PATCH] of: Fix comparison of reserved memory regions

2015-12-05 Thread Michael Ellerman


On 5 December 2015 04:07:39 GMT+11:00, Mitchel Humpherys 
 wrote:
>On Wed, Nov 18 2015 at 09:46:38 PM, Michael Ellerman
> wrote:
>> In order to check for overlapping reserved memory regions, we first
>need
>> to sort the array of memory regions. This is implemented using
>sort(),
>> and a custom comparison function __rmem_cmp().
>>
>> Unfortunatley __rmem_cmp() doesn't work in all cases. Because the two
>> base values are phys_addr_t, they may be u64 on some platforms, in
>which
>> case subtracting one from the other and then (implicitly) casting to
>int
>> does not give us the -ve/0/+ve value we need.
>>
>> This leads to incorrect reports about overlaps, eg:
>>
>>   ibm,slw-image@1ffe60 (0x001ffe60--0x001ffe70)
>overlaps with
>>   ibm,firmware-allocs-memory@10
>(0x0010--0x001000dc0200)
>>
>> Fix it by just doing the standard double if and return 0 logic.
>>
>> Fixes: ae1add247bf8 ("of: Check for overlap in reserved memory
>regions")
>> Signed-off-by: Michael Ellerman 
>> ---
>>  drivers/of/of_reserved_mem.c | 8 +++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>
>Woops, thanks.
>
>Tested-by: Mitchel Humpherys 

Thanks for testing.

Rob, can we get this merged for 4.4 please?

cheers 

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 3/5] powerpc: ftrace: fix the comments for ftrace_modify_code

2015-12-05 Thread Li Bin
There is no need to worry about module and __init text disappearing
case, because that ftrace has a module notifier that is called when
a module is being unloaded and before the text goes away and this
code grabs the ftrace_lock mutex and removes the module functions
from the ftrace list, such that it will no longer do any
modifications to that module's text, the update to make functions
be traced or not is done under the ftrace_lock mutex as well.
And by now, __init section codes should not been modified
by ftrace, because it is black listed in recordmcount.c and
ignored by ftrace.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
Suggested-by: Steven Rostedt 
Signed-off-by: Li Bin 
---
 arch/powerpc/kernel/ftrace.c |   12 +---
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 44d4d8e..83e3c88 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -47,13 +47,11 @@ ftrace_modify_code(unsigned long ip, unsigned int old, 
unsigned int new)
unsigned int replaced;
 
/*
-* Note: Due to modules and __init, code can
-*  disappear and change, we need to protect against faulting
-*  as well as code changing. We do this by using the
-*  probe_kernel_* functions.
-*
-* No real locking needed, this code is run through
-* kstop_machine, or before SMP starts.
+* Note:
+* We are paranoid about modifying text, as if a bug was to happen, it
+* could cause us to read or write to someplace that could cause harm.
+* Carefully read and modify the code with probe_kernel_*(), and make
+* sure what we read is what we expected it to be before modifying it.
 */
 
/* read the text we want to modify */
-- 
1.7.1

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

[PATCH v2 0/5] ftrace: fix ftrace misleading comments for arch using it

2015-12-05 Thread Li Bin
Fix the following similar misleading comments of ftrace for arch
ia64/metag/powerpc/sh/x86:

Note: Due to modules and __init, code can
 disappear and change, we need to protect against faulting
 as well as code changing. We do this by using the
 probe_kernel_* functions.

No real locking needed, this code is run through
kstop_machine, or before SMP starts.

Cc: Tony Luck 
Cc: Fenghua Yu 
Cc: linux-i...@vger.kernel.org
Cc: James Hogan 
Cc: linux-me...@vger.kernel.org
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman  
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux...@vger.kernel.org
Cc: Thomas Gleixner 
"Cc: H. Peter Anvin" 
Cc: x...@kernel.org

Li Bin (5):
  ia64: ftrace: fix the comments for ftrace_modify_code
  metag: ftrace: fix the comments for ftrace_modify_code
  powerpc: ftrace: fix the comments for ftrace_modify_code
  sh: ftrace: fix the comments for ftrace_modify_code
  x86: ftrace: fix the comments for ftrace_modify_code_direct

 arch/ia64/kernel/ftrace.c|   12 +---
 arch/metag/kernel/ftrace.c   |   11 +--
 arch/powerpc/kernel/ftrace.c |   12 +---
 arch/sh/kernel/ftrace.c  |   12 +---
 arch/x86/kernel/ftrace.c |   12 +---
 5 files changed, 25 insertions(+), 34 deletions(-)

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

Re: [PATCH net-next] Driver for IBM System i/p VNIC protocol

2015-12-05 Thread David Miller
From: Thomas Falcon 
Date: Fri,  4 Dec 2015 11:49:46 -0600

> +static int ibmvnic_buffs_per_pool = IBMVNIC_BUFFS_PER_POOL;
> +module_param(ibmvnic_buffs_per_pool, int, S_IRUGO);
> +MODULE_PARM_DESC(ibmvnic_buffs_per_pool,
> +  "IBMVNIC number of buffers per rx pool");

Please do not use module parameters for settings that effect
the basic operation of the driver.

Instead use facilities that are generic and provide the same
user interface for all networking drivers, such as ethtool.

Otherwise users would need to learn a different way to configure the
same thing on different devices, which is not acceptable.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

crypto/nx842: Ignore queue overflow informative error

2015-12-05 Thread Haren Myneni

NX842 coprocessor sets bit 3 if queue is overflow. It is just for
information to the user. So the driver prints this informative message
and ignores it.

Signed-off-by: Haren Myneni 

diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h
index 9f8402b..d1a2a2d 100644
--- a/arch/powerpc/include/asm/icswx.h
+++ b/arch/powerpc/include/asm/icswx.h
@@ -164,6 +164,7 @@ struct coprocessor_request_block {
 #define ICSWX_INITIATED(0x8)
 #define ICSWX_BUSY (0x4)
 #define ICSWX_REJECTED (0x2)
+#define ICSWX_BIT3 (0x1)   /* undefined or set from XERSO. */
 
 static inline int icswx(__be32 ccw, struct coprocessor_request_block *crb)
 {
diff --git a/drivers/crypto/nx/nx-842-powernv.c 
b/drivers/crypto/nx/nx-842-powernv.c
index 9ef51fa..321b8e8 100644
--- a/drivers/crypto/nx/nx-842-powernv.c
+++ b/drivers/crypto/nx/nx-842-powernv.c
@@ -442,6 +442,15 @@ static int nx842_powernv_function(const unsigned char *in, 
unsigned int inlen,
 (unsigned int)ccw,
 (unsigned int)be32_to_cpu(crb->ccw));
 
+   /*
+* NX842 coprocessor uses 3rd bit to report queue overflow which is
+* not an error, just for information to user. So, ignore this bit.
+*/
+   if (ret & ICSWX_BIT3) {
+   pr_info_ratelimited("842 coprocessor queue overflow\n");
+   ret &= ~ICSWX_BIT3;
+   }
+
switch (ret) {
case ICSWX_INITIATED:
ret = wait_for_csb(wmem, csb);


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