NXP P50XX/e5500: SMP doesn't work anymore with the latest Git kernel

Christian Zigotzky chzigotzky at xenosoft.de
Tue Oct 30 11:41:55 AEDT 2018


On 30 October 2018 at 00:04AM, Scott Wood wrote:
> On Mon, 2018-10-29 at 21:12 +0100, Christian Zigotzky wrote:
>> Hello Christophe,
>>
>> Bisecting isn’t necessary because the problem is in the following files.
>>
>> drivers/of/base.c
>> drivers/of/device.c
>> drivers/of/of_mdio.c
>> drivers/of/of_numa.c
>> drivers/of/of_private.h
>> drivers/of/overlay.c
>> drivers/of/platform.c
>> drivers/of/unittest-data/overlay_15.dts
>> drivers/of/unittest-data/tests-overlay.dtsi
>> drivers/of/unittest.c
>> include/linux/of.h
>>
>> I removed the OF modifications from the merge commit 'devicetree-for-4.20'
>> and SMP works again.
> Bisecting to get the specific non-merge commit that broke things would be much
> more useful than simply identifying the affected file (especially if it's a
> smallish change).
>
> -Scott
>
>
You're right but I had no luck with bisecting in the past. I think I 
have to learn it more.

I found the problematic code and I created a patch today. SMP works with 
this patch again.

Link: http://www.xenosoft.de/of.patch

of.patch 
-------------------------------------------------------------------------------

diff -rupN a/drivers/of/base.c b/drivers/of/base.c
--- a/drivers/of/base.c    2018-10-30 01:00:59.814808778 +0100
+++ b/drivers/of/base.c    2018-10-30 01:00:27.990741603 +0100
@@ -394,7 +394,7 @@ struct device_node *of_get_cpu_node(int
  {
      struct device_node *cpun;

-    for_each_of_cpu_node(cpun) {
+    for_each_node_by_type(cpun, "cpu") {
          if (arch_find_n_match_cpu_physical_id(cpun, cpu, thread))
              return cpun;
      }
@@ -749,45 +749,6 @@ struct device_node *of_get_next_availabl
  EXPORT_SYMBOL(of_get_next_available_child);

  /**
- *    of_get_next_cpu_node - Iterate on cpu nodes
- *    @prev:    previous child of the /cpus node, or NULL to get first
- *
- *    Returns a cpu node pointer with refcount incremented, use 
of_node_put()
- *    on it when done. Returns NULL when prev is the last child. Decrements
- *    the refcount of prev.
- */
-struct device_node *of_get_next_cpu_node(struct device_node *prev)
-{
-    struct device_node *next = NULL;
-    unsigned long flags;
-    struct device_node *node;
-
-    if (!prev)
-        node = of_find_node_by_path("/cpus");
-
-    raw_spin_lock_irqsave(&devtree_lock, flags);
-    if (prev)
-        next = prev->sibling;
-    else if (node) {
-        next = node->child;
-        of_node_put(node);
-    }
-    for (; next; next = next->sibling) {
-        if (!(of_node_name_eq(next, "cpu") ||
-              (next->type && !of_node_cmp(next->type, "cpu"))))
-            continue;
-        if (!__of_device_is_available(next))
-            continue;
-        if (of_node_get(next))
-            break;
-    }
-    of_node_put(prev);
-    raw_spin_unlock_irqrestore(&devtree_lock, flags);
-    return next;
-}
-EXPORT_SYMBOL(of_get_next_cpu_node);
-
-/**
   * of_get_compatible_child - Find compatible child node
   * @parent:    parent node
   * @compatible:    compatible string
diff -rupN a/include/linux/of.h b/include/linux/of.h
--- a/include/linux/of.h    2018-10-30 01:01:01.034811355 +0100
+++ b/include/linux/of.h    2018-10-30 00:56:18.054216284 +0100
@@ -347,7 +347,6 @@ extern const void *of_get_property(const
                  const char *name,
                  int *lenp);
  extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
-extern struct device_node *of_get_next_cpu_node(struct device_node *prev);

  #define for_each_property_of_node(dn, pp) \
      for (pp = dn->properties; pp != NULL; pp = pp->next)
@@ -754,11 +753,6 @@ static inline struct device_node *of_get
      return NULL;
  }

-static inline struct device_node *of_get_next_cpu_node(struct 
device_node *prev)
-{
-    return NULL;
-}
-
  static inline int of_n_addr_cells(struct device_node *np)
  {
      return 0;
@@ -1229,10 +1223,6 @@ static inline int of_property_read_s32(c
      for (child = of_get_next_available_child(parent, NULL); child != 
NULL; \
           child = of_get_next_available_child(parent, child))

-#define for_each_of_cpu_node(cpu) \
-    for (cpu = of_get_next_cpu_node(NULL); cpu != NULL; \
-         cpu = of_get_next_cpu_node(cpu))
-
  #define for_each_node_with_property(dn, prop_name) \
      for (dn = of_find_node_with_property(NULL, prop_name); dn; \
           dn = of_find_node_with_property(dn, prop_name))

-------------------------------------------------------------------------------------------------------




More information about the Linuxppc-dev mailing list