Thread (24 messages) 24 messages, 6 authors, 2024-08-02

Re: [PATCH v2] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

From: Rob Herring <robh@kernel.org>
Date: 2024-07-26 17:53:01
Also in: linux-devicetree, linux-pci, lkml

On Thu, Jul 25, 2024 at 6:06 PM Lizhi Hou [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Hi Amit,


I try to follow the option which add a OF flag. If Rob is ok with this,
I would suggest to use it instead of V1 patch
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index dda6092e6d3a..a401ed0463d9 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -382,6 +382,11 @@ void of_node_release(struct kobject *kobj)
                                __func__, node);
         }

+       if (of_node_check_flag(node, OF_CREATED_WITH_CSET)) {
+               of_changeset_revert(node->data);
+               of_changeset_destroy(node->data);
+       }
What happens if multiple nodes are created in the changeset?
quoted hunk ↗ jump to hunk
+
         if (node->child)
                 pr_err("ERROR: %s() unexpected children for %pOF/%s\n",
                         __func__, node->parent, node->full_name);
@@ -507,6 +512,7 @@ struct device_node *of_changeset_create_node(struct
of_changeset *ocs,
         np = __of_node_dup(NULL, full_name);
         if (!np)
                 return NULL;
+       of_node_set_flag(np, OF_CREATED_WITH_CSET);
This should be set where the data ptr is set.

Rob
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help