* [PATCH v2 1/5] powerpc/pseries: extract of_helpers module
@ 2015-08-11 11:23 Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 2/5] powerpc/pseries: fix a potential memory leak Andy Shevchenko
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Andy Shevchenko @ 2015-08-11 11:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
Segher Boessenkool
Cc: Andy Shevchenko
Extract a new module to share the code between other modules.
There is no functional change.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/powerpc/platforms/pseries/Makefile | 1 +
arch/powerpc/platforms/pseries/of_helpers.c | 38 +++++++++++++++++++++++++++++
arch/powerpc/platforms/pseries/of_helpers.h | 8 ++++++
arch/powerpc/platforms/pseries/reconfig.c | 34 ++------------------------
4 files changed, 49 insertions(+), 32 deletions(-)
create mode 100644 arch/powerpc/platforms/pseries/of_helpers.c
create mode 100644 arch/powerpc/platforms/pseries/of_helpers.h
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 0348079..2e857c2 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -2,6 +2,7 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
ccflags-$(CONFIG_PPC_PSERIES_DEBUG) += -DDEBUG
obj-y := lpar.o hvCall.o nvram.o reconfig.o \
+ of_helpers.o \
setup.o iommu.o event_sources.o ras.o \
firmware.o power.o dlpar.o mobility.o rng.o
obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/powerpc/platforms/pseries/of_helpers.c b/arch/powerpc/platforms/pseries/of_helpers.c
new file mode 100644
index 0000000..1cbd896
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/of_helpers.c
@@ -0,0 +1,38 @@
+#include <linux/string.h>
+#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+
+#include "of_helpers.h"
+
+/**
+ * pseries_of_derive_parent - basically like dirname(1)
+ * @path: the full_name of a node to be added to the tree
+ *
+ * Returns the node which should be the parent of the node
+ * described by path. E.g., for path = "/foo/bar", returns
+ * the node with full_name = "/foo".
+ */
+struct device_node *pseries_of_derive_parent(const char *path)
+{
+ struct device_node *parent = NULL;
+ char *parent_path = "/";
+ size_t parent_path_len = strrchr(path, '/') - path + 1;
+
+ /* reject if path is "/" */
+ if (!strcmp(path, "/"))
+ return ERR_PTR(-EINVAL);
+
+ if (strrchr(path, '/') != path) {
+ parent_path = kmalloc(parent_path_len, GFP_KERNEL);
+ if (!parent_path)
+ return ERR_PTR(-ENOMEM);
+ strlcpy(parent_path, path, parent_path_len);
+ }
+ parent = of_find_node_by_path(parent_path);
+ if (!parent)
+ return ERR_PTR(-EINVAL);
+ if (strcmp(parent_path, "/"))
+ kfree(parent_path);
+ return parent;
+}
diff --git a/arch/powerpc/platforms/pseries/of_helpers.h b/arch/powerpc/platforms/pseries/of_helpers.h
new file mode 100644
index 0000000..bb83d39
--- /dev/null
+++ b/arch/powerpc/platforms/pseries/of_helpers.h
@@ -0,0 +1,8 @@
+#ifndef _PSERIES_OF_HELPERS_H
+#define _PSERIES_OF_HELPERS_H
+
+#include <linux/of.h>
+
+struct device_node *pseries_of_derive_parent(const char *path);
+
+#endif /* _PSERIES_OF_HELPERS_H */
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 0f31952..7c7fcc0 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -22,37 +22,7 @@
#include <asm/uaccess.h>
#include <asm/mmu.h>
-/**
- * derive_parent - basically like dirname(1)
- * @path: the full_name of a node to be added to the tree
- *
- * Returns the node which should be the parent of the node
- * described by path. E.g., for path = "/foo/bar", returns
- * the node with full_name = "/foo".
- */
-static struct device_node *derive_parent(const char *path)
-{
- struct device_node *parent = NULL;
- char *parent_path = "/";
- size_t parent_path_len = strrchr(path, '/') - path + 1;
-
- /* reject if path is "/" */
- if (!strcmp(path, "/"))
- return ERR_PTR(-EINVAL);
-
- if (strrchr(path, '/') != path) {
- parent_path = kmalloc(parent_path_len, GFP_KERNEL);
- if (!parent_path)
- return ERR_PTR(-ENOMEM);
- strlcpy(parent_path, path, parent_path_len);
- }
- parent = of_find_node_by_path(parent_path);
- if (!parent)
- return ERR_PTR(-EINVAL);
- if (strcmp(parent_path, "/"))
- kfree(parent_path);
- return parent;
-}
+#include "of_helpers.h"
static int pSeries_reconfig_add_node(const char *path, struct property *proplist)
{
@@ -71,7 +41,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
of_node_set_flag(np, OF_DYNAMIC);
of_node_init(np);
- np->parent = derive_parent(path);
+ np->parent = pseries_of_derive_parent(path);
if (IS_ERR(np->parent)) {
err = PTR_ERR(np->parent);
goto out_err;
--
2.5.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] powerpc/pseries: fix a potential memory leak
2015-08-11 11:23 [PATCH v2 1/5] powerpc/pseries: extract of_helpers module Andy Shevchenko
@ 2015-08-11 11:23 ` Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 3/5] powerpc/pseries: replace kmalloc + strlcpy Andy Shevchenko
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2015-08-11 11:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
Segher Boessenkool
Cc: Andy Shevchenko
In case we have a full node name like /foo/bar and /foo is not found the
parent_path left unfreed. So, free a memory before return to a caller.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/powerpc/platforms/pseries/of_helpers.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/of_helpers.c b/arch/powerpc/platforms/pseries/of_helpers.c
index 1cbd896..2f363e3 100644
--- a/arch/powerpc/platforms/pseries/of_helpers.c
+++ b/arch/powerpc/platforms/pseries/of_helpers.c
@@ -15,7 +15,7 @@
*/
struct device_node *pseries_of_derive_parent(const char *path)
{
- struct device_node *parent = NULL;
+ struct device_node *parent;
char *parent_path = "/";
size_t parent_path_len = strrchr(path, '/') - path + 1;
@@ -30,9 +30,7 @@ struct device_node *pseries_of_derive_parent(const char *path)
strlcpy(parent_path, path, parent_path_len);
}
parent = of_find_node_by_path(parent_path);
- if (!parent)
- return ERR_PTR(-EINVAL);
if (strcmp(parent_path, "/"))
kfree(parent_path);
- return parent;
+ return parent ? parent : ERR_PTR(-EINVAL);
}
--
2.5.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/5] powerpc/pseries: replace kmalloc + strlcpy
2015-08-11 11:23 [PATCH v2 1/5] powerpc/pseries: extract of_helpers module Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 2/5] powerpc/pseries: fix a potential memory leak Andy Shevchenko
@ 2015-08-11 11:23 ` Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 4/5] powerpc/pseries: handle nodes without '/' Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 5/5] powerpc/pseries: re-use code from of_helpers module Andy Shevchenko
3 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2015-08-11 11:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
Segher Boessenkool
Cc: Andy Shevchenko
The helper kstrndup() will do the same in one line.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/powerpc/platforms/pseries/of_helpers.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/of_helpers.c b/arch/powerpc/platforms/pseries/of_helpers.c
index 2f363e3..8c6b05a 100644
--- a/arch/powerpc/platforms/pseries/of_helpers.c
+++ b/arch/powerpc/platforms/pseries/of_helpers.c
@@ -24,10 +24,9 @@ struct device_node *pseries_of_derive_parent(const char *path)
return ERR_PTR(-EINVAL);
if (strrchr(path, '/') != path) {
- parent_path = kmalloc(parent_path_len, GFP_KERNEL);
+ parent_path = kstrndup(path, parent_path_len, GFP_KERNEL);
if (!parent_path)
return ERR_PTR(-ENOMEM);
- strlcpy(parent_path, path, parent_path_len);
}
parent = of_find_node_by_path(parent_path);
if (strcmp(parent_path, "/"))
--
2.5.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 4/5] powerpc/pseries: handle nodes without '/'
2015-08-11 11:23 [PATCH v2 1/5] powerpc/pseries: extract of_helpers module Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 2/5] powerpc/pseries: fix a potential memory leak Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 3/5] powerpc/pseries: replace kmalloc + strlcpy Andy Shevchenko
@ 2015-08-11 11:23 ` Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 5/5] powerpc/pseries: re-use code from of_helpers module Andy Shevchenko
3 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2015-08-11 11:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
Segher Boessenkool
Cc: Andy Shevchenko
In case we have node without '/' strrchr() returns NULL which might lead to
crash. Replace strrchr() by kbasename() and modify condition to avoid such
behaviour.
Suggested-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/powerpc/platforms/pseries/of_helpers.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/of_helpers.c b/arch/powerpc/platforms/pseries/of_helpers.c
index 8c6b05a..4417afe 100644
--- a/arch/powerpc/platforms/pseries/of_helpers.c
+++ b/arch/powerpc/platforms/pseries/of_helpers.c
@@ -17,14 +17,14 @@ struct device_node *pseries_of_derive_parent(const char *path)
{
struct device_node *parent;
char *parent_path = "/";
- size_t parent_path_len = strrchr(path, '/') - path + 1;
+ const char *tail = kbasename(path);
/* reject if path is "/" */
if (!strcmp(path, "/"))
return ERR_PTR(-EINVAL);
- if (strrchr(path, '/') != path) {
- parent_path = kstrndup(path, parent_path_len, GFP_KERNEL);
+ if (tail > path + 1) {
+ parent_path = kstrndup(path, tail - path, GFP_KERNEL);
if (!parent_path)
return ERR_PTR(-ENOMEM);
}
--
2.5.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/5] powerpc/pseries: re-use code from of_helpers module
2015-08-11 11:23 [PATCH v2 1/5] powerpc/pseries: extract of_helpers module Andy Shevchenko
` (2 preceding siblings ...)
2015-08-11 11:23 ` [PATCH v2 4/5] powerpc/pseries: handle nodes without '/' Andy Shevchenko
@ 2015-08-11 11:23 ` Andy Shevchenko
2015-08-14 11:51 ` [v2,5/5] " Michael Ellerman
3 siblings, 1 reply; 11+ messages in thread
From: Andy Shevchenko @ 2015-08-11 11:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
Segher Boessenkool
Cc: Andy Shevchenko
The derive_parent() has similar semantics to what we have in newly introduced
of_helpers module. The replacement reduces code base and propagates the actual
error code to the caller.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/powerpc/platforms/pseries/dlpar.c | 31 +++++--------------------------
1 file changed, 5 insertions(+), 26 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 47d9cebe..b7f243c 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -18,6 +18,8 @@
#include <linux/cpu.h>
#include <linux/slab.h>
#include <linux/of.h>
+
+#include "of_helpers.h"
#include "offline_states.h"
#include "pseries.h"
@@ -244,36 +246,13 @@ cc_error:
return first_dn;
}
-static struct device_node *derive_parent(const char *path)
-{
- struct device_node *parent;
- char *last_slash;
-
- last_slash = strrchr(path, '/');
- if (last_slash == path) {
- parent = of_find_node_by_path("/");
- } else {
- char *parent_path;
- int parent_path_len = last_slash - path + 1;
- parent_path = kmalloc(parent_path_len, GFP_KERNEL);
- if (!parent_path)
- return NULL;
-
- strlcpy(parent_path, path, parent_path_len);
- parent = of_find_node_by_path(parent_path);
- kfree(parent_path);
- }
-
- return parent;
-}
-
int dlpar_attach_node(struct device_node *dn)
{
int rc;
- dn->parent = derive_parent(dn->full_name);
- if (!dn->parent)
- return -ENOMEM;
+ dn->parent = pseries_of_derive_parent(dn->full_name);
+ if (IS_ERR(dn->parent))
+ return PTR_ERR(dn_parent);
rc = of_attach_node(dn);
if (rc) {
--
2.5.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module
2015-08-11 11:23 ` [PATCH v2 5/5] powerpc/pseries: re-use code from of_helpers module Andy Shevchenko
@ 2015-08-14 11:51 ` Michael Ellerman
2015-09-30 16:19 ` Andy Shevchenko
0 siblings, 1 reply; 11+ messages in thread
From: Michael Ellerman @ 2015-08-14 11:51 UTC (permalink / raw)
To: Andy Shevchenko, Benjamin Herrenschmidt, linuxppc-dev,
Segher Boessenkool
Cc: Andy Shevchenko
On Tue, 2015-11-08 at 11:23:09 UTC, Andy Shevchenko wrote:
> The derive_parent() has similar semantics to what we have in newly introduced
> of_helpers module. The replacement reduces code base and propagates the actual
> error code to the caller.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> arch/powerpc/platforms/pseries/dlpar.c | 31 +++++--------------------------
> 1 file changed, 5 insertions(+), 26 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
> index 47d9cebe..b7f243c 100644
> --- a/arch/powerpc/platforms/pseries/dlpar.c
> +++ b/arch/powerpc/platforms/pseries/dlpar.c
> @@ -18,6 +18,8 @@
> #include <linux/cpu.h>
> #include <linux/slab.h>
> #include <linux/of.h>
> +
> +#include "of_helpers.h"
> #include "offline_states.h"
> #include "pseries.h"
>
> @@ -244,36 +246,13 @@ cc_error:
> return first_dn;
> }
>
> -static struct device_node *derive_parent(const char *path)
> -{
> - struct device_node *parent;
> - char *last_slash;
> -
> - last_slash = strrchr(path, '/');
> - if (last_slash == path) {
> - parent = of_find_node_by_path("/");
> - } else {
> - char *parent_path;
> - int parent_path_len = last_slash - path + 1;
> - parent_path = kmalloc(parent_path_len, GFP_KERNEL);
> - if (!parent_path)
> - return NULL;
> -
> - strlcpy(parent_path, path, parent_path_len);
> - parent = of_find_node_by_path(parent_path);
> - kfree(parent_path);
> - }
> -
> - return parent;
> -}
> -
> int dlpar_attach_node(struct device_node *dn)
> {
> int rc;
>
> - dn->parent = derive_parent(dn->full_name);
> - if (!dn->parent)
> - return -ENOMEM;
> + dn->parent = pseries_of_derive_parent(dn->full_name);
> + if (IS_ERR(dn->parent))
> + return PTR_ERR(dn_parent);
^
?
There are cross compilers on kernel.org, or on Ubuntu you can just:
$ apt-get install gcc-powerpc-linux-gnu
$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-gcc
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module
2015-08-14 11:51 ` [v2,5/5] " Michael Ellerman
@ 2015-09-30 16:19 ` Andy Shevchenko
2015-10-01 2:56 ` Michael Ellerman
0 siblings, 1 reply; 11+ messages in thread
From: Andy Shevchenko @ 2015-09-30 16:19 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, linuxppc-dev,
Segher Boessenkool
On Fri, 2015-08-14 at 21:51 +1000, Michael Ellerman wrote:
> On Tue, 2015-11-08 at 11:23:09 UTC, Andy Shevchenko wrote:
> > The derive_parent() has similar semantics to what we have in newly
> > introduced
> > of_helpers module. The replacement reduces code base and propagates
> > the actual
> > error code to the caller.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > arch/powerpc/platforms/pseries/dlpar.c | 31 +++++-----------------
> > ---------
> > 1 file changed, 5 insertions(+), 26 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/pseries/dlpar.c
> > b/arch/powerpc/platforms/pseries/dlpar.c
> > index 47d9cebe..b7f243c 100644
> > --- a/arch/powerpc/platforms/pseries/dlpar.c
> > +++ b/arch/powerpc/platforms/pseries/dlpar.c
> > @@ -18,6 +18,8 @@
> > #include <linux/cpu.h>
> > #include <linux/slab.h>
> > #include <linux/of.h>
> > +
> > +#include "of_helpers.h"
> > #include "offline_states.h"
> > #include "pseries.h"
> >
> > @@ -244,36 +246,13 @@ cc_error:
> > return first_dn;
> > }
> >
> > -static struct device_node *derive_parent(const char *path)
> > -{
> > - struct device_node *parent;
> > - char *last_slash;
> > -
> > - last_slash = strrchr(path, '/');
> > - if (last_slash == path) {
> > - parent = of_find_node_by_path("/");
> > - } else {
> > - char *parent_path;
> > - int parent_path_len = last_slash - path + 1;
> > - parent_path = kmalloc(parent_path_len,
> > GFP_KERNEL);
> > - if (!parent_path)
> > - return NULL;
> > -
> > - strlcpy(parent_path, path, parent_path_len);
> > - parent = of_find_node_by_path(parent_path);
> > - kfree(parent_path);
> > - }
> > -
> > - return parent;
> > -}
> > -
> > int dlpar_attach_node(struct device_node *dn)
> > {
> > int rc;
> >
> > - dn->parent = derive_parent(dn->full_name);
> > - if (!dn->parent)
> > - return -ENOMEM;
> > + dn->parent = pseries_of_derive_parent(dn->full_name);
> > + if (IS_ERR(dn->parent))
> > + return PTR_ERR(dn_parent);
> ^
> ?
>
> There are cross compilers on kernel.org, or on Ubuntu you can just:
>
> $ apt-get install gcc-powerpc-linux-gnu
> $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-gcc
Thanks! I tried today and the above the only problem with the series.
Would you like me to resend whole series?
>
> cheers
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module
2015-09-30 16:19 ` Andy Shevchenko
@ 2015-10-01 2:56 ` Michael Ellerman
2015-10-01 7:02 ` Denis Kirjanov
0 siblings, 1 reply; 11+ messages in thread
From: Michael Ellerman @ 2015-10-01 2:56 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Benjamin Herrenschmidt, linuxppc-dev, Segher Boessenkool, nfont
On Wed, 2015-09-30 at 19:19 +0300, Andy Shevchenko wrote:
> On Fri, 2015-08-14 at 21:51 +1000, Michael Ellerman wrote:
> > On Tue, 2015-11-08 at 11:23:09 UTC, Andy Shevchenko wrote:
> > > int dlpar_attach_node(struct device_node *dn)
> > > {
> > > int rc;
> > >
> > > - dn->parent = derive_parent(dn->full_name);
> > > - if (!dn->parent)
> > > - return -ENOMEM;
> > > + dn->parent = pseries_of_derive_parent(dn->full_name);
> > > + if (IS_ERR(dn->parent))
> > > + return PTR_ERR(dn_parent);
> > ^
> > ?
> >
> > There are cross compilers on kernel.org, or on Ubuntu you can just:
> >
> > $ apt-get install gcc-powerpc-linux-gnu
> > $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-gcc
>
> Thanks! I tried today and the above the only problem with the series.
> Would you like me to resend whole series?
I'd like someone to test it. I gather that you haven't because it didn't
compile.
I assume you don't have access to hardware to test it on?
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module
2015-10-01 2:56 ` Michael Ellerman
@ 2015-10-01 7:02 ` Denis Kirjanov
2015-10-01 8:39 ` Andy Shevchenko
0 siblings, 1 reply; 11+ messages in thread
From: Denis Kirjanov @ 2015-10-01 7:02 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Andy Shevchenko, linuxppc-dev, nfont
On 10/1/15, Michael Ellerman <mpe@ellerman.id.au> wrote:
> On Wed, 2015-09-30 at 19:19 +0300, Andy Shevchenko wrote:
>> On Fri, 2015-08-14 at 21:51 +1000, Michael Ellerman wrote:
>> > On Tue, 2015-11-08 at 11:23:09 UTC, Andy Shevchenko wrote:
>> > > int dlpar_attach_node(struct device_node *dn)
>> > > {
>> > > int rc;
>> > >
>> > > - dn->parent = derive_parent(dn->full_name);
>> > > - if (!dn->parent)
>> > > - return -ENOMEM;
>> > > + dn->parent = pseries_of_derive_parent(dn->full_name);
>> > > + if (IS_ERR(dn->parent))
>> > > + return PTR_ERR(dn_parent);
>> > ^
>> > ?
>> >
>> > There are cross compilers on kernel.org, or on Ubuntu you can just:
>> >
>> > $ apt-get install gcc-powerpc-linux-gnu
>> > $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-gcc
>>
>> Thanks! I tried today and the above the only problem with the series.
>> Would you like me to resend whole series?
>
> I'd like someone to test it. I gather that you haven't because it didn't
> compile.
Oh yeah, totally untested:
CC arch/powerpc/platforms/pseries/dlpar.o
arch/powerpc/platforms/pseries/dlpar.c: In function 'dlpar_attach_node':
arch/powerpc/platforms/pseries/dlpar.c:255:18: error: 'dn_parent'
undeclared (first use in this function)
return PTR_ERR(dn_parent);
^
arch/powerpc/platforms/pseries/dlpar.c:255:18: note: each undeclared
identifier is reported only once for each function it appears in
scripts/Makefile.build:258: recipe for target
'arch/powerpc/platforms/pseries/dlpar.o' failed
make[2]: *** [arch/powerpc/platforms/pseries/dlpar.o] Error 1
scripts/Makefile.build:403: recipe for target
'arch/powerpc/platforms/pseries' failed
make[1]: *** [arch/powerpc/platforms/pseries] Error 2
Makefile:941: recipe for target 'arch/powerpc/platforms' failed
make: *** [arch/powerpc/platforms] Error 2
>
> I assume you don't have access to hardware to test it on?
>
> cheers
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module
2015-10-01 7:02 ` Denis Kirjanov
@ 2015-10-01 8:39 ` Andy Shevchenko
2015-10-01 9:32 ` Denis Kirjanov
0 siblings, 1 reply; 11+ messages in thread
From: Andy Shevchenko @ 2015-10-01 8:39 UTC (permalink / raw)
To: Denis Kirjanov, Michael Ellerman; +Cc: linuxppc-dev, nfont
On Thu, 2015-10-01 at 10:02 +0300, Denis Kirjanov wrote:
> On 10/1/15, Michael Ellerman <mpe@ellerman.id.au> wrote:
> > On Wed, 2015-09-30 at 19:19 +0300, Andy Shevchenko wrote:
> > > On Fri, 2015-08-14 at 21:51 +1000, Michael Ellerman wrote:
> > > > On Tue, 2015-11-08 at 11:23:09 UTC, Andy Shevchenko wrote:
> > > > > int dlpar_attach_node(struct device_node *dn)
> > > > > {
> > > > > int rc;
> > > > >
> > > > > - dn->parent = derive_parent(dn->full_name);
> > > > > - if (!dn->parent)
> > > > > - return -ENOMEM;
> > > > > + dn->parent = pseries_of_derive_parent(dn
> > > > > ->full_name);
> > > > > + if (IS_ERR(dn->parent))
> > > > > + return PTR_ERR(dn_parent);
> > > > ^
> > > > ?
> > > >
> > > > There are cross compilers on kernel.org, or on Ubuntu you can
> > > > just:
> > > >
> > > > $ apt-get install gcc-powerpc-linux-gnu
> > > > $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-gcc
> > >
> > > Thanks! I tried today and the above the only problem with the
> > > series.
> > > Would you like me to resend whole series?
> >
> > I'd like someone to test it. I gather that you haven't because it
> > didn't
> > compile.
>
> Oh yeah, totally untested:
>
> CC arch/powerpc/platforms/pseries/dlpar.o
> arch/powerpc/platforms/pseries/dlpar.c: In function
> 'dlpar_attach_node':
> arch/powerpc/platforms/pseries/dlpar.c:255:18: error: 'dn_parent'
> undeclared (first use in this function)
> return PTR_ERR(dn_parent);
> ^
> arch/powerpc/platforms/pseries/dlpar.c:255:18: note: each undeclared
> identifier is reported only once for each function it appears in
> scripts/Makefile.build:258: recipe for target
> 'arch/powerpc/platforms/pseries/dlpar.o' failed
> make[2]: *** [arch/powerpc/platforms/pseries/dlpar.o] Error 1
> scripts/Makefile.build:403: recipe for target
> 'arch/powerpc/platforms/pseries' failed
> make[1]: *** [arch/powerpc/platforms/pseries] Error 2
> Makefile:941: recipe for target 'arch/powerpc/platforms' failed
> make: *** [arch/powerpc/platforms] Error 2
Like I mentioned earlier this is the only one issue to compile the
series. Can you fix it and try on real HW?
>
> >
> > I assume you don't have access to hardware to test it on?
> >
> > cheers
> >
> >
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [v2,5/5] powerpc/pseries: re-use code from of_helpers module
2015-10-01 8:39 ` Andy Shevchenko
@ 2015-10-01 9:32 ` Denis Kirjanov
0 siblings, 0 replies; 11+ messages in thread
From: Denis Kirjanov @ 2015-10-01 9:32 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Michael Ellerman, linuxppc-dev, nfont
On 10/1/15, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> On Thu, 2015-10-01 at 10:02 +0300, Denis Kirjanov wrote:
>> On 10/1/15, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> > On Wed, 2015-09-30 at 19:19 +0300, Andy Shevchenko wrote:
>> > > On Fri, 2015-08-14 at 21:51 +1000, Michael Ellerman wrote:
>> > > > On Tue, 2015-11-08 at 11:23:09 UTC, Andy Shevchenko wrote:
>> > > > > int dlpar_attach_node(struct device_node *dn)
>> > > > > {
>> > > > > int rc;
>> > > > >
>> > > > > - dn->parent = derive_parent(dn->full_name);
>> > > > > - if (!dn->parent)
>> > > > > - return -ENOMEM;
>> > > > > + dn->parent = pseries_of_derive_parent(dn
>> > > > > ->full_name);
>> > > > > + if (IS_ERR(dn->parent))
>> > > > > + return PTR_ERR(dn_parent);
>> > > > ^
>> > > > ?
>> > > >
>> > > > There are cross compilers on kernel.org, or on Ubuntu you can
>> > > > just:
>> > > >
>> > > > $ apt-get install gcc-powerpc-linux-gnu
>> > > > $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-gcc
>> > >
>> > > Thanks! I tried today and the above the only problem with the
>> > > series.
>> > > Would you like me to resend whole series?
>> >
>> > I'd like someone to test it. I gather that you haven't because it
>> > didn't
>> > compile.
>>
>> Oh yeah, totally untested:
>>
>> CC arch/powerpc/platforms/pseries/dlpar.o
>> arch/powerpc/platforms/pseries/dlpar.c: In function
>> 'dlpar_attach_node':
>> arch/powerpc/platforms/pseries/dlpar.c:255:18: error: 'dn_parent'
>> undeclared (first use in this function)
>> return PTR_ERR(dn_parent);
>> ^
>> arch/powerpc/platforms/pseries/dlpar.c:255:18: note: each undeclared
>> identifier is reported only once for each function it appears in
>> scripts/Makefile.build:258: recipe for target
>> 'arch/powerpc/platforms/pseries/dlpar.o' failed
>> make[2]: *** [arch/powerpc/platforms/pseries/dlpar.o] Error 1
>> scripts/Makefile.build:403: recipe for target
>> 'arch/powerpc/platforms/pseries' failed
>> make[1]: *** [arch/powerpc/platforms/pseries] Error 2
>> Makefile:941: recipe for target 'arch/powerpc/platforms' failed
>> make: *** [arch/powerpc/platforms] Error 2
>
> Like I mentioned earlier this is the only one issue to compile the
> series. Can you fix it and try on real HW?
Please resend the updates series and then I'll test it.
Thanks!
>
>>
>> >
>> > I assume you don't have access to hardware to test it on?
>> >
>> > cheers
>> >
>> >
>> >
>> > _______________________________________________
>> > Linuxppc-dev mailing list
>> > Linuxppc-dev@lists.ozlabs.org
>> > https://lists.ozlabs.org/listinfo/linuxppc-dev
>
> --
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Intel Finland Oy
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-10-01 9:32 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-11 11:23 [PATCH v2 1/5] powerpc/pseries: extract of_helpers module Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 2/5] powerpc/pseries: fix a potential memory leak Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 3/5] powerpc/pseries: replace kmalloc + strlcpy Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 4/5] powerpc/pseries: handle nodes without '/' Andy Shevchenko
2015-08-11 11:23 ` [PATCH v2 5/5] powerpc/pseries: re-use code from of_helpers module Andy Shevchenko
2015-08-14 11:51 ` [v2,5/5] " Michael Ellerman
2015-09-30 16:19 ` Andy Shevchenko
2015-10-01 2:56 ` Michael Ellerman
2015-10-01 7:02 ` Denis Kirjanov
2015-10-01 8:39 ` Andy Shevchenko
2015-10-01 9:32 ` Denis Kirjanov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.