From: Rob Herring <robh@kernel.org>
To: Zijun Hu <zijun_hu@icloud.com>
Cc: Saravana Kannan <saravanak@google.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Zijun Hu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH 4/5] of: Do not change property state under __of_add_property() failure
Date: Tue, 25 Feb 2025 08:41:08 -0600 [thread overview]
Message-ID: <20250225144108.GB2279028-robh@kernel.org> (raw)
In-Reply-To: <20250224-of_bugfix-v1-4-03640ae8c3a6@quicinc.com>
On Mon, Feb 24, 2025 at 10:28:00PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
>
> Do not remove the property from list @np->deadprops if
> __of_add_property() encounters -EEXIST failure.
A property can never be on both np->deadprops and np->props.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> drivers/of/base.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index c810014957e81171675b63f25eaabe391cc903e4..47cae6e48a48a7e1312c25fc5267bcf39102bbe9 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1646,9 +1646,6 @@ int __of_add_property(struct device_node *np, struct property *prop)
>
> raw_spin_lock_irqsave(&devtree_lock, flags);
>
> - __of_remove_property_from_list(&np->deadprops, prop);
> -
> - prop->next = NULL;
> next = &np->properties;
> while (*next) {
> if (of_prop_cmp(prop->name, (*next)->name) == 0) {
> @@ -1660,6 +1657,9 @@ int __of_add_property(struct device_node *np, struct property *prop)
> }
> *next = prop;
>
> + __of_remove_property_from_list(&np->deadprops, prop);
> + prop->next = NULL;
> +
> out_unlock:
> raw_spin_unlock_irqrestore(&devtree_lock, flags);
> if (rc)
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-02-25 14:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 14:27 [PATCH 0/5] of: Trivial cleanup Zijun Hu
2025-02-24 14:27 ` [PATCH 1/5] of: Compare property names by of_prop_cmp() in of_alias_scan() Zijun Hu
2025-02-25 14:42 ` Rob Herring (Arm)
2025-02-24 14:27 ` [PATCH 2/5] of: Introduce and apply private is_pseudo_property() Zijun Hu
2025-02-25 14:44 ` Rob Herring (Arm)
2025-02-24 14:27 ` [PATCH 3/5] of: Correct property name comparison in __of_add_property() Zijun Hu
2025-02-25 14:38 ` Rob Herring
2025-02-25 15:04 ` Zijun Hu
2025-02-25 19:57 ` Rob Herring
2025-02-24 14:28 ` [PATCH 4/5] of: Do not change property state under __of_add_property() failure Zijun Hu
2025-02-25 14:41 ` Rob Herring [this message]
2025-02-25 15:24 ` Zijun Hu
2025-02-25 15:25 ` Zijun Hu
2025-02-24 14:28 ` [PATCH 5/5] of/platform: Do not use of_get_property() to test property presence Zijun Hu
2025-02-25 14:44 ` Rob Herring (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250225144108.GB2279028-robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_zijuhu@quicinc.com \
--cc=saravanak@google.com \
--cc=zijun_hu@icloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.