Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-09-02 Thread Pranith Kumar
On Tue, Sep 2, 2014 at 12:08 PM, Paul E. McKenney
 wrote:

> Could you please adjust in this way?  Again, the point is to be the
> first few items in a full set of permutations, not to illustrate selected
> orderings/outcomes.
>

OK, if that is the case then replacing x with y is much easier. I will
send an updated patch. Thanks!

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] sh: Fix build error caused by missing dependencies

2014-09-02 Thread Pranith Kumar
Fix a sh4-randconfig build failure which has the following splat:

arch/sh/mm/cache-sh4.c:99:17: error: 'cached_to_uncached' undeclared (first use 
in this function)
arch/sh/mm/cache-sh4.c:192:2: error: implicit declaration of function 
'cpu_context' [-Werror=implicit-function-declaration]

These errors are caused by missing dependencies on UNCACHED_MAPPING and MMU.

Reported-by: Geert Uytterhoeven 
Signed-off-by: Pranith Kumar 
---
 arch/sh/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 244fb4c..619d5eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -194,6 +194,8 @@ config CPU_SH4
select SH_INTC
select SYS_SUPPORTS_SH_TMU
select SYS_SUPPORTS_HUGETLBFS if MMU
+   select UNCACHED_MAPPING
+   select MMU
 
 config CPU_SH4A
bool
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] sh: Fix build error caused by missing dependencies

2014-09-02 Thread Pranith Kumar
Fix a sh4-randconfig build failure which has the following splat:

arch/sh/mm/cache-sh4.c:99:17: error: 'cached_to_uncached' undeclared (first use 
in this function)
arch/sh/mm/cache-sh4.c:192:2: error: implicit declaration of function 
'cpu_context' [-Werror=implicit-function-declaration]

These errors are caused by missing dependencies on UNCACHED_MAPPING and MMU.

Reported-by: Geert Uytterhoeven ge...@linux-m68k.org
Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/sh/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 244fb4c..619d5eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -194,6 +194,8 @@ config CPU_SH4
select SH_INTC
select SYS_SUPPORTS_SH_TMU
select SYS_SUPPORTS_HUGETLBFS if MMU
+   select UNCACHED_MAPPING
+   select MMU
 
 config CPU_SH4A
bool
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-09-02 Thread Pranith Kumar
On Tue, Sep 2, 2014 at 12:08 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 Could you please adjust in this way?  Again, the point is to be the
 first few items in a full set of permutations, not to illustrate selected
 orderings/outcomes.


OK, if that is the case then replacing x with y is much easier. I will
send an updated patch. Thanks!

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] doc: memory-barriers.txt: Correct example for reorderings

2014-09-02 Thread Pranith Kumar
Correct the example of memory orderings in memory-barriers.txt

Commit 615cc2c9cf95 Documentation/memory-barriers.txt: fix important typo re
memory barriers changed the assignment to x and y. Change the rest of the
example to match this change.

Reported-by: Ganesh Rapolu ganesh.rap...@hotmail.com
Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 Documentation/memory-barriers.txt | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/memory-barriers.txt 
b/Documentation/memory-barriers.txt
index a4de88f..02f5de8 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -121,22 +121,22 @@ For example, consider the following sequence of events:
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
 
-   STORE A=3,  STORE B=4,  x=LOAD A-3,y=LOAD B-4
-   STORE A=3,  STORE B=4,  y=LOAD B-4,x=LOAD A-3
-   STORE A=3,  x=LOAD A-3,STORE B=4,  y=LOAD B-4
-   STORE A=3,  x=LOAD A-3,y=LOAD B-2,STORE B=4
-   STORE A=3,  y=LOAD B-2,STORE B=4,  x=LOAD A-3
-   STORE A=3,  y=LOAD B-2,x=LOAD A-3,STORE B=4
-   STORE B=4,  STORE A=3,  x=LOAD A-3,y=LOAD B-4
+   STORE A=3,  STORE B=4,  y=LOAD A-3,x=LOAD B-4
+   STORE A=3,  STORE B=4,  x=LOAD B-4,y=LOAD A-3
+   STORE A=3,  y=LOAD A-3,STORE B=4,  x=LOAD B-4
+   STORE A=3,  y=LOAD A-3,x=LOAD B-2,STORE B=4
+   STORE A=3,  x=LOAD B-2,STORE B=4,  y=LOAD A-3
+   STORE A=3,  x=LOAD B-2,y=LOAD A-3,STORE B=4
+   STORE B=4,  STORE A=3,  y=LOAD A-3,x=LOAD B-4
STORE B=4, ...
...
 
 and can thus result in four different combinations of values:
 
-   x == 1, y == 2
-   x == 1, y == 4
-   x == 3, y == 2
-   x == 3, y == 4
+   x == 2, y == 1
+   x == 2, y == 3
+   x == 4, y == 1
+   x == 4, y == 3
 
 
 Furthermore, the stores committed by a CPU to the memory system may not be
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Bogus error in checkpatch.pl

2014-09-02 Thread Pranith Kumar
I receive an ERROR when running checkpatch.pl on a patch containing
the following line:

Commit 615cc2c9cf95 Documentation/memory-barriers.txt: fix important typo re

saying that the commit ID should be 12 or more characters when the
commit ID is indeed 12 characters. I tried fixing it, but my perl is
not up-to-par.

Please fix! Thanks.

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Bogus error in checkpatch.pl

2014-09-02 Thread Pranith Kumar
Hi Joe,

On Wed, Sep 3, 2014 at 12:25 AM, Joe Perches j...@perches.com wrote:

 You need to use parentheses around the description like:
 commit commitid (commit description)

 For your case:

 Commit 615cc2c9cf95 (Documentation/memory-barriers.txt: fix important
 typo re memory barriers)


Ah, OK. But the error message does not say anything about missing
paranetheses and only stresses on chars in the id:

$ ./scripts/checkpatch.pl
patch_dir/0001-doc-memory-barriers.txt-Correct-example-for-reorderi.patch
ERROR: Please use 12 or more chars for the git commit ID like: 'Commit
615cc2c9cf95 (Documentation/memory-barriers.txt: fix important typo
re memory barriers)'
#8:
Commit 615cc2c9cf95 Documentation/memory-barriers.txt: fix important typo re


Is it possible to make it a bit clearer, perhaps?

Thanks!
-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Wire up three sys calls

2014-09-01 Thread Pranith Kumar
This patch wires up three new syscalls for powerpc. The three
new syscalls are seccomp, getrandom and memfd_create.

Signed-off-by: Pranith Kumar 
Reviewed-by: David Herrmann 
---
 arch/powerpc/include/asm/systbl.h  | 3 +++
 arch/powerpc/include/asm/unistd.h  | 2 +-
 arch/powerpc/include/uapi/asm/unistd.h | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/systbl.h 
b/arch/powerpc/include/asm/systbl.h
index 542bc0f..7d8a600 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */
 SYSCALL_SPU(sched_setattr)
 SYSCALL_SPU(sched_getattr)
 SYSCALL_SPU(renameat2)
+SYSCALL_SPU(seccomp)
+SYSCALL_SPU(getrandom)
+SYSCALL_SPU(memfd_create)
diff --git a/arch/powerpc/include/asm/unistd.h 
b/arch/powerpc/include/asm/unistd.h
index 5ce5552..4e9af3f 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -12,7 +12,7 @@
 #include 
 
 
-#define __NR_syscalls  358
+#define __NR_syscalls  361
 
 #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 2d526f7..0688fc0 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -380,5 +380,8 @@
 #define __NR_sched_setattr 355
 #define __NR_sched_getattr 356
 #define __NR_renameat2 357
+#define __NR_seccomp   358
+#define __NR_getrandom 359
+#define __NR_memfd_create  360
 
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-09-01 Thread Pranith Kumar
On Mon, Sep 1, 2014 at 11:31 AM, David Herrmann  wrote:

>
> Btw., the original patch (wire up syscalls) can be applied unchanged.
>

Great! Can I use that as an Ack-by? I will send in the patch with
updated changelog.


-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] memfd_test: Make it work on 32-bit systems

2014-09-01 Thread Pranith Kumar
This test currently fails on 32-bit systems since we use u64 type to pass the
flags to fcntl.

This commit changes this to use 'unsigned int' type for flags to fcntl making it
work on 32-bit systems.

Signed-off-by: Pranith Kumar 
---
v2: use 'unsigned int' instead of u32

 tools/testing/selftests/memfd/memfd_test.c | 30 ++
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/memfd/memfd_test.c 
b/tools/testing/selftests/memfd/memfd_test.c
index 3634c90..6f1385a 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -59,9 +59,9 @@ static void mfd_fail_new(const char *name, unsigned int flags)
}
 }
 
-static __u64 mfd_assert_get_seals(int fd)
+static int mfd_assert_get_seals(int fd)
 {
-   long r;
+   int r;
 
r = fcntl(fd, F_GET_SEALS);
if (r < 0) {
@@ -72,36 +72,34 @@ static __u64 mfd_assert_get_seals(int fd)
return r;
 }
 
-static void mfd_assert_has_seals(int fd, __u64 seals)
+static void mfd_assert_has_seals(int fd, unsigned int seals)
 {
-   __u64 s;
+   int s;
 
s = mfd_assert_get_seals(fd);
if (s != seals) {
-   printf("%llu != %llu = GET_SEALS(%d)\n",
-  (unsigned long long)seals, (unsigned long long)s, fd);
+   printf("%u != %u = GET_SEALS(%d)\n",
+   seals, (unsigned int)s, fd);
abort();
}
 }
 
-static void mfd_assert_add_seals(int fd, __u64 seals)
+static void mfd_assert_add_seals(int fd, unsigned int seals)
 {
-   long r;
-   __u64 s;
+   int r, s;
 
s = mfd_assert_get_seals(fd);
r = fcntl(fd, F_ADD_SEALS, seals);
if (r < 0) {
-   printf("ADD_SEALS(%d, %llu -> %llu) failed: %m\n",
-  fd, (unsigned long long)s, (unsigned long long)seals);
+   printf("ADD_SEALS(%d, %u -> %u) failed: %m\n",
+   fd, (unsigned int)s, seals);
abort();
}
 }
 
-static void mfd_fail_add_seals(int fd, __u64 seals)
+static void mfd_fail_add_seals(int fd, unsigned int seals)
 {
-   long r;
-   __u64 s;
+   int r, s;
 
r = fcntl(fd, F_GET_SEALS);
if (r < 0)
@@ -111,8 +109,8 @@ static void mfd_fail_add_seals(int fd, __u64 seals)
 
r = fcntl(fd, F_ADD_SEALS, seals);
if (r >= 0) {
-   printf("ADD_SEALS(%d, %llu -> %llu) didn't fail as expected\n",
-  fd, (unsigned long long)s, (unsigned long long)seals);
+   printf("ADD_SEALS(%d, %u -> %u) didn't fail as expected\n",
+   fd, (unsigned int)s, seals);
abort();
}
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-09-01 Thread Pranith Kumar
Hi David,

On Mon, Sep 1, 2014 at 7:33 AM, David Herrmann  wrote:
>
> Nice catch. We changed 'flags' from u64 to "unsigned int" in the last
> revision of the series. Patch looks good, but I'd prefer using
> "unsigned int" as type, instead of __u32. Just to be consistent with
> the syscall interface. The return type of F_GET_SEALS is actually
> "int" and the MSB is reserved for signed error codes, so you can
> savely use "int r = fcntl(fd, F_GET_SEALS, 0)" in
> mfd_assert_get_seals().
>

OK. Should I send a new patch with these changes or do you have one
line up already?

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-09-01 Thread Pranith Kumar
Hi David,

On Mon, Sep 1, 2014 at 7:33 AM, David Herrmann dh.herrm...@gmail.com wrote:

 Nice catch. We changed 'flags' from u64 to unsigned int in the last
 revision of the series. Patch looks good, but I'd prefer using
 unsigned int as type, instead of __u32. Just to be consistent with
 the syscall interface. The return type of F_GET_SEALS is actually
 int and the MSB is reserved for signed error codes, so you can
 savely use int r = fcntl(fd, F_GET_SEALS, 0) in
 mfd_assert_get_seals().


OK. Should I send a new patch with these changes or do you have one
line up already?

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] memfd_test: Make it work on 32-bit systems

2014-09-01 Thread Pranith Kumar
This test currently fails on 32-bit systems since we use u64 type to pass the
flags to fcntl.

This commit changes this to use 'unsigned int' type for flags to fcntl making it
work on 32-bit systems.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
v2: use 'unsigned int' instead of u32

 tools/testing/selftests/memfd/memfd_test.c | 30 ++
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/memfd/memfd_test.c 
b/tools/testing/selftests/memfd/memfd_test.c
index 3634c90..6f1385a 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -59,9 +59,9 @@ static void mfd_fail_new(const char *name, unsigned int flags)
}
 }
 
-static __u64 mfd_assert_get_seals(int fd)
+static int mfd_assert_get_seals(int fd)
 {
-   long r;
+   int r;
 
r = fcntl(fd, F_GET_SEALS);
if (r  0) {
@@ -72,36 +72,34 @@ static __u64 mfd_assert_get_seals(int fd)
return r;
 }
 
-static void mfd_assert_has_seals(int fd, __u64 seals)
+static void mfd_assert_has_seals(int fd, unsigned int seals)
 {
-   __u64 s;
+   int s;
 
s = mfd_assert_get_seals(fd);
if (s != seals) {
-   printf(%llu != %llu = GET_SEALS(%d)\n,
-  (unsigned long long)seals, (unsigned long long)s, fd);
+   printf(%u != %u = GET_SEALS(%d)\n,
+   seals, (unsigned int)s, fd);
abort();
}
 }
 
-static void mfd_assert_add_seals(int fd, __u64 seals)
+static void mfd_assert_add_seals(int fd, unsigned int seals)
 {
-   long r;
-   __u64 s;
+   int r, s;
 
s = mfd_assert_get_seals(fd);
r = fcntl(fd, F_ADD_SEALS, seals);
if (r  0) {
-   printf(ADD_SEALS(%d, %llu - %llu) failed: %m\n,
-  fd, (unsigned long long)s, (unsigned long long)seals);
+   printf(ADD_SEALS(%d, %u - %u) failed: %m\n,
+   fd, (unsigned int)s, seals);
abort();
}
 }
 
-static void mfd_fail_add_seals(int fd, __u64 seals)
+static void mfd_fail_add_seals(int fd, unsigned int seals)
 {
-   long r;
-   __u64 s;
+   int r, s;
 
r = fcntl(fd, F_GET_SEALS);
if (r  0)
@@ -111,8 +109,8 @@ static void mfd_fail_add_seals(int fd, __u64 seals)
 
r = fcntl(fd, F_ADD_SEALS, seals);
if (r = 0) {
-   printf(ADD_SEALS(%d, %llu - %llu) didn't fail as expected\n,
-  fd, (unsigned long long)s, (unsigned long long)seals);
+   printf(ADD_SEALS(%d, %u - %u) didn't fail as expected\n,
+   fd, (unsigned int)s, seals);
abort();
}
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-09-01 Thread Pranith Kumar
On Mon, Sep 1, 2014 at 11:31 AM, David Herrmann dh.herrm...@gmail.com wrote:


 Btw., the original patch (wire up syscalls) can be applied unchanged.


Great! Can I use that as an Ack-by? I will send in the patch with
updated changelog.


-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Wire up three sys calls

2014-09-01 Thread Pranith Kumar
This patch wires up three new syscalls for powerpc. The three
new syscalls are seccomp, getrandom and memfd_create.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
Reviewed-by: David Herrmann dh.herrm...@gmail.com
---
 arch/powerpc/include/asm/systbl.h  | 3 +++
 arch/powerpc/include/asm/unistd.h  | 2 +-
 arch/powerpc/include/uapi/asm/unistd.h | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/systbl.h 
b/arch/powerpc/include/asm/systbl.h
index 542bc0f..7d8a600 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */
 SYSCALL_SPU(sched_setattr)
 SYSCALL_SPU(sched_getattr)
 SYSCALL_SPU(renameat2)
+SYSCALL_SPU(seccomp)
+SYSCALL_SPU(getrandom)
+SYSCALL_SPU(memfd_create)
diff --git a/arch/powerpc/include/asm/unistd.h 
b/arch/powerpc/include/asm/unistd.h
index 5ce5552..4e9af3f 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  358
+#define __NR_syscalls  361
 
 #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 2d526f7..0688fc0 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -380,5 +380,8 @@
 #define __NR_sched_setattr 355
 #define __NR_sched_getattr 356
 #define __NR_renameat2 357
+#define __NR_seccomp   358
+#define __NR_getrandom 359
+#define __NR_memfd_create  360
 
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] memfd_test: Add missing argument to printf()

2014-08-31 Thread Pranith Kumar
Add a missing path argument buf to printf() 

Signed-off-by: Pranith Kumar 
---
 tools/testing/selftests/memfd/memfd_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/memfd/memfd_test.c 
b/tools/testing/selftests/memfd/memfd_test.c
index 3634c90..c343df8 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -205,7 +205,7 @@ static void mfd_fail_open(int fd, int flags, mode_t mode)
sprintf(buf, "/proc/self/fd/%d", fd);
r = open(buf, flags, mode);
if (r >= 0) {
-   printf("open(%s) didn't fail as expected\n");
+   printf("open(%s) didn't fail as expected\n", buf);
abort();
}
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-08-31 Thread Pranith Kumar

On 08/31/2014 10:34 AM, David Herrmann wrote:
> The only arch-dependent code for memfd_test.c is the syscall invocation:
> memfd_create(const char *name, unsigned int flags);
> via glibc as:
> syscall(__NR_memfd_create, name, flags);
>
> Can you debug your test-run (maybe via simple printk() in mm/shmem.c
> memfd_create()) and see what's going wrong there?
>
Hi David,

I figured out the problem. I am on a 32-bit system and using u64 for flags in 
fcntl() is the cause of the problem. Will you accept a patch making the test 
work on 32-bit systems as below?

Thanks!
--
Pranith

From: Pranith Kumar 
Date: Sun, 31 Aug 2014 13:38:07 -0400
Subject: [PATCH] memfd_test: Make it work on 32-bit systems

This test currently fails on 32-bit systems since we use u64 type to pass the
flags to fcntl.

This commit changes this to use u32 type for flags to fcntl making it work on
32-bit systems.

Signed-off-by: Pranith Kumar 
---
 tools/testing/selftests/memfd/memfd_test.c | 32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/memfd/memfd_test.c 
b/tools/testing/selftests/memfd/memfd_test.c
index 3634c90..77e56ff 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -59,9 +59,9 @@ static void mfd_fail_new(const char *name, unsigned int flags)
 }
 }
 
-static __u64 mfd_assert_get_seals(int fd)
+static __u32 mfd_assert_get_seals(int fd)
 {
-long r;
+int r;
 
 r = fcntl(fd, F_GET_SEALS);
 if (r < 0) {
@@ -72,36 +72,36 @@ static __u64 mfd_assert_get_seals(int fd)
 return r;
 }
 
-static void mfd_assert_has_seals(int fd, __u64 seals)
+static void mfd_assert_has_seals(int fd, __u32 seals)
 {
-__u64 s;
+__u32 s;
 
 s = mfd_assert_get_seals(fd);
 if (s != seals) {
-printf("%llu != %llu = GET_SEALS(%d)\n",
-   (unsigned long long)seals, (unsigned long long)s, fd);
+printf("%lu != %lu = GET_SEALS(%d)\n",
+   (unsigned long)seals, (unsigned long)s, fd);
 abort();
 }
 }
 
-static void mfd_assert_add_seals(int fd, __u64 seals)
+static void mfd_assert_add_seals(int fd, __u32 seals)
 {
-long r;
-__u64 s;
+int r;
+__u32 s;
 
 s = mfd_assert_get_seals(fd);
 r = fcntl(fd, F_ADD_SEALS, seals);
 if (r < 0) {
-printf("ADD_SEALS(%d, %llu -> %llu) failed: %m\n",
-   fd, (unsigned long long)s, (unsigned long long)seals);
+printf("ADD_SEALS(%d, %lu -> %lu) failed: %m\n",
+   fd, (unsigned long)s, (unsigned long)seals);
 abort();
 }
 }
 
-static void mfd_fail_add_seals(int fd, __u64 seals)
+static void mfd_fail_add_seals(int fd, __u32 seals)
 {
-long r;
-__u64 s;
+int r;
+__u32 s;
 
 r = fcntl(fd, F_GET_SEALS);
 if (r < 0)
@@ -111,8 +111,8 @@ static void mfd_fail_add_seals(int fd, __u64 seals)
 
 r = fcntl(fd, F_ADD_SEALS, seals);
 if (r >= 0) {
-printf("ADD_SEALS(%d, %llu -> %llu) didn't fail as expected\n",
-   fd, (unsigned long long)s, (unsigned long long)seals);
+printf("ADD_SEALS(%d, %lu -> %lu) didn't fail as expected\n",
+   fd, (unsigned long)s, (unsigned long)seals);
 abort();
 }
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-08-31 Thread Pranith Kumar
Hi Geert,

On Sun, Aug 31, 2014 at 4:53 AM, Geert Uytterhoeven
 wrote:
> Hi Pranith,
>
> On Sat, Aug 30, 2014 at 5:36 AM, Pranith Kumar  wrote:
>> I see that the three syscalls seccomp, getrandom and memfd_create are not 
>> wired
>> because of which we get a warning while compilation.
>>
>> So I wired them up in this patch. What else needs to be done? I tried the
>> memfd_test after compiling this kernel, but it is failing. What am I missing 
>> for
>> this to work? Any advice is really appreciated! :)
>
> Did it fail due to the (silly) "ifeq ($(ARCH),X86)" checks in
> tools/testing/selftests/memfd/Makefile?
>

I removed that check and compiled memfd_test.c by hand. This is the
following error which I get when I run the test:

$ ./memfd_test
memfd: CREATE
memfd: BASIC
10 != 0 = GET_SEALS(3)
Aborted

This is basically when checking the seals which we already added. It
should return 10 (F_SEAL_SHRINK | F_SEAL_WRITE), instead it is returning 0.

What else needs to be done for this to properly work? I see that for
m68k, you just wired it up like in this patch. Did it work after that?

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-08-31 Thread Pranith Kumar
Hi Geert,

On Sun, Aug 31, 2014 at 4:53 AM, Geert Uytterhoeven
ge...@linux-m68k.org wrote:
 Hi Pranith,

 On Sat, Aug 30, 2014 at 5:36 AM, Pranith Kumar bobby.pr...@gmail.com wrote:
 I see that the three syscalls seccomp, getrandom and memfd_create are not 
 wired
 because of which we get a warning while compilation.

 So I wired them up in this patch. What else needs to be done? I tried the
 memfd_test after compiling this kernel, but it is failing. What am I missing 
 for
 this to work? Any advice is really appreciated! :)

 Did it fail due to the (silly) ifeq ($(ARCH),X86) checks in
 tools/testing/selftests/memfd/Makefile?


I removed that check and compiled memfd_test.c by hand. This is the
following error which I get when I run the test:

$ ./memfd_test
memfd: CREATE
memfd: BASIC
10 != 0 = GET_SEALS(3)
Aborted

This is basically when checking the seals which we already added. It
should return 10 (F_SEAL_SHRINK | F_SEAL_WRITE), instead it is returning 0.

What else needs to be done for this to properly work? I see that for
m68k, you just wired it up like in this patch. Did it work after that?

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-08-31 Thread Pranith Kumar

On 08/31/2014 10:34 AM, David Herrmann wrote:
 The only arch-dependent code for memfd_test.c is the syscall invocation:
 memfd_create(const char *name, unsigned int flags);
 via glibc as:
 syscall(__NR_memfd_create, name, flags);

 Can you debug your test-run (maybe via simple printk() in mm/shmem.c
 memfd_create()) and see what's going wrong there?

Hi David,

I figured out the problem. I am on a 32-bit system and using u64 for flags in 
fcntl() is the cause of the problem. Will you accept a patch making the test 
work on 32-bit systems as below?

Thanks!
--
Pranith

From: Pranith Kumar bobby.pr...@gmail.com
Date: Sun, 31 Aug 2014 13:38:07 -0400
Subject: [PATCH] memfd_test: Make it work on 32-bit systems

This test currently fails on 32-bit systems since we use u64 type to pass the
flags to fcntl.

This commit changes this to use u32 type for flags to fcntl making it work on
32-bit systems.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 tools/testing/selftests/memfd/memfd_test.c | 32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/memfd/memfd_test.c 
b/tools/testing/selftests/memfd/memfd_test.c
index 3634c90..77e56ff 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -59,9 +59,9 @@ static void mfd_fail_new(const char *name, unsigned int flags)
 }
 }
 
-static __u64 mfd_assert_get_seals(int fd)
+static __u32 mfd_assert_get_seals(int fd)
 {
-long r;
+int r;
 
 r = fcntl(fd, F_GET_SEALS);
 if (r  0) {
@@ -72,36 +72,36 @@ static __u64 mfd_assert_get_seals(int fd)
 return r;
 }
 
-static void mfd_assert_has_seals(int fd, __u64 seals)
+static void mfd_assert_has_seals(int fd, __u32 seals)
 {
-__u64 s;
+__u32 s;
 
 s = mfd_assert_get_seals(fd);
 if (s != seals) {
-printf(%llu != %llu = GET_SEALS(%d)\n,
-   (unsigned long long)seals, (unsigned long long)s, fd);
+printf(%lu != %lu = GET_SEALS(%d)\n,
+   (unsigned long)seals, (unsigned long)s, fd);
 abort();
 }
 }
 
-static void mfd_assert_add_seals(int fd, __u64 seals)
+static void mfd_assert_add_seals(int fd, __u32 seals)
 {
-long r;
-__u64 s;
+int r;
+__u32 s;
 
 s = mfd_assert_get_seals(fd);
 r = fcntl(fd, F_ADD_SEALS, seals);
 if (r  0) {
-printf(ADD_SEALS(%d, %llu - %llu) failed: %m\n,
-   fd, (unsigned long long)s, (unsigned long long)seals);
+printf(ADD_SEALS(%d, %lu - %lu) failed: %m\n,
+   fd, (unsigned long)s, (unsigned long)seals);
 abort();
 }
 }
 
-static void mfd_fail_add_seals(int fd, __u64 seals)
+static void mfd_fail_add_seals(int fd, __u32 seals)
 {
-long r;
-__u64 s;
+int r;
+__u32 s;
 
 r = fcntl(fd, F_GET_SEALS);
 if (r  0)
@@ -111,8 +111,8 @@ static void mfd_fail_add_seals(int fd, __u64 seals)
 
 r = fcntl(fd, F_ADD_SEALS, seals);
 if (r = 0) {
-printf(ADD_SEALS(%d, %llu - %llu) didn't fail as expected\n,
-   fd, (unsigned long long)s, (unsigned long long)seals);
+printf(ADD_SEALS(%d, %lu - %lu) didn't fail as expected\n,
+   fd, (unsigned long)s, (unsigned long)seals);
 abort();
 }
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] memfd_test: Add missing argument to printf()

2014-08-31 Thread Pranith Kumar
Add a missing path argument buf to printf() 

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 tools/testing/selftests/memfd/memfd_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/memfd/memfd_test.c 
b/tools/testing/selftests/memfd/memfd_test.c
index 3634c90..c343df8 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -205,7 +205,7 @@ static void mfd_fail_open(int fd, int flags, mode_t mode)
sprintf(buf, /proc/self/fd/%d, fd);
r = open(buf, flags, mode);
if (r = 0) {
-   printf(open(%s) didn't fail as expected\n);
+   printf(open(%s) didn't fail as expected\n, buf);
abort();
}
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH] powerpc: Wire up three syscalls

2014-08-29 Thread Pranith Kumar
I see that the three syscalls seccomp, getrandom and memfd_create are not wired
because of which we get a warning while compilation.

So I wired them up in this patch. What else needs to be done? I tried the
memfd_test after compiling this kernel, but it is failing. What am I missing for
this to work? Any advice is really appreciated! :)

Signed-off-by: Pranith Kumar 
---
 arch/powerpc/include/asm/systbl.h  | 3 +++
 arch/powerpc/include/asm/unistd.h  | 2 +-
 arch/powerpc/include/uapi/asm/unistd.h | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/systbl.h 
b/arch/powerpc/include/asm/systbl.h
index 542bc0f..7d8a600 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */
 SYSCALL_SPU(sched_setattr)
 SYSCALL_SPU(sched_getattr)
 SYSCALL_SPU(renameat2)
+SYSCALL_SPU(seccomp)
+SYSCALL_SPU(getrandom)
+SYSCALL_SPU(memfd_create)
diff --git a/arch/powerpc/include/asm/unistd.h 
b/arch/powerpc/include/asm/unistd.h
index 5ce5552..4e9af3f 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -12,7 +12,7 @@
 #include 
 
 
-#define __NR_syscalls  358
+#define __NR_syscalls  361
 
 #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 2d526f7..0688fc0 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -380,5 +380,8 @@
 #define __NR_sched_setattr 355
 #define __NR_sched_getattr 356
 #define __NR_renameat2 357
+#define __NR_seccomp   358
+#define __NR_getrandom 359
+#define __NR_memfd_create  360
 
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH] powerpc: Wire up three syscalls

2014-08-29 Thread Pranith Kumar
I see that the three syscalls seccomp, getrandom and memfd_create are not wired
because of which we get a warning while compilation.

So I wired them up in this patch. What else needs to be done? I tried the
memfd_test after compiling this kernel, but it is failing. What am I missing for
this to work? Any advice is really appreciated! :)

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/include/asm/systbl.h  | 3 +++
 arch/powerpc/include/asm/unistd.h  | 2 +-
 arch/powerpc/include/uapi/asm/unistd.h | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/systbl.h 
b/arch/powerpc/include/asm/systbl.h
index 542bc0f..7d8a600 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -362,3 +362,6 @@ SYSCALL(ni_syscall) /* sys_kcmp */
 SYSCALL_SPU(sched_setattr)
 SYSCALL_SPU(sched_getattr)
 SYSCALL_SPU(renameat2)
+SYSCALL_SPU(seccomp)
+SYSCALL_SPU(getrandom)
+SYSCALL_SPU(memfd_create)
diff --git a/arch/powerpc/include/asm/unistd.h 
b/arch/powerpc/include/asm/unistd.h
index 5ce5552..4e9af3f 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  358
+#define __NR_syscalls  361
 
 #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 2d526f7..0688fc0 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -380,5 +380,8 @@
 #define __NR_sched_setattr 355
 #define __NR_sched_getattr 356
 #define __NR_renameat2 357
+#define __NR_seccomp   358
+#define __NR_getrandom 359
+#define __NR_memfd_create  360
 
 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:39 PM, Paul E. McKenney
 wrote:
> On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
>> On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
>>  wrote:
>> >
>> > I am really confused by the ordering of the new lines, as I would have
>> > expected the "x"s to be replaced with "y"s and vice versa.  But the
>> > ordering of the various combinations does not matter, and each line
>> > looks OK.
>>
>> Since x = A was replaced by x = B and y = B was replaced by y = A, I
>> just converted all x = load A to x = load B. Similarly for y. I think
>> we can do either this or as you suggested replacing x's with y's.
>
> Fair enough.  The other thing that confused me was the "STORE B=4,"
> showing up early in your replacement.
>

So I converted

STORE A=3, x=LOAD A->3

to

STORE B=4, x=LOAD B->4

since the later load into x wanted an updated value of B and not the
default. That is the reason you see STORE B = 4  in place of STORE A =
3


-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
 wrote:
>
> I am really confused by the ordering of the new lines, as I would have
> expected the "x"s to be replaced with "y"s and vice versa.  But the
> ordering of the various combinations does not matter, and each line
> looks OK.
>

Since x = A was replaced by x = B and y = B was replaced by y = A, I
just converted all x = load A to x = load B. Similarly for y. I think
we can do either this or as you suggested replacing x's with y's.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 I am really confused by the ordering of the new lines, as I would have
 expected the xs to be replaced with ys and vice versa.  But the
 ordering of the various combinations does not matter, and each line
 looks OK.


Since x = A was replaced by x = B and y = B was replaced by y = A, I
just converted all x = load A to x = load B. Similarly for y. I think
we can do either this or as you suggested replacing x's with y's.

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:39 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:
 On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote:
 On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney
 paul...@linux.vnet.ibm.com wrote:
 
  I am really confused by the ordering of the new lines, as I would have
  expected the xs to be replaced with ys and vice versa.  But the
  ordering of the various combinations does not matter, and each line
  looks OK.

 Since x = A was replaced by x = B and y = B was replaced by y = A, I
 just converted all x = load A to x = load B. Similarly for y. I think
 we can do either this or as you suggested replacing x's with y's.

 Fair enough.  The other thing that confused me was the STORE B=4,
 showing up early in your replacement.


So I converted

STORE A=3, x=LOAD A-3

to

STORE B=4, x=LOAD B-4

since the later load into x wanted an updated value of B and not the
default. That is the reason you see STORE B = 4  in place of STORE A =
3


-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] rcu: Make nocb leader kthreads process pending callbacks after spawning

2014-08-27 Thread Pranith Kumar
On Wed, Aug 27, 2014 at 5:47 PM, Paul E. McKenney
 wrote:
>
> Thank you, Pranith, queued.  I have also backported to v3.17-rc2,
> and am testing both.  A sneak preview of the backport is shown below,
> please let me know if you see any problems with it.  (The reason for
> the backport is to submit to 3.17 as a fix for a regression.)
>

Looks good to me!

--
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rcu: Make nocb leader kthreads process pending callbacks after spawning

2014-08-27 Thread Pranith Kumar
The nocb callbacks generated before the nocb kthreads are spawned are
enqueued in the nocb queue for later processing. Commit fbce7497ee5af ("rcu:
Parallelize and economize NOCB kthread wakeups") introduced nocb leader kthreads
which checked the nocb_leader_wake flag to see if there were any such pending
callbacks. A case was reported in which newly spawned leader kthreads were not
processing the pending callbacks as this flag was not set, which led to a boot
hang.

The following commit ensures that the newly spawned nocb kthreads process the
pending callbacks by allowing the kthreads to run immediately after spawning
instead of waiting. This is done by inverting the logic of nocb_leader_wake
tests to nocb_leader_sleep which allows us to use the default initialization of
this flag to 0 to let the kthreads run.

Reported-by: Amit Shah 
Signed-off-by: Pranith Kumar 
Link: http://www.spinics.net/lists/kernel/msg1802899.html
---
 kernel/rcu/tree.h|  2 +-
 kernel/rcu/tree_plugin.h | 24 
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 83a7d1c..ffedcb9 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -358,7 +358,7 @@ struct rcu_data {
struct rcu_head **nocb_gp_tail;
long nocb_gp_count;
long nocb_gp_count_lazy;
-   bool nocb_leader_wake;  /* Is the nocb leader thread awake? */
+   bool nocb_leader_sleep; /* Is the nocb leader thread asleep? */
struct rcu_data *nocb_next_follower;
/* Next follower in wakeup chain. */
 
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 5780f6d..28d6763 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2041,9 +2041,9 @@ static void wake_nocb_leader(struct rcu_data *rdp, bool 
force)
 
if (!ACCESS_ONCE(rdp_leader->nocb_kthread))
return;
-   if (!ACCESS_ONCE(rdp_leader->nocb_leader_wake) || force) {
+   if (ACCESS_ONCE(rdp_leader->nocb_leader_sleep) || force) {
/* Prior smp_mb__after_atomic() orders against prior enqueue. */
-   ACCESS_ONCE(rdp_leader->nocb_leader_wake) = true;
+   ACCESS_ONCE(rdp_leader->nocb_leader_sleep) = false;
wake_up(_leader->nocb_wq);
}
 }
@@ -2071,7 +2071,7 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp,
ACCESS_ONCE(*old_rhpp) = rhp;
atomic_long_add(rhcount, >nocb_q_count);
atomic_long_add(rhcount_lazy, >nocb_q_count_lazy);
-   smp_mb__after_atomic(); /* Store *old_rhpp before _wake test. */
+   smp_mb__after_atomic(); /* Store *old_rhpp before _sleep test. */
 
/* If we are not being polled and there is a kthread, awaken it ... */
t = ACCESS_ONCE(rdp->nocb_kthread);
@@ -2239,7 +2239,7 @@ wait_again:
if (!rcu_nocb_poll) {
trace_rcu_nocb_wake(my_rdp->rsp->name, my_rdp->cpu, "Sleep");
wait_event_interruptible(my_rdp->nocb_wq,
-ACCESS_ONCE(my_rdp->nocb_leader_wake));
+   !ACCESS_ONCE(my_rdp->nocb_leader_sleep));
/* Memory barrier handled by smp_mb() calls below and repoll. */
} else if (firsttime) {
firsttime = false; /* Don't drown trace log with "Poll"! */
@@ -2278,12 +2278,12 @@ wait_again:
schedule_timeout_interruptible(1);
 
/* Rescan in case we were a victim of memory ordering. */
-   my_rdp->nocb_leader_wake = false;
-   smp_mb();  /* Ensure _wake false before scan. */
+   my_rdp->nocb_leader_sleep = true;
+   smp_mb();  /* Ensure _sleep true before scan. */
for (rdp = my_rdp; rdp; rdp = rdp->nocb_next_follower)
if (ACCESS_ONCE(rdp->nocb_head)) {
/* Found CB, so short-circuit next wait. */
-   my_rdp->nocb_leader_wake = true;
+   my_rdp->nocb_leader_sleep = false;
break;
}
goto wait_again;
@@ -2293,17 +2293,17 @@ wait_again:
rcu_nocb_wait_gp(my_rdp);
 
/*
-* We left ->nocb_leader_wake set to reduce cache thrashing.
-* We clear it now, but recheck for new callbacks while
+* We left ->nocb_leader_sleep unset to reduce cache thrashing.
+* We set it now, but recheck for new callbacks while
 * traversing our follower list.
 */
-   my_rdp->nocb_leader_wake = false;
-   smp_mb(); /* Ensure _wake false before scan of ->nocb_head. */
+   my_rdp->nocb_leader_sleep = true;
+   smp_mb(); /* Ensure _sleep true before scan of ->nocb_head. */
 
/*

Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-27 Thread Pranith Kumar
On Wed, Aug 27, 2014 at 12:21 PM, Paul E. McKenney
 wrote:
> On Wed, Aug 27, 2014 at 10:13:50AM +0530, Amit Shah wrote:

>>
>> Yes, this patch helps my case as well.
>
> Very good!!!
>
> Pranith, I can take this patch, but would you be willing to invert
> the sense of ->nocb_leader_wake (e.g., call it ->nocb_leader_sleep or
> some such)?  This field is only used in eight places in the source code.
>
> The idea is that inverting the sense of the field allows the normal C
> initialization of zero to properly initialize this field, plus it gets
> rid of a few lines of code.
>

Sure, that is indeed a good idea. I will send a new patch.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-27 Thread Pranith Kumar
On Wed, Aug 27, 2014 at 12:21 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:
 On Wed, Aug 27, 2014 at 10:13:50AM +0530, Amit Shah wrote:


 Yes, this patch helps my case as well.

 Very good!!!

 Pranith, I can take this patch, but would you be willing to invert
 the sense of -nocb_leader_wake (e.g., call it -nocb_leader_sleep or
 some such)?  This field is only used in eight places in the source code.

 The idea is that inverting the sense of the field allows the normal C
 initialization of zero to properly initialize this field, plus it gets
 rid of a few lines of code.


Sure, that is indeed a good idea. I will send a new patch.

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rcu: Make nocb leader kthreads process pending callbacks after spawning

2014-08-27 Thread Pranith Kumar
The nocb callbacks generated before the nocb kthreads are spawned are
enqueued in the nocb queue for later processing. Commit fbce7497ee5af (rcu:
Parallelize and economize NOCB kthread wakeups) introduced nocb leader kthreads
which checked the nocb_leader_wake flag to see if there were any such pending
callbacks. A case was reported in which newly spawned leader kthreads were not
processing the pending callbacks as this flag was not set, which led to a boot
hang.

The following commit ensures that the newly spawned nocb kthreads process the
pending callbacks by allowing the kthreads to run immediately after spawning
instead of waiting. This is done by inverting the logic of nocb_leader_wake
tests to nocb_leader_sleep which allows us to use the default initialization of
this flag to 0 to let the kthreads run.

Reported-by: Amit Shah amit.s...@redhat.com
Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
Link: http://www.spinics.net/lists/kernel/msg1802899.html
---
 kernel/rcu/tree.h|  2 +-
 kernel/rcu/tree_plugin.h | 24 
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 83a7d1c..ffedcb9 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -358,7 +358,7 @@ struct rcu_data {
struct rcu_head **nocb_gp_tail;
long nocb_gp_count;
long nocb_gp_count_lazy;
-   bool nocb_leader_wake;  /* Is the nocb leader thread awake? */
+   bool nocb_leader_sleep; /* Is the nocb leader thread asleep? */
struct rcu_data *nocb_next_follower;
/* Next follower in wakeup chain. */
 
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 5780f6d..28d6763 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2041,9 +2041,9 @@ static void wake_nocb_leader(struct rcu_data *rdp, bool 
force)
 
if (!ACCESS_ONCE(rdp_leader-nocb_kthread))
return;
-   if (!ACCESS_ONCE(rdp_leader-nocb_leader_wake) || force) {
+   if (ACCESS_ONCE(rdp_leader-nocb_leader_sleep) || force) {
/* Prior smp_mb__after_atomic() orders against prior enqueue. */
-   ACCESS_ONCE(rdp_leader-nocb_leader_wake) = true;
+   ACCESS_ONCE(rdp_leader-nocb_leader_sleep) = false;
wake_up(rdp_leader-nocb_wq);
}
 }
@@ -2071,7 +2071,7 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp,
ACCESS_ONCE(*old_rhpp) = rhp;
atomic_long_add(rhcount, rdp-nocb_q_count);
atomic_long_add(rhcount_lazy, rdp-nocb_q_count_lazy);
-   smp_mb__after_atomic(); /* Store *old_rhpp before _wake test. */
+   smp_mb__after_atomic(); /* Store *old_rhpp before _sleep test. */
 
/* If we are not being polled and there is a kthread, awaken it ... */
t = ACCESS_ONCE(rdp-nocb_kthread);
@@ -2239,7 +2239,7 @@ wait_again:
if (!rcu_nocb_poll) {
trace_rcu_nocb_wake(my_rdp-rsp-name, my_rdp-cpu, Sleep);
wait_event_interruptible(my_rdp-nocb_wq,
-ACCESS_ONCE(my_rdp-nocb_leader_wake));
+   !ACCESS_ONCE(my_rdp-nocb_leader_sleep));
/* Memory barrier handled by smp_mb() calls below and repoll. */
} else if (firsttime) {
firsttime = false; /* Don't drown trace log with Poll! */
@@ -2278,12 +2278,12 @@ wait_again:
schedule_timeout_interruptible(1);
 
/* Rescan in case we were a victim of memory ordering. */
-   my_rdp-nocb_leader_wake = false;
-   smp_mb();  /* Ensure _wake false before scan. */
+   my_rdp-nocb_leader_sleep = true;
+   smp_mb();  /* Ensure _sleep true before scan. */
for (rdp = my_rdp; rdp; rdp = rdp-nocb_next_follower)
if (ACCESS_ONCE(rdp-nocb_head)) {
/* Found CB, so short-circuit next wait. */
-   my_rdp-nocb_leader_wake = true;
+   my_rdp-nocb_leader_sleep = false;
break;
}
goto wait_again;
@@ -2293,17 +2293,17 @@ wait_again:
rcu_nocb_wait_gp(my_rdp);
 
/*
-* We left -nocb_leader_wake set to reduce cache thrashing.
-* We clear it now, but recheck for new callbacks while
+* We left -nocb_leader_sleep unset to reduce cache thrashing.
+* We set it now, but recheck for new callbacks while
 * traversing our follower list.
 */
-   my_rdp-nocb_leader_wake = false;
-   smp_mb(); /* Ensure _wake false before scan of -nocb_head. */
+   my_rdp-nocb_leader_sleep = true;
+   smp_mb(); /* Ensure _sleep true before scan of -nocb_head. */
 
/* Each pass through the following loop wakes a follower, if needed. */
for (rdp = my_rdp; rdp; rdp

Re: [PATCH] rcu: Make nocb leader kthreads process pending callbacks after spawning

2014-08-27 Thread Pranith Kumar
On Wed, Aug 27, 2014 at 5:47 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 Thank you, Pranith, queued.  I have also backported to v3.17-rc2,
 and am testing both.  A sneak preview of the backport is shown below,
 please let me know if you see any problems with it.  (The reason for
 the backport is to submit to 3.17 as a fix for a regression.)


Looks good to me!

--
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 00/16] rcu: Some minor fixes and cleanups

2014-08-26 Thread Pranith Kumar
On Wed, Jul 23, 2014 at 10:45 AM, Paul E. McKenney
 wrote:
> On Wed, Jul 23, 2014 at 01:09:37AM -0400, Pranith Kumar wrote:
>> Hi Paul,
>>
>> This is a series of minor fixes and cleanup patches which I found while 
>> studying
>> the code. All my previous pending (but not rejected ;) patches are 
>> superseded by
>> this series, expect the rcutorture snprintf changes. I am still waiting for 
>> you
>> to decide on that one :)
>>
>> These changes have been tested by the kvm rcutorture test setup. Some tests 
>> give
>> me stall warnings, but otherwise have SUCCESS messages in the logs.
>
> For patches 1, 3, 5, 8, 12, and 13, once you get a Reviewed-by from one
> of the co-maintainers or designated reviewers, I will queue them.
> The other patches I have responded to.
>

Hi Paul, just a reminder so that these don't get forgotten :)

>>
>> Pranith Kumar (16):
>>   rcu: Use rcu_num_nodes instead of NUM_RCU_NODES
>>   rcu: Check return value for cpumask allocation
>>   rcu: Fix comment for gp_state field values
>>   rcu: Remove redundant check for an online CPU
>>   rcu: Add noreturn attribute to boost kthread
>>   rcu: Clear gp_flags only when actually starting new gp
>>   rcu: Save and restore irq flags in rcu_gp_cleanup()
>>   rcu: Clean up rcu_spawn_one_boost_kthread()
>>   rcu: Remove redundant check for online cpu
>>   rcu: Check for RCU_FLAG_GP_INIT bit in gp_flags for spurious wakeup
>>   rcu: Check for spurious wakeup using return value
>>   rcu: Rename rcu_spawn_gp_kthread() to rcu_spawn_kthreads()
>>   rcu: Spawn nocb kthreads from rcu_prepare_kthreads()
>>   rcu: Remove redundant checks for rcu_scheduler_fully_active
>>   rcu: Check for a nocb cpu before trying to spawn nocb threads
>>   rcu: kvm.sh: Fix error when you pass --cpus argument
>>
>>  kernel/rcu/tree.c | 42 
>> ++-
>>  kernel/rcu/tree.h |  4 +--
>>  kernel/rcu/tree_plugin.h  | 40 +
>>  tools/testing/selftests/rcutorture/bin/kvm.sh |  4 +--
>>  4 files changed, 47 insertions(+), 43 deletions(-)
>>
>> --
>> 2.0.0.rc2
>>
>



-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 00/16] rcu: Some minor fixes and cleanups

2014-08-26 Thread Pranith Kumar
On Wed, Jul 23, 2014 at 10:45 AM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:
 On Wed, Jul 23, 2014 at 01:09:37AM -0400, Pranith Kumar wrote:
 Hi Paul,

 This is a series of minor fixes and cleanup patches which I found while 
 studying
 the code. All my previous pending (but not rejected ;) patches are 
 superseded by
 this series, expect the rcutorture snprintf changes. I am still waiting for 
 you
 to decide on that one :)

 These changes have been tested by the kvm rcutorture test setup. Some tests 
 give
 me stall warnings, but otherwise have SUCCESS messages in the logs.

 For patches 1, 3, 5, 8, 12, and 13, once you get a Reviewed-by from one
 of the co-maintainers or designated reviewers, I will queue them.
 The other patches I have responded to.


Hi Paul, just a reminder so that these don't get forgotten :)


 Pranith Kumar (16):
   rcu: Use rcu_num_nodes instead of NUM_RCU_NODES
   rcu: Check return value for cpumask allocation
   rcu: Fix comment for gp_state field values
   rcu: Remove redundant check for an online CPU
   rcu: Add noreturn attribute to boost kthread
   rcu: Clear gp_flags only when actually starting new gp
   rcu: Save and restore irq flags in rcu_gp_cleanup()
   rcu: Clean up rcu_spawn_one_boost_kthread()
   rcu: Remove redundant check for online cpu
   rcu: Check for RCU_FLAG_GP_INIT bit in gp_flags for spurious wakeup
   rcu: Check for spurious wakeup using return value
   rcu: Rename rcu_spawn_gp_kthread() to rcu_spawn_kthreads()
   rcu: Spawn nocb kthreads from rcu_prepare_kthreads()
   rcu: Remove redundant checks for rcu_scheduler_fully_active
   rcu: Check for a nocb cpu before trying to spawn nocb threads
   rcu: kvm.sh: Fix error when you pass --cpus argument

  kernel/rcu/tree.c | 42 
 ++-
  kernel/rcu/tree.h |  4 +--
  kernel/rcu/tree_plugin.h  | 40 +
  tools/testing/selftests/rcutorture/bin/kvm.sh |  4 +--
  4 files changed, 47 insertions(+), 43 deletions(-)

 --
 2.0.0.rc2





-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] serial: Fix build failure caused by missing header file

2014-08-25 Thread Pranith Kumar
On Mon, Aug 25, 2014 at 4:13 PM, Greg Kroah-Hartman
 wrote:

> Where is this failing?  What arch?  What kernel version did it show up
> in (i.e. what commit caused this problem?)
>

This was a randconfig on powerpc. I did not bisect as to which commit
introduced this since it is a simple missing header file.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-25 Thread Pranith Kumar
Correct the example of memory orderings in memory-barriers.txt

Commit 615cc2c9cf95 "Documentation/memory-barriers.txt: fix important typo re
memory barriers" changed the assignment to x and y. Change the rest of the
example to match this change.

Reported-by: Ganesh Rapolu 
Signed-off-by: Pranith Kumar 
---
 Documentation/memory-barriers.txt | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/memory-barriers.txt 
b/Documentation/memory-barriers.txt
index a4de88f..cf31875 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -121,22 +121,22 @@ For example, consider the following sequence of events:
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
 
-   STORE A=3,  STORE B=4,  x=LOAD A->3,y=LOAD B->4
-   STORE A=3,  STORE B=4,  y=LOAD B->4,x=LOAD A->3
-   STORE A=3,  x=LOAD A->3,STORE B=4,  y=LOAD B->4
-   STORE A=3,  x=LOAD A->3,y=LOAD B->2,STORE B=4
-   STORE A=3,  y=LOAD B->2,STORE B=4,  x=LOAD A->3
-   STORE A=3,  y=LOAD B->2,x=LOAD A->3,STORE B=4
-   STORE B=4,  STORE A=3,  x=LOAD A->3,y=LOAD B->4
+   STORE A=3,  STORE B=4,  x=LOAD B->4,y=LOAD A->3
+   STORE A=3,  STORE B=4,  y=LOAD A->3,x=LOAD B->4
+   STORE B=4,  x=LOAD B->4,STORE A=3,  y=LOAD A->3
+   STORE A=3,  x=LOAD B->2,y=LOAD A->3,STORE B=4
+   STORE B=4,  y=LOAD A->1,STORE A=3,  x=LOAD B->4
+   STORE B=4,  y=LOAD A->1,x=LOAD B->4,STORE A=3
+   STORE B=4,  STORE A=3,  x=LOAD B->4,y=LOAD A->3
STORE B=4, ...
...
 
 and can thus result in four different combinations of values:
 
-   x == 1, y == 2
-   x == 1, y == 4
-   x == 3, y == 2
-   x == 3, y == 4
+   x == 2, y == 1
+   x == 2, y == 3
+   x == 4, y == 1
+   x == 4, y == 3
 
 
 Furthermore, the stores committed by a CPU to the memory system may not be
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-25 Thread Pranith Kumar
Correct the example of memory orderings in memory-barriers.txt

Commit 615cc2c9cf95 Documentation/memory-barriers.txt: fix important typo re
memory barriers changed the assignment to x and y. Change the rest of the
example to match this change.

Reported-by: Ganesh Rapolu ganesh.rap...@hotmail.com
Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 Documentation/memory-barriers.txt | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/memory-barriers.txt 
b/Documentation/memory-barriers.txt
index a4de88f..cf31875 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -121,22 +121,22 @@ For example, consider the following sequence of events:
 The set of accesses as seen by the memory system in the middle can be arranged
 in 24 different combinations:
 
-   STORE A=3,  STORE B=4,  x=LOAD A-3,y=LOAD B-4
-   STORE A=3,  STORE B=4,  y=LOAD B-4,x=LOAD A-3
-   STORE A=3,  x=LOAD A-3,STORE B=4,  y=LOAD B-4
-   STORE A=3,  x=LOAD A-3,y=LOAD B-2,STORE B=4
-   STORE A=3,  y=LOAD B-2,STORE B=4,  x=LOAD A-3
-   STORE A=3,  y=LOAD B-2,x=LOAD A-3,STORE B=4
-   STORE B=4,  STORE A=3,  x=LOAD A-3,y=LOAD B-4
+   STORE A=3,  STORE B=4,  x=LOAD B-4,y=LOAD A-3
+   STORE A=3,  STORE B=4,  y=LOAD A-3,x=LOAD B-4
+   STORE B=4,  x=LOAD B-4,STORE A=3,  y=LOAD A-3
+   STORE A=3,  x=LOAD B-2,y=LOAD A-3,STORE B=4
+   STORE B=4,  y=LOAD A-1,STORE A=3,  x=LOAD B-4
+   STORE B=4,  y=LOAD A-1,x=LOAD B-4,STORE A=3
+   STORE B=4,  STORE A=3,  x=LOAD B-4,y=LOAD A-3
STORE B=4, ...
...
 
 and can thus result in four different combinations of values:
 
-   x == 1, y == 2
-   x == 1, y == 4
-   x == 3, y == 2
-   x == 3, y == 4
+   x == 2, y == 1
+   x == 2, y == 3
+   x == 4, y == 1
+   x == 4, y == 3
 
 
 Furthermore, the stores committed by a CPU to the memory system may not be
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] serial: Fix build failure caused by missing header file

2014-08-25 Thread Pranith Kumar
On Mon, Aug 25, 2014 at 4:13 PM, Greg Kroah-Hartman
gre...@linuxfoundation.org wrote:

 Where is this failing?  What arch?  What kernel version did it show up
 in (i.e. what commit caused this problem?)


This was a randconfig on powerpc. I did not bisect as to which commit
introduced this since it is a simple missing header file.

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-23 Thread Pranith Kumar
On Sat, Aug 23, 2014 at 11:23 PM, Paul E. McKenney
 wrote:
> On Sat, Aug 23, 2014 at 08:26:10PM -0400, Pranith Kumar wrote:
>> On Sat, Aug 23, 2014 at 12:51 PM, Paul E. McKenney
>>  wrote:
>>
>> > It might well!  Another possibility is that the early_initcall function
>> > doing the synchronize_rcu() is happening before the early_initcall
>> > creating the RCU grace-period kthreads.
>> >
>> > Seems like we need to close both holes.  Let's see how your patch works
>> > for Amit, and I am testing a patch for the possible early_initcall
>> > ordering issue.
>>
>> I checked the init call which is calling synchronize_rcu():
>> subsys_initcall(pm_sysrq_init); this is being called after
>> early_initcall.
>>
>> The order of initcalls is early, core, postcore, arch, subsys, fs,
>> device, late. So I guess that is ok.
>>
>> I wonder why it was not showing up in 12.04. I have a dual boot. Will
>> test it out and see if I can find something.
>
> Me, I am wondering about 7,000 callbacks being registered during early
> boot time.  ;-)
>


This is the backtrace for most of the callbacks:

[4.612103] [ cut here ]
[4.613340] WARNING: CPU: 0 PID: 0 at kernel/rcu/tree_plugin.h:2115
__call_rcu_nocb_enqueue+0x58/0x283()
[4.615975] Modules linked in:
[4.616000] CPU: 0 PID: 0 Comm: swapper/0 Tainted: GW 3.16.0+ #76
[4.616000] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS Bochs 01/01/2011
[4.616000]   81803c20 813c5213

[4.616000]  81803c58 810388aa 8108aac8
88001f9cce40
[4.616000]  88001f5b6c08  0286
81803c68
[4.616000] Call Trace:
[4.616000]  [] dump_stack+0x4e/0x7a
[4.616000]  [] warn_slowpath_common+0x7f/0x98
[4.616000]  [] ? __call_rcu_nocb_enqueue+0x58/0x283
[4.616000]  [] warn_slowpath_null+0x1a/0x1c
[4.616000]  [] __call_rcu_nocb_enqueue+0x58/0x283
[4.616000]  [] ? unreferenced_object+0x4f/0x4f
[4.616000]  [] __call_rcu+0xcd/0x32b
[4.616000]  [] call_rcu+0x1b/0x1d
[4.616000]  [] put_object+0x41/0x44
[4.616000]  [] delete_object_full+0x29/0x2c
[4.616000]  [] kmemleak_free+0x25/0x43
[4.616000]  [] slab_free_hook+0x1d/0x63
[4.616000]  [] kmem_cache_free+0x52/0x154
[4.616000]  [] ? acpi_os_release_object+0xe/0x12
[4.616000]  [] acpi_os_release_object+0xe/0x12
[4.616000]  [] acpi_ps_free_op+0x25/0x27
[4.616000]  [] acpi_ps_create_op+0x135/0x209
[4.616000]  [] acpi_ps_parse_loop+0x1d3/0x575
[4.616000]  [] acpi_ps_parse_aml+0xa0/0x277
[4.616000]  [] acpi_ns_one_complete_parse+0xfc/0x11b
[4.616000]  [] acpi_ns_parse_table+0x33/0x38
[4.616000]  [] acpi_ns_load_table+0x4c/0x8b
[4.616000]  [] acpi_load_tables+0x9d/0x15d
[4.616000]  [] acpi_early_init+0x73/0xfe
[4.616000]  [] start_kernel+0x3a9/0x40a
[4.616000]  [] ? early_idt_handlers+0x120/0x120
[4.616000]  [] x86_64_start_reservations+0x2a/0x2c
[4.616000]  [] x86_64_start_kernel+0x13c/0x149
[4.616000] ---[ end trace 8dbfee90ca96696c ]---


-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-23 Thread Pranith Kumar
On Sat, Aug 23, 2014 at 12:51 PM, Paul E. McKenney
 wrote:

> It might well!  Another possibility is that the early_initcall function
> doing the synchronize_rcu() is happening before the early_initcall
> creating the RCU grace-period kthreads.
>
> Seems like we need to close both holes.  Let's see how your patch works
> for Amit, and I am testing a patch for the possible early_initcall
> ordering issue.

I checked the init call which is calling synchronize_rcu():
subsys_initcall(pm_sysrq_init); this is being called after
early_initcall.

The order of initcalls is early, core, postcore, arch, subsys, fs,
device, late. So I guess that is ok.

I wonder why it was not showing up in 12.04. I have a dual boot. Will
test it out and see if I can find something.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-23 Thread Pranith Kumar
On Fri, Aug 22, 2014 at 5:53 PM, Paul E. McKenney
 wrote:
>
> Hmmm...  Please try replacing the synchronize_rcu() in
> __sysrq_swap_key_ops() with (say) schedule_timeout_interruptible(HZ / 10).
> I bet that gets rid of the hang.  (And also introduces a low-probability
> bug, but should be OK for testing.)
>
> The other thing to try is to revert your patch that turned my event
> traces into printk()s, then put an ftrace_dump(DUMP_ALL); just after
> the synchronize_rcu() -- that might make it so that the ftrace data
> actually gets dumped out.
>

I was able to reproduce this error on my Ubuntu 14.04 machine. I think
I found the root cause of the problem after several kvm runs.

The problem is that earlier we were waiting on nocb_head and now we
are waiting on nocb_leader_wake.

So there are a lot of nocb callbacks which are enqueued before the
nocb thread is spawned. This sets up nocb_head to be non-null, because
of which the nocb kthread used to wake up immediately after sleeping.

Now that we have switched to nocb_leader_wake, this is not being set
when there are pending callbacks, unless the callbacks overflow the
qhimark. The pending callbacks were around 7000 when the boot hangs.

So setting the qhimark using the boot parameter rcutree.qhimark=5000
is one way to allow us to boot past the point by forcefully waking up
the nocb kthread. I am not sure this is fool-proof.

Another option to start the nocb kthreads with nocb_leader_wake set,
so that it can handle any pending callbacks. The following patch also
allows us to boot properly.

Phew! Let me know if this makes any sense :)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 00dc411..4c397aa 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2386,6 +2386,9 @@ static int rcu_nocb_kthread(void *arg)
struct rcu_head **tail;
struct rcu_data *rdp = arg;

+   if (rdp->nocb_leader == rdp)
+   rdp->nocb_leader_wake = true;
+
/* Each pass through this loop invokes one batch of callbacks */
for (;;) {
/* Wait for callbacks. */


-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-23 Thread Pranith Kumar
On Fri, Aug 22, 2014 at 5:53 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 Hmmm...  Please try replacing the synchronize_rcu() in
 __sysrq_swap_key_ops() with (say) schedule_timeout_interruptible(HZ / 10).
 I bet that gets rid of the hang.  (And also introduces a low-probability
 bug, but should be OK for testing.)

 The other thing to try is to revert your patch that turned my event
 traces into printk()s, then put an ftrace_dump(DUMP_ALL); just after
 the synchronize_rcu() -- that might make it so that the ftrace data
 actually gets dumped out.


I was able to reproduce this error on my Ubuntu 14.04 machine. I think
I found the root cause of the problem after several kvm runs.

The problem is that earlier we were waiting on nocb_head and now we
are waiting on nocb_leader_wake.

So there are a lot of nocb callbacks which are enqueued before the
nocb thread is spawned. This sets up nocb_head to be non-null, because
of which the nocb kthread used to wake up immediately after sleeping.

Now that we have switched to nocb_leader_wake, this is not being set
when there are pending callbacks, unless the callbacks overflow the
qhimark. The pending callbacks were around 7000 when the boot hangs.

So setting the qhimark using the boot parameter rcutree.qhimark=5000
is one way to allow us to boot past the point by forcefully waking up
the nocb kthread. I am not sure this is fool-proof.

Another option to start the nocb kthreads with nocb_leader_wake set,
so that it can handle any pending callbacks. The following patch also
allows us to boot properly.

Phew! Let me know if this makes any sense :)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 00dc411..4c397aa 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -2386,6 +2386,9 @@ static int rcu_nocb_kthread(void *arg)
struct rcu_head **tail;
struct rcu_data *rdp = arg;

+   if (rdp-nocb_leader == rdp)
+   rdp-nocb_leader_wake = true;
+
/* Each pass through this loop invokes one batch of callbacks */
for (;;) {
/* Wait for callbacks. */


-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-23 Thread Pranith Kumar
On Sat, Aug 23, 2014 at 12:51 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:

 It might well!  Another possibility is that the early_initcall function
 doing the synchronize_rcu() is happening before the early_initcall
 creating the RCU grace-period kthreads.

 Seems like we need to close both holes.  Let's see how your patch works
 for Amit, and I am testing a patch for the possible early_initcall
 ordering issue.

I checked the init call which is calling synchronize_rcu():
subsys_initcall(pm_sysrq_init); this is being called after
early_initcall.

The order of initcalls is early, core, postcore, arch, subsys, fs,
device, late. So I guess that is ok.

I wonder why it was not showing up in 12.04. I have a dual boot. Will
test it out and see if I can find something.

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-23 Thread Pranith Kumar
On Sat, Aug 23, 2014 at 11:23 PM, Paul E. McKenney
paul...@linux.vnet.ibm.com wrote:
 On Sat, Aug 23, 2014 at 08:26:10PM -0400, Pranith Kumar wrote:
 On Sat, Aug 23, 2014 at 12:51 PM, Paul E. McKenney
 paul...@linux.vnet.ibm.com wrote:

  It might well!  Another possibility is that the early_initcall function
  doing the synchronize_rcu() is happening before the early_initcall
  creating the RCU grace-period kthreads.
 
  Seems like we need to close both holes.  Let's see how your patch works
  for Amit, and I am testing a patch for the possible early_initcall
  ordering issue.

 I checked the init call which is calling synchronize_rcu():
 subsys_initcall(pm_sysrq_init); this is being called after
 early_initcall.

 The order of initcalls is early, core, postcore, arch, subsys, fs,
 device, late. So I guess that is ok.

 I wonder why it was not showing up in 12.04. I have a dual boot. Will
 test it out and see if I can find something.

 Me, I am wondering about 7,000 callbacks being registered during early
 boot time.  ;-)



This is the backtrace for most of the callbacks:

[4.612103] [ cut here ]
[4.613340] WARNING: CPU: 0 PID: 0 at kernel/rcu/tree_plugin.h:2115
__call_rcu_nocb_enqueue+0x58/0x283()
[4.615975] Modules linked in:
[4.616000] CPU: 0 PID: 0 Comm: swapper/0 Tainted: GW 3.16.0+ #76
[4.616000] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS Bochs 01/01/2011
[4.616000]   81803c20 813c5213

[4.616000]  81803c58 810388aa 8108aac8
88001f9cce40
[4.616000]  88001f5b6c08  0286
81803c68
[4.616000] Call Trace:
[4.616000]  [813c5213] dump_stack+0x4e/0x7a
[4.616000]  [810388aa] warn_slowpath_common+0x7f/0x98
[4.616000]  [8108aac8] ? __call_rcu_nocb_enqueue+0x58/0x283
[4.616000]  [81038976] warn_slowpath_null+0x1a/0x1c
[4.616000]  [8108aac8] __call_rcu_nocb_enqueue+0x58/0x283
[4.616000]  [81129f3a] ? unreferenced_object+0x4f/0x4f
[4.616000]  [8108d913] __call_rcu+0xcd/0x32b
[4.616000]  [8108de66] call_rcu+0x1b/0x1d
[4.616000]  [8112a301] put_object+0x41/0x44
[4.616000]  [8112a70a] delete_object_full+0x29/0x2c
[4.616000]  [813c2166] kmemleak_free+0x25/0x43
[4.616000]  [81120cca] slab_free_hook+0x1d/0x63
[4.616000]  [811228c6] kmem_cache_free+0x52/0x154
[4.616000]  [8124aa01] ? acpi_os_release_object+0xe/0x12
[4.616000]  [8124aa01] acpi_os_release_object+0xe/0x12
[4.616000]  [8126c567] acpi_ps_free_op+0x25/0x27
[4.616000]  [8126b81f] acpi_ps_create_op+0x135/0x209
[4.616000]  [8126b1f2] acpi_ps_parse_loop+0x1d3/0x575
[4.616000]  [8126bff2] acpi_ps_parse_aml+0xa0/0x277
[4.616000]  [81267d7f] acpi_ns_one_complete_parse+0xfc/0x11b
[4.616000]  [81267dd1] acpi_ns_parse_table+0x33/0x38
[4.616000]  [81267755] acpi_ns_load_table+0x4c/0x8b
[4.616000]  [81ad6797] acpi_load_tables+0x9d/0x15d
[4.616000]  [81ad5b44] acpi_early_init+0x73/0xfe
[4.616000]  [81aa5e8e] start_kernel+0x3a9/0x40a
[4.616000]  [81aa5120] ? early_idt_handlers+0x120/0x120
[4.616000]  [81aa54ba] x86_64_start_reservations+0x2a/0x2c
[4.616000]  [81aa55f8] x86_64_start_kernel+0x13c/0x149
[4.616000] ---[ end trace 8dbfee90ca96696c ]---


-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: edac: Fix build error

2014-08-21 Thread Pranith Kumar
Fix the following build error:

drivers/edac/ppc4xx_edac.c: In function 'mfsdram':
drivers/edac/ppc4xx_edac.c:249: error: implicit declaration of function
'__mfdcri'
drivers/edac/ppc4xx_edac.c: In function 'mtsdram':
drivers/edac/ppc4xx_edac.c:266: error: implicit declaration of function
'__mtdcri'
drivers/edac/ppc4xx_edac.c:269: warning: 'return' with a value, in function
returning void
drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_init_csrows':
drivers/edac/ppc4xx_edac.c:924: warning: initialization from incompatible
pointer type
drivers/edac/ppc4xx_edac.c:977: error: request for member 'dimm' in something
not a structure or union
drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_map_dcrs':
drivers/edac/ppc4xx_edac.c:1209: warning: passing argument 1 of 'dcr_map_mmio'
discards qualifiers from pointer target type

This driver depends on PPC_DCR_NATIVE to be set for the relevant headers to be
included. Also if PPC_DCR_MMIO=n the build fails. So make PPC_DCR depend on both
these options.

This is compile tested only.

Signed-off-by: Pranith Kumar 
CC: Andrew Morton 
---
 arch/powerpc/Kconfig   | 6 +++---
 drivers/edac/ppc4xx_edac.c | 8 
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4bc7b62..9b90c1c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -233,15 +233,15 @@ config ARCH_SUSPEND_POSSIBLE
 
 config PPC_DCR_NATIVE
bool
-   default n
+   default y
 
 config PPC_DCR_MMIO
bool
-   default n
+   default y
 
 config PPC_DCR
bool
-   depends on PPC_DCR_NATIVE || PPC_DCR_MMIO
+   depends on PPC_DCR_NATIVE && PPC_DCR_MMIO
default y
 
 config PPC_OF_PLATFORM_PCI
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c
index ef6b7e0..8725b73 100644
--- a/drivers/edac/ppc4xx_edac.c
+++ b/drivers/edac/ppc4xx_edac.c
@@ -246,8 +246,8 @@ static const char * const ppc4xx_plb_masters[9] = {
 static inline u32
 mfsdram(const dcr_host_t *dcr_host, unsigned int idcr_n)
 {
-   return __mfdcri(dcr_host->base + SDRAM_DCR_ADDR_OFFSET,
-   dcr_host->base + SDRAM_DCR_DATA_OFFSET,
+   return __mfdcri(dcr_host->host.native.base + SDRAM_DCR_ADDR_OFFSET,
+   dcr_host->host.native.base + SDRAM_DCR_DATA_OFFSET,
idcr_n);
 }
 
@@ -263,8 +263,8 @@ mfsdram(const dcr_host_t *dcr_host, unsigned int idcr_n)
 static inline void
 mtsdram(const dcr_host_t *dcr_host, unsigned int idcr_n, u32 value)
 {
-   return __mtdcri(dcr_host->base + SDRAM_DCR_ADDR_OFFSET,
-   dcr_host->base + SDRAM_DCR_DATA_OFFSET,
+   return __mtdcri(dcr_host->host.native.base + SDRAM_DCR_ADDR_OFFSET,
+   dcr_host->host.native.base + SDRAM_DCR_DATA_OFFSET,
idcr_n,
value);
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] edac: Fix build error caused by wrong member access

2014-08-21 Thread Pranith Kumar
On Thu, Aug 21, 2014 at 5:28 PM, Andrew Morton
 wrote:
>
> This driver seems pretty unhealthy and I suspect it has been
> broken for quite a while.
>
> drivers/edac/ppc4xx_edac.c: In function 'mfsdram':
> drivers/edac/ppc4xx_edac.c:249: error: implicit declaration of function 
> '__mfdcri'
> drivers/edac/ppc4xx_edac.c: In function 'mtsdram':
> drivers/edac/ppc4xx_edac.c:266: error: implicit declaration of function 
> '__mtdcri'
> drivers/edac/ppc4xx_edac.c:269: warning: 'return' with a value, in function 
> returning void
> drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_init_csrows':
> drivers/edac/ppc4xx_edac.c:924: warning: initialization from incompatible 
> pointer type
> drivers/edac/ppc4xx_edac.c:977: error: request for member 'dimm' in something 
> not a structure or union
> drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_map_dcrs':
> drivers/edac/ppc4xx_edac.c:1209: warning: passing argument 1 of 
> 'dcr_map_mmio' discards qualifiers from pointer target type
>
>

Yes, not sure if anyone is actually using it.

Anways, I will send in a patch to fix the errors which you point out here.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build failure when CONFIG_USB=y

2014-08-21 Thread Pranith Kumar
We are enabling USB unconditionally which results in following build failure

drivers/built-in.o: In function `tb_drom_read': 
(.text+0x1b62b70): undefined reference to `usb_speed_string'
make: *** [vmlinux] Error 

Enable USB only if USB_SUPPORT is set to avoid such failures

Signed-off-by: Pranith Kumar 
---
 arch/powerpc/platforms/44x/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/44x/Kconfig 
b/arch/powerpc/platforms/44x/Kconfig
index 3e7deb2..82f2da2 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -215,7 +215,7 @@ config AKEBONO
select NET_VENDOR_IBM
select IBM_EMAC_EMAC4
select IBM_EMAC_RGMII_WOL
-   select USB
+   select USB if USB_SUPPORT
select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
select USB_EHCI_HCD_PLATFORM if USB_EHCI_HCD
select MMC_SDHCI
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build failure

2014-08-21 Thread Pranith Kumar
Fix the following build failure

drivers/built-in.o: In function `nhi_init':
nhi.c:(.init.text+0x63390): undefined reference to `ehci_init_driver'

by adding a dependency on USB_EHCI_HCD which supplies the ehci_init_driver().

Also we need to depend on USB_OHCI_HCD similarly

Signed-off-by: Pranith Kumar 
---
 arch/powerpc/platforms/44x/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/44x/Kconfig 
b/arch/powerpc/platforms/44x/Kconfig
index 4d88f6a..3e7deb2 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -216,8 +216,8 @@ config AKEBONO
select IBM_EMAC_EMAC4
select IBM_EMAC_RGMII_WOL
select USB
-   select USB_OHCI_HCD_PLATFORM
-   select USB_EHCI_HCD_PLATFORM
+   select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
+   select USB_EHCI_HCD_PLATFORM if USB_EHCI_HCD
select MMC_SDHCI
select MMC_SDHCI_PLTFM
select MMC_SDHCI_OF_476GTR
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fbdev: Remove __init from chips_hw_init() to fix build failure

2014-08-21 Thread Pranith Kumar
Fix build failure caused as follows:

The function chipsfb_pci_init() references
the function __init chips_hw_init().
This is often because chipsfb_pci_init lacks a __init 
annotation or the annotation of chips_hw_init is wrong.

make: *** [drivers] Error 2

by removing the __init annotation from chips_hw_init(). The other thing that
could have been done was annotating chipsfb_pci_init(). But that cannot be done
since chipsfb_pci_init() is called from non __init functions.

Signed-off-by: Pranith Kumar 
---
 drivers/video/fbdev/chipsfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c
index 206a66b..59abdc6 100644
--- a/drivers/video/fbdev/chipsfb.c
+++ b/drivers/video/fbdev/chipsfb.c
@@ -273,7 +273,7 @@ static struct chips_init_reg chips_init_xr[] = {
{ 0xa8, 0x00 }
 };
 
-static void __init chips_hw_init(void)
+static void chips_hw_init(void)
 {
int i;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fbdev: Remove __init from chips_hw_init() to fix build failure

2014-08-21 Thread Pranith Kumar
Fix build failure caused as follows:

The function chipsfb_pci_init() references
the function __init chips_hw_init().
This is often because chipsfb_pci_init lacks a __init 
annotation or the annotation of chips_hw_init is wrong.

make: *** [drivers] Error 2

by removing the __init annotation from chips_hw_init(). The other thing that
could have been done was annotating chipsfb_pci_init(). But that cannot be done
since chipsfb_pci_init() is called from non __init functions.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 drivers/video/fbdev/chipsfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c
index 206a66b..59abdc6 100644
--- a/drivers/video/fbdev/chipsfb.c
+++ b/drivers/video/fbdev/chipsfb.c
@@ -273,7 +273,7 @@ static struct chips_init_reg chips_init_xr[] = {
{ 0xa8, 0x00 }
 };
 
-static void __init chips_hw_init(void)
+static void chips_hw_init(void)
 {
int i;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build failure

2014-08-21 Thread Pranith Kumar
Fix the following build failure

drivers/built-in.o: In function `nhi_init':
nhi.c:(.init.text+0x63390): undefined reference to `ehci_init_driver'

by adding a dependency on USB_EHCI_HCD which supplies the ehci_init_driver().

Also we need to depend on USB_OHCI_HCD similarly

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/platforms/44x/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/44x/Kconfig 
b/arch/powerpc/platforms/44x/Kconfig
index 4d88f6a..3e7deb2 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -216,8 +216,8 @@ config AKEBONO
select IBM_EMAC_EMAC4
select IBM_EMAC_RGMII_WOL
select USB
-   select USB_OHCI_HCD_PLATFORM
-   select USB_EHCI_HCD_PLATFORM
+   select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
+   select USB_EHCI_HCD_PLATFORM if USB_EHCI_HCD
select MMC_SDHCI
select MMC_SDHCI_PLTFM
select MMC_SDHCI_OF_476GTR
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build failure when CONFIG_USB=y

2014-08-21 Thread Pranith Kumar
We are enabling USB unconditionally which results in following build failure

drivers/built-in.o: In function `tb_drom_read': 
(.text+0x1b62b70): undefined reference to `usb_speed_string'
make: *** [vmlinux] Error 

Enable USB only if USB_SUPPORT is set to avoid such failures

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/platforms/44x/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/44x/Kconfig 
b/arch/powerpc/platforms/44x/Kconfig
index 3e7deb2..82f2da2 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -215,7 +215,7 @@ config AKEBONO
select NET_VENDOR_IBM
select IBM_EMAC_EMAC4
select IBM_EMAC_RGMII_WOL
-   select USB
+   select USB if USB_SUPPORT
select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
select USB_EHCI_HCD_PLATFORM if USB_EHCI_HCD
select MMC_SDHCI
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] edac: Fix build error caused by wrong member access

2014-08-21 Thread Pranith Kumar
On Thu, Aug 21, 2014 at 5:28 PM, Andrew Morton
a...@linux-foundation.org wrote:

 This driver seems pretty unhealthy and I suspect it has been
 broken for quite a while.

 drivers/edac/ppc4xx_edac.c: In function 'mfsdram':
 drivers/edac/ppc4xx_edac.c:249: error: implicit declaration of function 
 '__mfdcri'
 drivers/edac/ppc4xx_edac.c: In function 'mtsdram':
 drivers/edac/ppc4xx_edac.c:266: error: implicit declaration of function 
 '__mtdcri'
 drivers/edac/ppc4xx_edac.c:269: warning: 'return' with a value, in function 
 returning void
 drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_init_csrows':
 drivers/edac/ppc4xx_edac.c:924: warning: initialization from incompatible 
 pointer type
 drivers/edac/ppc4xx_edac.c:977: error: request for member 'dimm' in something 
 not a structure or union
 drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_map_dcrs':
 drivers/edac/ppc4xx_edac.c:1209: warning: passing argument 1 of 
 'dcr_map_mmio' discards qualifiers from pointer target type



Yes, not sure if anyone is actually using it.

Anways, I will send in a patch to fix the errors which you point out here.

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: edac: Fix build error

2014-08-21 Thread Pranith Kumar
Fix the following build error:

drivers/edac/ppc4xx_edac.c: In function 'mfsdram':
drivers/edac/ppc4xx_edac.c:249: error: implicit declaration of function
'__mfdcri'
drivers/edac/ppc4xx_edac.c: In function 'mtsdram':
drivers/edac/ppc4xx_edac.c:266: error: implicit declaration of function
'__mtdcri'
drivers/edac/ppc4xx_edac.c:269: warning: 'return' with a value, in function
returning void
drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_init_csrows':
drivers/edac/ppc4xx_edac.c:924: warning: initialization from incompatible
pointer type
drivers/edac/ppc4xx_edac.c:977: error: request for member 'dimm' in something
not a structure or union
drivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_map_dcrs':
drivers/edac/ppc4xx_edac.c:1209: warning: passing argument 1 of 'dcr_map_mmio'
discards qualifiers from pointer target type

This driver depends on PPC_DCR_NATIVE to be set for the relevant headers to be
included. Also if PPC_DCR_MMIO=n the build fails. So make PPC_DCR depend on both
these options.

This is compile tested only.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
CC: Andrew Morton a...@linux-foundation.org
---
 arch/powerpc/Kconfig   | 6 +++---
 drivers/edac/ppc4xx_edac.c | 8 
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4bc7b62..9b90c1c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -233,15 +233,15 @@ config ARCH_SUSPEND_POSSIBLE
 
 config PPC_DCR_NATIVE
bool
-   default n
+   default y
 
 config PPC_DCR_MMIO
bool
-   default n
+   default y
 
 config PPC_DCR
bool
-   depends on PPC_DCR_NATIVE || PPC_DCR_MMIO
+   depends on PPC_DCR_NATIVE  PPC_DCR_MMIO
default y
 
 config PPC_OF_PLATFORM_PCI
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c
index ef6b7e0..8725b73 100644
--- a/drivers/edac/ppc4xx_edac.c
+++ b/drivers/edac/ppc4xx_edac.c
@@ -246,8 +246,8 @@ static const char * const ppc4xx_plb_masters[9] = {
 static inline u32
 mfsdram(const dcr_host_t *dcr_host, unsigned int idcr_n)
 {
-   return __mfdcri(dcr_host-base + SDRAM_DCR_ADDR_OFFSET,
-   dcr_host-base + SDRAM_DCR_DATA_OFFSET,
+   return __mfdcri(dcr_host-host.native.base + SDRAM_DCR_ADDR_OFFSET,
+   dcr_host-host.native.base + SDRAM_DCR_DATA_OFFSET,
idcr_n);
 }
 
@@ -263,8 +263,8 @@ mfsdram(const dcr_host_t *dcr_host, unsigned int idcr_n)
 static inline void
 mtsdram(const dcr_host_t *dcr_host, unsigned int idcr_n, u32 value)
 {
-   return __mtdcri(dcr_host-base + SDRAM_DCR_ADDR_OFFSET,
-   dcr_host-base + SDRAM_DCR_DATA_OFFSET,
+   return __mtdcri(dcr_host-host.native.base + SDRAM_DCR_ADDR_OFFSET,
+   dcr_host-host.native.base + SDRAM_DCR_DATA_OFFSET,
idcr_n,
value);
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 4:10 PM, Guenter Roeck  wrote:
> On Wed, Aug 20, 2014 at 03:26:46PM -0400, Pranith Kumar wrote:
>> Building booke_wdt fails when trying to build as a module as there is no
>> early_param() in module. Fix by using module_param() instead of 
>> early_param().
>>
>> Signed-off-by: Pranith Kumar 
>> CC: Guenter Roeck 
>
> Looks good as far as I can see. One question though:
>
>> +MODULE_ALIAS("booke_wdt");
>
> Is this necessary ? If yes, shouldn't it be a separate patch to be applied
> to -stable ?

Suppose this was actually built as a module. How do you pass the
module parameters to this module? Only ways I know of are

./insmod booke_wdt booke_wdt_enabled=1 booke_wdt_period=3

or pass booke_wdt.booke_wdt_enabled=1 on the kernel boot params list.

So the alias is necessary to refer to this module to pass params.

About separate patch, I think it is only with conversion to
module_param() that we need this alias.

Am I missing something?

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
Building booke_wdt fails when trying to build as a module as there is no
early_param() in module. Fix by using module_param() instead of early_param().

Signed-off-by: Pranith Kumar 
CC: Guenter Roeck 
---
 drivers/watchdog/booke_wdt.c | 28 +---
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..e96b09b 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -30,8 +30,6 @@
  * occur, and the final time the board will reset.
  */
 
-u32 booke_wdt_enabled;
-u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 #define WDTP(x)x)&0x3)<<30)|(((x)&0x3c)<<15))
@@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK  (TCR_WP_MASK)
 #endif
 
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
-   if (p && strncmp(p, "0", 1) != 0)
-   booke_wdt_enabled = 1;
-
-   return 0;
-}
-early_param("wdt", early_parse_wdt);
-
-int __init early_parse_wdt_period(char *p)
-{
-   unsigned long ret;
-   if (p) {
-   if (!kstrtol(p, 0, ))
-   booke_wdt_period = ret;
-   }
-
-   return 0;
-}
-early_param("wdt_period", early_parse_wdt_period);
+static bool booke_wdt_enabled;
+module_param(booke_wdt_enabled, bool, 0);
+static int  booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
+module_param(booke_wdt_period, int, 0);
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
@@ -259,5 +240,6 @@ static int __init booke_wdt_init(void)
 module_init(booke_wdt_init);
 module_exit(booke_wdt_exit);
 
+MODULE_ALIAS("booke_wdt");
 MODULE_DESCRIPTION("PowerPC Book-E watchdog driver");
 MODULE_LICENSE("GPL");
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 3:18 PM, Pranith Kumar  wrote:
> On Wed, Aug 20, 2014 at 2:59 PM, Guenter  wrote:

>>
>> Any reason for changing the default from false to true ?
>> Unless you have a reaslly good reason, I don't think that is a good idea.
>
> I don't see where it was being set to false. It is
> uninitialized AFAICT. Does that mean that it is false? (I thought only
> static variables got that default).

Ohk, some googling tells me both global and static variables are
initialized to 0. Makes sense, I will send in a v2



-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 2:59 PM, Guenter  wrote:
> On Wed, Aug 20, 2014 at 12:55:44PM -0400, Pranith Kumar wrote:
>> Building booke_wdt fails when trying to build as a module as there is no
>> early_param() in module. Fix by using module_param() instead of 
>> early_param().
>>
>> Signed-off-by: Pranith Kumar 
>> CC: Guenter Roeck 
>> ---
>>  drivers/watchdog/booke_wdt.c | 28 +---
>>  1 file changed, 5 insertions(+), 23 deletions(-)
>>
>> diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
>> index 08a7853..65f5e9f 100644
>> --- a/drivers/watchdog/booke_wdt.c
>> +++ b/drivers/watchdog/booke_wdt.c
>> @@ -30,8 +30,6 @@
>>   * occur, and the final time the board will reset.
>>   */
>>
>> -u32 booke_wdt_enabled;
>> -u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
>>
>>  #ifdef   CONFIG_PPC_FSL_BOOK3E
>>  #define WDTP(x)  x)&0x3)<<30)|(((x)&0x3c)<<15))
>> @@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
>>  #define WDTP_MASK(TCR_WP_MASK)
>>  #endif
>>
>> -/* Checks wdt=x and wdt_period=xx command-line option */
>> -notrace int __init early_parse_wdt(char *p)
>> -{
>> - if (p && strncmp(p, "0", 1) != 0)
>> - booke_wdt_enabled = 1;
>> -
>> - return 0;
>> -}
>> -early_param("wdt", early_parse_wdt);
>> -
>> -int __init early_parse_wdt_period(char *p)
>> -{
>> - unsigned long ret;
>> - if (p) {
>> - if (!kstrtol(p, 0, ))
>> - booke_wdt_period = ret;
>> - }
>> -
>> - return 0;
>> -}
>> -early_param("wdt_period", early_parse_wdt_period);
>> +static bool booke_wdt_enabled = true;
>
> Any reason for changing the default from false to true ?
> Unless you have a reaslly good reason, I don't think that is a good idea.

I don't see where it was being set to false. It is
uninitialized AFAICT. Does that mean that it is false? (I thought only
static variables got that default).

>
>> +module_param(booke_wdt_enabled, bool, 0444);
>> +static int  booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
>> +module_param(booke_wdt_period, int, 0444);
>>
> Also not sure if it adds value to have the module parameters visible
> from user space. Why not use 0 for the permission flags ?
>

I have no objection to your suggestion. But not sure if such paranoia
is warranted :)

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] serial: Fix build failure caused by missing header file

2014-08-20 Thread Pranith Kumar
Fix build failure caused by missing header file:

drivers/tty/serial/nwpserial.c: In function 'wait_for_bits':
drivers/tty/serial/nwpserial.c:53:3: error: implicit declaration of function 
'udelay' [-Werror=implicit-function-declaration]

Signed-off-by: Pranith Kumar 
---
 drivers/tty/serial/nwpserial.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/nwpserial.c b/drivers/tty/serial/nwpserial.c
index c06366b..5da7622 100644
--- a/drivers/tty/serial/nwpserial.c
+++ b/drivers/tty/serial/nwpserial.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
Building booke_wdt fails when trying to build as a module as there is no
early_param() in module. Fix by using module_param() instead of early_param().

Signed-off-by: Pranith Kumar 
CC: Guenter Roeck 
---
 drivers/watchdog/booke_wdt.c | 28 +---
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..65f5e9f 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -30,8 +30,6 @@
  * occur, and the final time the board will reset.
  */
 
-u32 booke_wdt_enabled;
-u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 #define WDTP(x)x)&0x3)<<30)|(((x)&0x3c)<<15))
@@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK  (TCR_WP_MASK)
 #endif
 
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
-   if (p && strncmp(p, "0", 1) != 0)
-   booke_wdt_enabled = 1;
-
-   return 0;
-}
-early_param("wdt", early_parse_wdt);
-
-int __init early_parse_wdt_period(char *p)
-{
-   unsigned long ret;
-   if (p) {
-   if (!kstrtol(p, 0, ))
-   booke_wdt_period = ret;
-   }
-
-   return 0;
-}
-early_param("wdt_period", early_parse_wdt_period);
+static bool booke_wdt_enabled = true;
+module_param(booke_wdt_enabled, bool, 0444);
+static int  booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
+module_param(booke_wdt_period, int, 0444);
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
@@ -259,5 +240,6 @@ static int __init booke_wdt_init(void)
 module_init(booke_wdt_init);
 module_exit(booke_wdt_exit);
 
+MODULE_ALIAS("booke_wdt");
 MODULE_DESCRIPTION("PowerPC Book-E watchdog driver");
 MODULE_LICENSE("GPL");
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] booke_wdt: Fix build failure as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 9:25 AM, Guenter Roeck  wrote:
> On Tue, Aug 19, 2014 at 11:12:07PM -0400, Pranith Kumar wrote:
>> Building booke_wdt fails when trying to build as a module as there is no
>> early_param() in module. Fix by enclosing within MODULE check.
>>
> Might make more sense to replace the early_param with a normal module 
> parameter.
> Taking the module parameter away if the driver is built as module seems to be
> a bit excessive.
>
> Any idea why early_param was chosen over a standard module parameter ?


I didn't really investigate. This showed up in a randconfig build
error. I will try to convert this to module param. Thanks!

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Make SPU_FS depend on SPARSEMEM

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 3:49 AM, Geert Uytterhoeven
 wrote:

> Is this a randconfig kernel?

Yes, randconfig with ARCH=powerpc.

>
> config ARCH_SPARSEMEM_DEFAULT
>def_bool y
>depends on (SMP && PPC_PSERIES) || PPC_PS3
>
> Why is this not enabled? !SMP? !PPC_PSERIES? !PPC_PS3?

This was indeed enabled, but that does not do much. We will need
CONFIG_SPARSEMEM which depends on CONFIG_SPARSEMEM_MANUAL which was
not enabled.


>
> If PPC_CELL is enabled, this issue was introduced by
>
> commit 78bde53e351bc89cff85d1c2c7e6d7c2ffdf120d
> Author: Benjamin Herrenschmidt 
> Date:   Tue Feb 13 11:46:06 2007 +1100
>
> [POWERPC] spufs: remove need for struct page for SPEs
>
> This patch removes the need for struct page for SPE local store
> and registers from spufs. It also makes the locking much more
> obvious and no longer relying on the truncate logic black magic
> for protecting against races between unmap_mapping_range() and
> new pages faulted in. It does so by switching to a nopfn() handler
> and using the new vm_insert_pfn() to setup the PTEs itself while
> holding a lock on the SPE.
>
> The nice thing is that this patch actually removes a lot more code
> than it adds :-)
>
> Signed-off-by: Benjamin Herrenschmidt 
> Signed-off-by: Paul Mackerras 
>
>
> Another question: why does SPU_FS select MEMORY_HOTPLUG?

Not really sure :(

>
> commit 4da30d15b6d5036b0d96422d6946ca758111fae3
> Author: Geoff Levand 
> Date:   Fri Jun 23 20:57:49 2006 +0200
>
> [POWERPC] spufs: fix memory hotplug dependency
>
> spufs_base.c calls __add_pages, which depends on CONFIG_MEMORY_HOTPLUG.
>
> Moved the selection of CONFIG_MEMORY_HOTPLUG from CONFIG_SPUFS_MMAP
> to CONFIG_SPU_FS.
>
> Signed-off-by: Geoff Levand 
> Signed-off-by: Arnd Bergmann 
> Signed-off-by: Paul Mackerras 
>
> However, the call to __add_pages() has been moved a few times afterwards,
> to be finally removed in the aforementioned commit
> 78bde53e351bc89cff85d1c2c7e6d7c2ffdf120d.
>
> Does it still build/work if you just drop the "select MEMORY_HOTPLUG"?

I should have saved the config file :(. I think it will build since
the problem was that hotplug-memory.o needs CONFIG_SPARSEMEM.



-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: Fix build failure when MEMORY_HOTPLUG=y

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 4:00 AM, Geert Uytterhoeven
 wrote:

>> 1.9.1
>
> In light of my investigation for your spufs patch, I guess this is a non-SMP
> PSERIES config?

So what happens is SELECT_MEMORY_MODEL choses FLATMEM_MANUAL because
of which SPARSEMEM is not enabled despite having
ARCH_SPARSEMEM_ENABLE=y.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched: Match declaration with definition

2014-08-20 Thread tip-bot for Pranith Kumar
Commit-ID:  8b06c55bdb8b402cb4814e83dc4b1cb245fcc9f5
Gitweb: http://git.kernel.org/tip/8b06c55bdb8b402cb4814e83dc4b1cb245fcc9f5
Author: Pranith Kumar 
AuthorDate: Wed, 13 Aug 2014 13:28:12 -0400
Committer:  Ingo Molnar 
CommitDate: Wed, 20 Aug 2014 09:47:19 +0200

sched: Match declaration with definition

Match the declaration of runqueues with the definition.

Signed-off-by: Pranith Kumar 
Signed-off-by: Peter Zijlstra 
Cc: Linus Torvalds 
Link: 
http://lkml.kernel.org/r/1407950893-32731-1-git-send-email-bobby.pr...@gmail.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 579712f..4c2b87f 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -647,7 +647,7 @@ static inline int cpu_of(struct rq *rq)
 #endif
 }
 
-DECLARE_PER_CPU(struct rq, runqueues);
+DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
 
 #define cpu_rq(cpu)(_cpu(runqueues, (cpu)))
 #define this_rq()  (&__get_cpu_var(runqueues))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched: Match declaration with definition

2014-08-20 Thread tip-bot for Pranith Kumar
Commit-ID:  8b06c55bdb8b402cb4814e83dc4b1cb245fcc9f5
Gitweb: http://git.kernel.org/tip/8b06c55bdb8b402cb4814e83dc4b1cb245fcc9f5
Author: Pranith Kumar bobby.pr...@gmail.com
AuthorDate: Wed, 13 Aug 2014 13:28:12 -0400
Committer:  Ingo Molnar mi...@kernel.org
CommitDate: Wed, 20 Aug 2014 09:47:19 +0200

sched: Match declaration with definition

Match the declaration of runqueues with the definition.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
Signed-off-by: Peter Zijlstra pet...@infradead.org
Cc: Linus Torvalds torva...@linux-foundation.org
Link: 
http://lkml.kernel.org/r/1407950893-32731-1-git-send-email-bobby.pr...@gmail.com
Signed-off-by: Ingo Molnar mi...@kernel.org
---
 kernel/sched/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 579712f..4c2b87f 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -647,7 +647,7 @@ static inline int cpu_of(struct rq *rq)
 #endif
 }
 
-DECLARE_PER_CPU(struct rq, runqueues);
+DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
 
 #define cpu_rq(cpu)(per_cpu(runqueues, (cpu)))
 #define this_rq()  (__get_cpu_var(runqueues))
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] powerpc: Make SPU_FS depend on SPARSEMEM

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 3:49 AM, Geert Uytterhoeven
ge...@linux-m68k.org wrote:

 Is this a randconfig kernel?

Yes, randconfig with ARCH=powerpc.


 config ARCH_SPARSEMEM_DEFAULT
def_bool y
depends on (SMP  PPC_PSERIES) || PPC_PS3

 Why is this not enabled? !SMP? !PPC_PSERIES? !PPC_PS3?

This was indeed enabled, but that does not do much. We will need
CONFIG_SPARSEMEM which depends on CONFIG_SPARSEMEM_MANUAL which was
not enabled.



 If PPC_CELL is enabled, this issue was introduced by

 commit 78bde53e351bc89cff85d1c2c7e6d7c2ffdf120d
 Author: Benjamin Herrenschmidt b...@kernel.crashing.org
 Date:   Tue Feb 13 11:46:06 2007 +1100

 [POWERPC] spufs: remove need for struct page for SPEs

 This patch removes the need for struct page for SPE local store
 and registers from spufs. It also makes the locking much more
 obvious and no longer relying on the truncate logic black magic
 for protecting against races between unmap_mapping_range() and
 new pages faulted in. It does so by switching to a nopfn() handler
 and using the new vm_insert_pfn() to setup the PTEs itself while
 holding a lock on the SPE.

 The nice thing is that this patch actually removes a lot more code
 than it adds :-)

 Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
 Signed-off-by: Paul Mackerras pau...@samba.org


 Another question: why does SPU_FS select MEMORY_HOTPLUG?

Not really sure :(


 commit 4da30d15b6d5036b0d96422d6946ca758111fae3
 Author: Geoff Levand geoffrey.lev...@am.sony.com
 Date:   Fri Jun 23 20:57:49 2006 +0200

 [POWERPC] spufs: fix memory hotplug dependency

 spufs_base.c calls __add_pages, which depends on CONFIG_MEMORY_HOTPLUG.

 Moved the selection of CONFIG_MEMORY_HOTPLUG from CONFIG_SPUFS_MMAP
 to CONFIG_SPU_FS.

 Signed-off-by: Geoff Levand geoffrey.lev...@am.sony.com
 Signed-off-by: Arnd Bergmann arnd.bergm...@de.ibm.com
 Signed-off-by: Paul Mackerras pau...@samba.org

 However, the call to __add_pages() has been moved a few times afterwards,
 to be finally removed in the aforementioned commit
 78bde53e351bc89cff85d1c2c7e6d7c2ffdf120d.

 Does it still build/work if you just drop the select MEMORY_HOTPLUG?

I should have saved the config file :(. I think it will build since
the problem was that hotplug-memory.o needs CONFIG_SPARSEMEM.



-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: Fix build failure when MEMORY_HOTPLUG=y

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 4:00 AM, Geert Uytterhoeven
ge...@linux-m68k.org wrote:

 1.9.1

 In light of my investigation for your spufs patch, I guess this is a non-SMP
 PSERIES config?

So what happens is SELECT_MEMORY_MODEL choses FLATMEM_MANUAL because
of which SPARSEMEM is not enabled despite having
ARCH_SPARSEMEM_ENABLE=y.

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] booke_wdt: Fix build failure as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 9:25 AM, Guenter Roeck li...@roeck-us.net wrote:
 On Tue, Aug 19, 2014 at 11:12:07PM -0400, Pranith Kumar wrote:
 Building booke_wdt fails when trying to build as a module as there is no
 early_param() in module. Fix by enclosing within MODULE check.

 Might make more sense to replace the early_param with a normal module 
 parameter.
 Taking the module parameter away if the driver is built as module seems to be
 a bit excessive.

 Any idea why early_param was chosen over a standard module parameter ?


I didn't really investigate. This showed up in a randconfig build
error. I will try to convert this to module param. Thanks!

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] serial: Fix build failure caused by missing header file

2014-08-20 Thread Pranith Kumar
Fix build failure caused by missing header file:

drivers/tty/serial/nwpserial.c: In function 'wait_for_bits':
drivers/tty/serial/nwpserial.c:53:3: error: implicit declaration of function 
'udelay' [-Werror=implicit-function-declaration]

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 drivers/tty/serial/nwpserial.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/nwpserial.c b/drivers/tty/serial/nwpserial.c
index c06366b..5da7622 100644
--- a/drivers/tty/serial/nwpserial.c
+++ b/drivers/tty/serial/nwpserial.c
@@ -22,6 +22,7 @@
 #include linux/of_platform.h
 #include linux/of_device.h
 #include linux/nwpserial.h
+#include linux/delay.h
 #include asm/prom.h
 #include asm/dcr.h
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
Building booke_wdt fails when trying to build as a module as there is no
early_param() in module. Fix by using module_param() instead of early_param().

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
CC: Guenter Roeck li...@roeck-us.net
---
 drivers/watchdog/booke_wdt.c | 28 +---
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..65f5e9f 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -30,8 +30,6 @@
  * occur, and the final time the board will reset.
  */
 
-u32 booke_wdt_enabled;
-u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 #define WDTP(x)x)0x3)30)|(((x)0x3c)15))
@@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK  (TCR_WP_MASK)
 #endif
 
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
-   if (p  strncmp(p, 0, 1) != 0)
-   booke_wdt_enabled = 1;
-
-   return 0;
-}
-early_param(wdt, early_parse_wdt);
-
-int __init early_parse_wdt_period(char *p)
-{
-   unsigned long ret;
-   if (p) {
-   if (!kstrtol(p, 0, ret))
-   booke_wdt_period = ret;
-   }
-
-   return 0;
-}
-early_param(wdt_period, early_parse_wdt_period);
+static bool booke_wdt_enabled = true;
+module_param(booke_wdt_enabled, bool, 0444);
+static int  booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
+module_param(booke_wdt_period, int, 0444);
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
@@ -259,5 +240,6 @@ static int __init booke_wdt_init(void)
 module_init(booke_wdt_init);
 module_exit(booke_wdt_exit);
 
+MODULE_ALIAS(booke_wdt);
 MODULE_DESCRIPTION(PowerPC Book-E watchdog driver);
 MODULE_LICENSE(GPL);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 2:59 PM, Guenter li...@roeck-us.net wrote:
 On Wed, Aug 20, 2014 at 12:55:44PM -0400, Pranith Kumar wrote:
 Building booke_wdt fails when trying to build as a module as there is no
 early_param() in module. Fix by using module_param() instead of 
 early_param().

 Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
 CC: Guenter Roeck li...@roeck-us.net
 ---
  drivers/watchdog/booke_wdt.c | 28 +---
  1 file changed, 5 insertions(+), 23 deletions(-)

 diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
 index 08a7853..65f5e9f 100644
 --- a/drivers/watchdog/booke_wdt.c
 +++ b/drivers/watchdog/booke_wdt.c
 @@ -30,8 +30,6 @@
   * occur, and the final time the board will reset.
   */

 -u32 booke_wdt_enabled;
 -u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;

  #ifdef   CONFIG_PPC_FSL_BOOK3E
  #define WDTP(x)  x)0x3)30)|(((x)0x3c)15))
 @@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
  #define WDTP_MASK(TCR_WP_MASK)
  #endif

 -/* Checks wdt=x and wdt_period=xx command-line option */
 -notrace int __init early_parse_wdt(char *p)
 -{
 - if (p  strncmp(p, 0, 1) != 0)
 - booke_wdt_enabled = 1;
 -
 - return 0;
 -}
 -early_param(wdt, early_parse_wdt);
 -
 -int __init early_parse_wdt_period(char *p)
 -{
 - unsigned long ret;
 - if (p) {
 - if (!kstrtol(p, 0, ret))
 - booke_wdt_period = ret;
 - }
 -
 - return 0;
 -}
 -early_param(wdt_period, early_parse_wdt_period);
 +static bool booke_wdt_enabled = true;

 Any reason for changing the default from false to true ?
 Unless you have a reaslly good reason, I don't think that is a good idea.

I don't see where it was being set to false. It is
uninitialized AFAICT. Does that mean that it is false? (I thought only
static variables got that default).


 +module_param(booke_wdt_enabled, bool, 0444);
 +static int  booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 +module_param(booke_wdt_period, int, 0444);

 Also not sure if it adds value to have the module parameters visible
 from user space. Why not use 0 for the permission flags ?


I have no objection to your suggestion. But not sure if such paranoia
is warranted :)

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 3:18 PM, Pranith Kumar bobby.pr...@gmail.com wrote:
 On Wed, Aug 20, 2014 at 2:59 PM, Guenter li...@roeck-us.net wrote:


 Any reason for changing the default from false to true ?
 Unless you have a reaslly good reason, I don't think that is a good idea.

 I don't see where it was being set to false. It is
 uninitialized AFAICT. Does that mean that it is false? (I thought only
 static variables got that default).

Ohk, some googling tells me both global and static variables are
initialized to 0. Makes sense, I will send in a v2



-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
Building booke_wdt fails when trying to build as a module as there is no
early_param() in module. Fix by using module_param() instead of early_param().

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
CC: Guenter Roeck li...@roeck-us.net
---
 drivers/watchdog/booke_wdt.c | 28 +---
 1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..e96b09b 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -30,8 +30,6 @@
  * occur, and the final time the board will reset.
  */
 
-u32 booke_wdt_enabled;
-u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 #define WDTP(x)x)0x3)30)|(((x)0x3c)15))
@@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK  (TCR_WP_MASK)
 #endif
 
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
-   if (p  strncmp(p, 0, 1) != 0)
-   booke_wdt_enabled = 1;
-
-   return 0;
-}
-early_param(wdt, early_parse_wdt);
-
-int __init early_parse_wdt_period(char *p)
-{
-   unsigned long ret;
-   if (p) {
-   if (!kstrtol(p, 0, ret))
-   booke_wdt_period = ret;
-   }
-
-   return 0;
-}
-early_param(wdt_period, early_parse_wdt_period);
+static bool booke_wdt_enabled;
+module_param(booke_wdt_enabled, bool, 0);
+static int  booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
+module_param(booke_wdt_period, int, 0);
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
@@ -259,5 +240,6 @@ static int __init booke_wdt_init(void)
 module_init(booke_wdt_init);
 module_exit(booke_wdt_exit);
 
+MODULE_ALIAS(booke_wdt);
 MODULE_DESCRIPTION(PowerPC Book-E watchdog driver);
 MODULE_LICENSE(GPL);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] powerpc: booke_wdt: Fix build error as a module

2014-08-20 Thread Pranith Kumar
On Wed, Aug 20, 2014 at 4:10 PM, Guenter Roeck li...@roeck-us.net wrote:
 On Wed, Aug 20, 2014 at 03:26:46PM -0400, Pranith Kumar wrote:
 Building booke_wdt fails when trying to build as a module as there is no
 early_param() in module. Fix by using module_param() instead of 
 early_param().

 Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
 CC: Guenter Roeck li...@roeck-us.net

 Looks good as far as I can see. One question though:

 +MODULE_ALIAS(booke_wdt);

 Is this necessary ? If yes, shouldn't it be a separate patch to be applied
 to -stable ?

Suppose this was actually built as a module. How do you pass the
module parameters to this module? Only ways I know of are

./insmod booke_wdt booke_wdt_enabled=1 booke_wdt_period=3

or pass booke_wdt.booke_wdt_enabled=1 on the kernel boot params list.

So the alias is necessary to refer to this module to pass params.

About separate patch, I think it is only with conversion to
module_param() that we need this alias.

Am I missing something?

-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: fsl_pamu_domain: Fix build error

2014-08-19 Thread Pranith Kumar
Fix build failure in fsl_pamu_domain.o caused as follows

drivers/iommu/fsl_pamu_domain.c: In function 'pamu_domain_init':
drivers/iommu/fsl_pamu_domain.c:1103:17: error: 'pci_bus_type' undeclared
(first use in this function)
drivers/iommu/fsl_pamu_domain.c:1103:17: note: each undeclared identifier is
reported only once for each function it appears in
make[2]: *** [drivers/iommu/fsl_pamu_domain.o] Error 1
make[1]: *** [drivers/iommu] Error 2
make: *** [drivers] Error 2

We fix this by trying to dereference pci_bus_type only if CONFIG_PCI is defined.

Signed-off-by: Pranith Kumar 
---
 drivers/iommu/fsl_pamu_domain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 61d1daf..bb56f86 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -1099,7 +1099,9 @@ int pamu_domain_init(void)
return ret;
 
bus_set_iommu(_bus_type, _pamu_ops);
+#ifdef CONFIG_PCI
bus_set_iommu(_bus_type, _pamu_ops);
+#endif
 
return ret;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Export dcr_ind_lock to fix build error

2014-08-19 Thread Pranith Kumar
Fix build error caused by missing export:

ERROR: "dcr_ind_lock" [drivers/net/ethernet/ibm/emac/ibm_emac.ko] undefined!

Signed-off-by: Pranith Kumar 
---
 arch/powerpc/sysdev/dcr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index e9056e4..2d8a101 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -230,5 +230,6 @@ EXPORT_SYMBOL_GPL(dcr_unmap_mmio);
 
 #ifdef CONFIG_PPC_DCR_NATIVE
 DEFINE_SPINLOCK(dcr_ind_lock);
+EXPORT_SYMBOL_GPL(dcr_ind_lock);
 #endif /* defined(CONFIG_PPC_DCR_NATIVE) */
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] booke_wdt: Fix build failure as a module

2014-08-19 Thread Pranith Kumar
Building booke_wdt fails when trying to build as a module as there is no
early_param() in module. Fix by enclosing within MODULE check.

Also remove notrace attribute as it is implicit in the __init attribute.

Signed-off-by: Pranith Kumar 
---
 drivers/watchdog/booke_wdt.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..8a26b54 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -41,8 +41,9 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK  (TCR_WP_MASK)
 #endif
 
+#ifndef MODULE
 /* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
+int __init early_parse_wdt(char *p)
 {
if (p && strncmp(p, "0", 1) != 0)
booke_wdt_enabled = 1;
@@ -63,6 +64,8 @@ int __init early_parse_wdt_period(char *p)
 }
 early_param("wdt_period", early_parse_wdt_period);
 
+#endif /* #ifndef MODULE */
+
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
 /* For the specified period, determine the number of seconds
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Pranith Kumar
On Tue, Aug 19, 2014 at 6:19 PM, Scott Wood  wrote:

>>  config PPC_256K_PAGES
>>   bool "256k page size" if 44x
>> - depends on !STDBINUTILS
>> + depends on !PPC32 && !STDBINUTILS
>>   help
>> Make the page size 256k.
>>
>
> How will this ever be selected then?  44x is 32-bit only.

Indeed. I am actually confused about the error which is being thrown
here. The operand (65536) is actually within the range. Any suggestions
on how to fix this?


-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Pranith Kumar
256k pages are not tested on PPC32. On a randconfig I got the following error:

arch/powerpc/kernel/misc_32.S:1171: Error: operand out of range 
(0x0001 is not between 0x8000 and 0x7fff)

Disable 256K pages if PPC32=y

Signed-off-by: Pranith Kumar 
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index da16ffe..6cc518f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -556,7 +556,7 @@ config PPC_64K_PAGES
 
 config PPC_256K_PAGES
bool "256k page size" if 44x
-   depends on !STDBINUTILS
+   depends on !PPC32 && !STDBINUTILS
help
  Make the page size 256k.
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH] powerpc: Make SPU_FS depend on SPARSEMEM

2014-08-19 Thread Pranith Kumar
SPU_FS unconditionally enables MEMORY_HOTPLUG, which will fail to build if
SPARSEMEM=n.

Make SPU_FS depend on SPARSEMEM so that hotplug-memory.c does not fail to
compile.

Signed-off-by: Pranith Kumar 
---
 arch/powerpc/platforms/cell/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/Kconfig 
b/arch/powerpc/platforms/cell/Kconfig
index 9978f59..832872e 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -60,7 +60,7 @@ menu "Cell Broadband Engine options"
 config SPU_FS
tristate "SPU file system"
default m
-   depends on PPC_CELL
+   depends on PPC_CELL && SPARSEMEM
select SPU_BASE
select MEMORY_HOTPLUG
help
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] edac: Fix build error caused by wrong member access

2014-08-19 Thread Pranith Kumar
Fix the following error 

drivers/edac/ppc4xx_edac.c:977:45: error: request for member 'dimm' in something
not a structure or union

by changing member access to pointer dereference

Signed-off-by: Pranith Kumar 
CC: Andre Morton 
---
 drivers/edac/ppc4xx_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c
index ef6b7e0..0f04d5e 100644
--- a/drivers/edac/ppc4xx_edac.c
+++ b/drivers/edac/ppc4xx_edac.c
@@ -974,7 +974,7 @@ static int ppc4xx_edac_init_csrows(struct mem_ctl_info 
*mci, u32 mcopt1)
 * page size (PAGE_SIZE) or the memory width (2 or 4).
 */
for (j = 0; j < csi->nr_channels; j++) {
-   struct dimm_info *dimm = csi->channels[j].dimm;
+   struct dimm_info *dimm = csi->channels[j]->dimm;
 
dimm->nr_pages  = nr_pages / csi->nr_channels;
dimm->grain = 1;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build failure when MEMORY_HOTPLUG=y

2014-08-19 Thread Pranith Kumar
ARCH_ENABLE_MEMORY_HOTPLUG is enabled by default for powerpc. This causes build
failures when SPARSEMEM=n as memory hotplug needs definition which are defined
only when SPARSEMEM=y. The error is as follows:

arch/powerpc/platforms/pseries/hotplug-memory.c:27:31: error: 
'SECTION_SIZE_BITS' undeclared (first use in this function)
arch/powerpc/platforms/pseries/hotplug-memory.c:27:31: note: each undeclared 
identifier is reported only once for each function it appears in
arch/powerpc/platforms/pseries/hotplug-memory.c: In function 
'pseries_remove_memblock':
arch/powerpc/platforms/pseries/hotplug-memory.c:98:34: error: 
'SECTION_SIZE_BITS' undeclared (first use in this function)
make[2]: *** [arch/powerpc/platforms/pseries/hotplug-memory.o] Error 1

Signed-off-by: Pranith Kumar 
CC: Andew Morton 
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9c1aa77..da16ffe 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -383,6 +383,7 @@ config ARCH_CPU_PROBE_RELEASE
 
 config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
+   depends on SPARSEMEM
 
 config ARCH_HAS_WALK_MEMORY
def_bool y
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build failure when MEMORY_HOTPLUG=y

2014-08-19 Thread Pranith Kumar
ARCH_ENABLE_MEMORY_HOTPLUG is enabled by default for powerpc. This causes build
failures when SPARSEMEM=n as memory hotplug needs definition which are defined
only when SPARSEMEM=y. The error is as follows:

arch/powerpc/platforms/pseries/hotplug-memory.c:27:31: error: 
'SECTION_SIZE_BITS' undeclared (first use in this function)
arch/powerpc/platforms/pseries/hotplug-memory.c:27:31: note: each undeclared 
identifier is reported only once for each function it appears in
arch/powerpc/platforms/pseries/hotplug-memory.c: In function 
'pseries_remove_memblock':
arch/powerpc/platforms/pseries/hotplug-memory.c:98:34: error: 
'SECTION_SIZE_BITS' undeclared (first use in this function)
make[2]: *** [arch/powerpc/platforms/pseries/hotplug-memory.o] Error 1

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
CC: Andew Morton a...@linux-foundation.org
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9c1aa77..da16ffe 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -383,6 +383,7 @@ config ARCH_CPU_PROBE_RELEASE
 
 config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
+   depends on SPARSEMEM
 
 config ARCH_HAS_WALK_MEMORY
def_bool y
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] edac: Fix build error caused by wrong member access

2014-08-19 Thread Pranith Kumar
Fix the following error 

drivers/edac/ppc4xx_edac.c:977:45: error: request for member 'dimm' in something
not a structure or union

by changing member access to pointer dereference

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
CC: Andre Morton a...@linux-foundation.org
---
 drivers/edac/ppc4xx_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c
index ef6b7e0..0f04d5e 100644
--- a/drivers/edac/ppc4xx_edac.c
+++ b/drivers/edac/ppc4xx_edac.c
@@ -974,7 +974,7 @@ static int ppc4xx_edac_init_csrows(struct mem_ctl_info 
*mci, u32 mcopt1)
 * page size (PAGE_SIZE) or the memory width (2 or 4).
 */
for (j = 0; j  csi-nr_channels; j++) {
-   struct dimm_info *dimm = csi-channels[j].dimm;
+   struct dimm_info *dimm = csi-channels[j]-dimm;
 
dimm-nr_pages  = nr_pages / csi-nr_channels;
dimm-grain = 1;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH] powerpc: Make SPU_FS depend on SPARSEMEM

2014-08-19 Thread Pranith Kumar
SPU_FS unconditionally enables MEMORY_HOTPLUG, which will fail to build if
SPARSEMEM=n.

Make SPU_FS depend on SPARSEMEM so that hotplug-memory.c does not fail to
compile.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/platforms/cell/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/Kconfig 
b/arch/powerpc/platforms/cell/Kconfig
index 9978f59..832872e 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -60,7 +60,7 @@ menu Cell Broadband Engine options
 config SPU_FS
tristate SPU file system
default m
-   depends on PPC_CELL
+   depends on PPC_CELL  SPARSEMEM
select SPU_BASE
select MEMORY_HOTPLUG
help
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Pranith Kumar
256k pages are not tested on PPC32. On a randconfig I got the following error:

arch/powerpc/kernel/misc_32.S:1171: Error: operand out of range 
(0x0001 is not between 0x8000 and 0x7fff)

Disable 256K pages if PPC32=y

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index da16ffe..6cc518f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -556,7 +556,7 @@ config PPC_64K_PAGES
 
 config PPC_256K_PAGES
bool 256k page size if 44x
-   depends on !STDBINUTILS
+   depends on !PPC32  !STDBINUTILS
help
  Make the page size 256k.
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Pranith Kumar
On Tue, Aug 19, 2014 at 6:19 PM, Scott Wood scottw...@freescale.com wrote:

  config PPC_256K_PAGES
   bool 256k page size if 44x
 - depends on !STDBINUTILS
 + depends on !PPC32  !STDBINUTILS
   help
 Make the page size 256k.


 How will this ever be selected then?  44x is 32-bit only.

Indeed. I am actually confused about the error which is being thrown
here. The operand (65536) is actually within the range. Any suggestions
on how to fix this?


-- 
Pranith
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] booke_wdt: Fix build failure as a module

2014-08-19 Thread Pranith Kumar
Building booke_wdt fails when trying to build as a module as there is no
early_param() in module. Fix by enclosing within MODULE check.

Also remove notrace attribute as it is implicit in the __init attribute.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 drivers/watchdog/booke_wdt.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..8a26b54 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -41,8 +41,9 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK  (TCR_WP_MASK)
 #endif
 
+#ifndef MODULE
 /* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
+int __init early_parse_wdt(char *p)
 {
if (p  strncmp(p, 0, 1) != 0)
booke_wdt_enabled = 1;
@@ -63,6 +64,8 @@ int __init early_parse_wdt_period(char *p)
 }
 early_param(wdt_period, early_parse_wdt_period);
 
+#endif /* #ifndef MODULE */
+
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
 /* For the specified period, determine the number of seconds
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Export dcr_ind_lock to fix build error

2014-08-19 Thread Pranith Kumar
Fix build error caused by missing export:

ERROR: dcr_ind_lock [drivers/net/ethernet/ibm/emac/ibm_emac.ko] undefined!

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/sysdev/dcr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index e9056e4..2d8a101 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -230,5 +230,6 @@ EXPORT_SYMBOL_GPL(dcr_unmap_mmio);
 
 #ifdef CONFIG_PPC_DCR_NATIVE
 DEFINE_SPINLOCK(dcr_ind_lock);
+EXPORT_SYMBOL_GPL(dcr_ind_lock);
 #endif /* defined(CONFIG_PPC_DCR_NATIVE) */
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: fsl_pamu_domain: Fix build error

2014-08-19 Thread Pranith Kumar
Fix build failure in fsl_pamu_domain.o caused as follows

drivers/iommu/fsl_pamu_domain.c: In function 'pamu_domain_init':
drivers/iommu/fsl_pamu_domain.c:1103:17: error: 'pci_bus_type' undeclared
(first use in this function)
drivers/iommu/fsl_pamu_domain.c:1103:17: note: each undeclared identifier is
reported only once for each function it appears in
make[2]: *** [drivers/iommu/fsl_pamu_domain.o] Error 1
make[1]: *** [drivers/iommu] Error 2
make: *** [drivers] Error 2

We fix this by trying to dereference pci_bus_type only if CONFIG_PCI is defined.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 drivers/iommu/fsl_pamu_domain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 61d1daf..bb56f86 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -1099,7 +1099,9 @@ int pamu_domain_init(void)
return ret;
 
bus_set_iommu(platform_bus_type, fsl_pamu_ops);
+#ifdef CONFIG_PCI
bus_set_iommu(pci_bus_type, fsl_pamu_ops);
+#endif
 
return ret;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build error caused by vga16fb

2014-08-18 Thread Pranith Kumar
vga16fb causes a build failure on PPC 32 as follows

drivers/built-in.o: In function `vga16fb_probe':
drivers/video/fbdev/vga16fb.c:1326: undefined reference to `vgacon_remap_base'
drivers/video/fbdev/vga16fb.c:1326: undefined reference to `vgacon_remap_base'
make: *** [vmlinux] Error 1

It was noted by Geert that in PPC, no one is setting vgacon_remap_base because
of which it working on PPC is suspect.

Fix the build failure by disabling vga16fb on PPC.

Signed-off-by: Pranith Kumar 
Reported-by: Geert Uytterhoeven 
CC: Andrew Morton 
---
 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 e911b9c..d236fe4 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -547,7 +547,7 @@ config FB_IMSTT
 
 config FB_VGA16
tristate "VGA 16-color graphics support"
-   depends on FB && (X86 || PPC)
+   depends on FB && X86
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: Fix build error for vga16fb

2014-08-18 Thread Pranith Kumar
On Mon, Aug 18, 2014 at 5:28 PM, Geert Uytterhoeven
 wrote:

> Digging a bit deeper: There's no code left in arch/powerpc that actually
> sets vgacon_remap_base, so it's not gonna work anyway.
> It seems vga16 support on PPC died with the removal of arch/ppc/.

OK. I will remove the dependency on PPC for vga16fb.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build error for vga16fb

2014-08-18 Thread Pranith Kumar
Fix a build error caused by

drivers/built-in.o: In function `vga16fb_probe':
drivers/video/fbdev/vga16fb.c:1326: undefined reference to `vgacon_remap_base' 
drivers/video/fbdev/vga16fb.c:1326: undefined reference to `vgacon_remap_base'
make: *** [vmlinux] Error 1

This is occuring as vgacon_remap_base is exported only when
CONFIG_VGA_CONSOLE=y. Fix the error by making FB_VBA16 depend on
CONFIG_VGA_CONSOLE.

Signed-off-by: Pranith Kumar 
Reported-by: Geert Uytterhoeven 
CC: Andrew Morton 
---
 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 e911b9c..09df564 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -547,7 +547,7 @@ config FB_IMSTT
 
 config FB_VGA16
tristate "VGA 16-color graphics support"
-   depends on FB && (X86 || PPC)
+   depends on FB && (X86 || PPC) && CONFIG_VGA_CONSOLE
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] ppc: Fix build error with CONFIG_PCI=n

2014-08-18 Thread Pranith Kumar
Fix ppc 32 build failure as reported here:

http://kisskb.ellerman.id.au/kisskb/buildresult/11663513/

The error is as follows:

arch/powerpc/include/asm/floppy.h:142:20: error: 'isa_bridge_pcidev' undeclared
(first use in this function)

This is happening since floppy.o is enabled by BLK_DEV_FD which depends on
ARCH_MAY_HAVE_PC_FDC which is in-turn enabled if PPC_PSERIES=n. 

The following commit changes the dependency so that ARCH_MAY_HAVE_PC_FDC is
dependent exclusively on PCI since otherwise it will not compile.

Signed-off-by: Pranith Kumar 
Reported-by: Geert Uytterhoeven 
CC: Andrew Morton 
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a577609f..9c1aa77 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -182,7 +182,7 @@ config SCHED_OMIT_FRAME_POINTER
 
 config ARCH_MAY_HAVE_PC_FDC
bool
-   default !PPC_PSERIES || PCI
+   default PCI
 
 config PPC_OF
def_bool y
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: Fix build failure for PPC_32

2014-08-18 Thread Pranith Kumar
On Mon, Aug 18, 2014 at 4:57 PM, Geert Uytterhoeven
 wrote:
>
> Note that PowerPC supports multi-platform kernels.
> A kernel with PPC_PSERIES and something else with PCI may still want to
> have floppy support.

OK, I tested with your change and it works. I needed to make one more
change for it compile all the way through though.

I will send both of the patches shortly.

-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] powerpc: Fix build failure for PPC_32

2014-08-18 Thread Pranith Kumar
On Mon, Aug 18, 2014 at 3:28 PM, Geert Uytterhoeven
 wrote:
>
> Hi Pranith,
>
> On Mon, Aug 18, 2014 at 9:01 PM, Pranith Kumar  wrote:
> > Fix ppc 32 build failure as reported here:
> >
> > http://kisskb.ellerman.id.au/kisskb/buildresult/11663513/
>
> | arch/powerpc/include/asm/floppy.h:142:20: error: 'isa_bridge_pcidev'
> undeclared (first use in this function)
> | make[3]: *** [drivers/block/floppy.o] Error 1
>
> The definition of isa_bridge_pcidev is only available if CONFIG_PCI=y...
>
> > The error is that pci_32.o was not being built for PPC_32. Fix error by 
> > adding
> > it in the Makefile. Tested using the ppc cross compiler.
>
> ... so how can adding this make the floppy.h error go away?


So the definition which you are talking about within CONFIG_PCI=y is
an extern definition

arch/powerpc/include/asm/ppc-pci.h:28:extern struct pci_dev *isa_bridge_pcidev;

If you build pci_32.o unconditionally, there is an

EXPORT_SYMBOL(isa_bridge_pcidev);

which supplies the required symbol.

But yes, you are right in that we should not unconditionally compile
pci_32.o. Making floppy depend on PCI is the right thing to do.
However,

>
>
> Note that arch/powerpc/kernel/Makefile does add
> pci_$(CONFIG_WORD_SIZE).o, but only if CONFIG_PCI=y.
>
> So, thanks for your patch, but I don't think your fix is the right solution.
>
> However, drivers/block/floppy.o is enabled by BLK_DEV_FD, which
> depends on ARCH_MAY_HAVE_PC_FDC.
>
> arch/powerpc/Kconfig has:
>
> config ARCH_MAY_HAVE_PC_FDC
> bool
> default !PPC_PSERIES || PCI
>
> PCI is not set, and PPC_PSERIES is also not set, so this
> defaults to y, which is obviously not correct, as floppy.h needs PCI.
>
> As this symbol doesn't enable floppy support in-se, probably it should just
> be:
>
> config ARCH_MAY_HAVE_PC_FDC
> bool
> depends on PCI


the right thing I guess here is to depend on !PPC_PSERIES && PCI since
I guess pSeries does not support floppy.h (hence the original
condition check?).

Note that there are other unrelated errors which do not let me
complete the PPC 32 build with the config there yet. I just verified
this symbol error.

>
> This config line was last touched by
> commit bed59275810a55500e885cbdc5c2a0507f13c00e
> Author: Stephen Rothwell 
> Date:   Sun Mar 4 17:04:44 2007 +1100
>
> [POWERPC] Allow pSeries to build without CONFIG_PCI
>
> Signed-off-by: Stephen Rothwell 
> Signed-off-by: Paul Mackerras 


-- 
Pranith
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] powerpc: Fix build failure for PPC_32

2014-08-18 Thread Pranith Kumar
Fix ppc 32 build failure as reported here:

http://kisskb.ellerman.id.au/kisskb/buildresult/11663513/

The error is that pci_32.o was not being built for PPC_32. Fix error by adding
it in the Makefile. Tested using the ppc cross compiler.

Signed-off-by: Pranith Kumar 
Reported-by: Geert Uytterhoeven 
CC: Andrew Morton 
---
 arch/powerpc/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 670c312..3206ba1 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -89,7 +89,7 @@ extra-y   += vmlinux.lds
 
 obj-$(CONFIG_RELOCATABLE_PPC32)+= reloc_32.o
 
-obj-$(CONFIG_PPC32)+= entry_32.o setup_32.o
+obj-$(CONFIG_PPC32)+= entry_32.o setup_32.o pci_32.o
 obj-$(CONFIG_PPC64)+= dma-iommu.o iommu.o
 obj-$(CONFIG_KGDB) += kgdb.o
 obj-$(CONFIG_MODULES)  += ppc_ksyms.o
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] flush_icache_range: Export symbol to fix build errors

2014-08-18 Thread Pranith Kumar
Fix building errors occuring due to a missing export of flush_icache_range() in

kisskb.ellerman.id.au/kisskb/buildresult/11677809/

ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined!

Signed-off-by: Pranith Kumar 
Reported-by: Geert Uytterhoeven 
CC: Andrew Morton 
---
 arch/arc/mm/cache_arc700.c | 1 +
 arch/hexagon/mm/cache.c| 1 +
 arch/sh/mm/cache.c | 1 +
 arch/tile/kernel/smp.c | 1 +
 arch/xtensa/kernel/smp.c   | 1 +
 5 files changed, 5 insertions(+)

diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c
index 4670afc..e88ddbf 100644
--- a/arch/arc/mm/cache_arc700.c
+++ b/arch/arc/mm/cache_arc700.c
@@ -581,6 +581,7 @@ void flush_icache_range(unsigned long kstart, unsigned long 
kend)
tot_sz -= sz;
}
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /*
  * General purpose helper to make I and D cache lines consistent.
diff --git a/arch/hexagon/mm/cache.c b/arch/hexagon/mm/cache.c
index fe14ccf..0c76c80 100644
--- a/arch/hexagon/mm/cache.c
+++ b/arch/hexagon/mm/cache.c
@@ -68,6 +68,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
);
local_irq_restore(flags);
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 void hexagon_clean_dcache_range(unsigned long start, unsigned long end)
 {
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index 097c2cd..f770e39 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -229,6 +229,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
 
cacheop_on_each_cpu(local_flush_icache_range, (void *), 1);
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 void flush_icache_page(struct vm_area_struct *vma, struct page *page)
 {
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c
index 01e8ab2..19eaa62 100644
--- a/arch/tile/kernel/smp.c
+++ b/arch/tile/kernel/smp.c
@@ -183,6 +183,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
preempt_enable();
}
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 
 /* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
index 40b5a37..4d02e38 100644
--- a/arch/xtensa/kernel/smp.c
+++ b/arch/xtensa/kernel/smp.c
@@ -571,6 +571,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
};
on_each_cpu(ipi_flush_icache_range, , 1);
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /* - */
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] flush_icache_range: Export symbol to fix build errors

2014-08-18 Thread Pranith Kumar
Fix building errors occuring due to a missing export of flush_icache_range() in

kisskb.ellerman.id.au/kisskb/buildresult/11677809/

ERROR: flush_icache_range [drivers/misc/lkdtm.ko] undefined!

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
Reported-by: Geert Uytterhoeven ge...@linux-m68k.org
CC: Andrew Morton a...@linux-foundation.org
---
 arch/arc/mm/cache_arc700.c | 1 +
 arch/hexagon/mm/cache.c| 1 +
 arch/sh/mm/cache.c | 1 +
 arch/tile/kernel/smp.c | 1 +
 arch/xtensa/kernel/smp.c   | 1 +
 5 files changed, 5 insertions(+)

diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c
index 4670afc..e88ddbf 100644
--- a/arch/arc/mm/cache_arc700.c
+++ b/arch/arc/mm/cache_arc700.c
@@ -581,6 +581,7 @@ void flush_icache_range(unsigned long kstart, unsigned long 
kend)
tot_sz -= sz;
}
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /*
  * General purpose helper to make I and D cache lines consistent.
diff --git a/arch/hexagon/mm/cache.c b/arch/hexagon/mm/cache.c
index fe14ccf..0c76c80 100644
--- a/arch/hexagon/mm/cache.c
+++ b/arch/hexagon/mm/cache.c
@@ -68,6 +68,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
);
local_irq_restore(flags);
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 void hexagon_clean_dcache_range(unsigned long start, unsigned long end)
 {
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c
index 097c2cd..f770e39 100644
--- a/arch/sh/mm/cache.c
+++ b/arch/sh/mm/cache.c
@@ -229,6 +229,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
 
cacheop_on_each_cpu(local_flush_icache_range, (void *)data, 1);
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 void flush_icache_page(struct vm_area_struct *vma, struct page *page)
 {
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c
index 01e8ab2..19eaa62 100644
--- a/arch/tile/kernel/smp.c
+++ b/arch/tile/kernel/smp.c
@@ -183,6 +183,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
preempt_enable();
}
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 
 /* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
index 40b5a37..4d02e38 100644
--- a/arch/xtensa/kernel/smp.c
+++ b/arch/xtensa/kernel/smp.c
@@ -571,6 +571,7 @@ void flush_icache_range(unsigned long start, unsigned long 
end)
};
on_each_cpu(ipi_flush_icache_range, fd, 1);
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 /* - */
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


<    1   2   3   4   5   6   7   8   9   10   >