From nobody Thu Dec 18 22:14:48 2025 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F8D318D65A for ; Mon, 24 Feb 2025 14:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407310; cv=none; b=VZS89UnREt8LGpT3+Sd76fksfrXS778yweWdPkUt9LKSX08cvBPFsEbV6Z9cbesyukmN9xBiG6e8GzmES10xGqjXtCL/oEBMdjdcQKEEQvOwPKt0N8lpMwbel/LlILKGAxm/OC12Wfx9bz2eN3vhYChQYSlxErokbxA+B5QcUEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407310; c=relaxed/simple; bh=YfyGamYypeZHm+u3B8rqHY41aXzYfX6dgKpGZSgCC88=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RFnjtpu98+YW3UUZ97xx+UJElJNMkBIXf92/G51KWJxRuEwqPR+31iuHvaMujmmoHCpVH763NyW7z7rRO35XGWGBXuz8KOyKM0rQLhtEepyY55UDAWYTV1sm4fYQGDtf7+7mhchulI9HhRB+L1DqIHFCkOgsiqBeT0cFUEVPQBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=0IQwydfN; arc=none smtp.client-ip=17.58.6.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="0IQwydfN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=/1dvoM+wTSEzDssTB34hOCOc8IYnryTOc1nwMu4SUek=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=0IQwydfN6THzOtWDrrncsG0Iu25RIaaAUrjT+K1BvoZ4htmGm/dexwTQPLipYMkR1 an0c0y0AqAw+b5+znMLIF3nWwHzo0Q32+DDhBo4QSQHNxat31vIx19OS8wFqbKKXMp okY+IBxOGg09tiLq6iUAshgCEFUnrw7578ueBpvmwgj4X6Ts41Fy+JTw8ROKTNvp2N aO58e7gxaYnPs+PiDc2UnQZzuIILDxwxx3Ip6vIG7AA3QML+DnEkQJ/3iS4eFeb9j2 Bt8mexjpV+7IMYysC5gqcaB1pVyeb1PmtWHUUFtFcYufTM+/V14vHQo8tNlxeeJAdD hUFufNhV5MVmQ== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id CA9A74A035F; Mon, 24 Feb 2025 14:28:25 +0000 (UTC) From: Zijun Hu Date: Mon, 24 Feb 2025 22:27:57 +0800 Subject: [PATCH 1/5] of: Compare property names by of_prop_cmp() in of_alias_scan() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250224-of_bugfix-v1-1-03640ae8c3a6@quicinc.com> References: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> In-Reply-To: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> To: Rob Herring , Saravana Kannan Cc: Zijun Hu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-GUID: ZUo9YW5lB6eUpVM_SuTsayBnZG1MxgKG X-Proofpoint-ORIG-GUID: ZUo9YW5lB6eUpVM_SuTsayBnZG1MxgKG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-24_06,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=851 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2502240104 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 From: Zijun Hu For these pseudo property names 'name', 'phandle' and 'linux,phandle': Use dedicated property name comparison macro of_prop_cmp() instead of strcmp() in of_alias_scan() to: - Make property name comparison consistent. - Prepare for introducing private is_pseudo_property() later. Signed-off-by: Zijun Hu --- 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 af6c68bbb4277e4f66deef886a2df8d1b6f114cf..d2d41601136bc8ee2b97e31b83a= f1b361ba03261 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1855,9 +1855,9 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 a= lign)) int id, len; =20 /* Skip those we do not want to proceed */ - if (!strcmp(pp->name, "name") || - !strcmp(pp->name, "phandle") || - !strcmp(pp->name, "linux,phandle")) + if (!of_prop_cmp(pp->name, "name") || + !of_prop_cmp(pp->name, "phandle") || + !of_prop_cmp(pp->name, "linux,phandle")) continue; =20 np =3D of_find_node_by_path(pp->value); --=20 2.34.1 From nobody Thu Dec 18 22:14:48 2025 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B22A7192D9D for ; Mon, 24 Feb 2025 14:28:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407315; cv=none; b=pTkqejpUWgqImx4pC+rSDDDs5exSskeldNhcSQHF6IOSMKIFVUjEjl3OY41cXgiuTNvx5dl2H8GRYBJPSInwI1idb3Ohfp3cNFgQ9VXu587kiAed9HuCIGCKe368SAmZP6XM2K7pJOj45WAOoKkcIgxhJh6L2EME1uxAxxsMLMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407315; c=relaxed/simple; bh=nCn/e9wT+E25eSZ1ei2joTWI7pSGhHrSkauu3idzI9g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Qo2/BJBFkomAQjBcw6P8gr9NOGqH4cyJD/dOaz754jYhJSRlfp2QzoHow5g7o7uwNY8TKrsVBFazTT8nwovVu4ANKwp8SGNDlWRWr1YU2NzaAczk7t46uDh+ABNx/eLnOg5G4dRJjjbr0paXF4dIMb1QKHfSf/zN3DH9y1IYxxc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=JT3Wxp9X; arc=none smtp.client-ip=17.58.6.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="JT3Wxp9X" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=+3tpAC2W8iJabEmawl81OO0+wWVWghHmKVFpf6gpmrA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=JT3Wxp9XbBDYTDSbQb4SajFV97/NnVmYUzz0B1FmRMoEsFO0JrF9Psw8l4TXeTfW6 bjIRSMkCVheSYm0ivZhenC0khZk1olap6O0qxCFucjmfzb5V5toy+tXoIBcI6NUdWT x8zsrlxdDcDfaVGdkddG4mUSLFBlBHJ2O6rGDU45qgCc6UPdfS3Q3iLakjlPLUmxzS G4zd+7zR/DoOmdnAhW/cL4eOnLFd4gTcTWl1tb6Nua+TzICfAKubLXlTXPyq2ykk8d x0ZHcYM8eGWoG2k9hb6y4ek/GGN4mwa1ypYlKwqapyazS0rMLmAPyJBY5P+iVZ02ys qn8rIZ/UWNSgQ== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id 05D384A0458; Mon, 24 Feb 2025 14:28:29 +0000 (UTC) From: Zijun Hu Date: Mon, 24 Feb 2025 22:27:58 +0800 Subject: [PATCH 2/5] of: Introduce and apply private is_pseudo_property() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250224-of_bugfix-v1-2-03640ae8c3a6@quicinc.com> References: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> In-Reply-To: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> To: Rob Herring , Saravana Kannan Cc: Zijun Hu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-GUID: OwNEz86RX_9nBuMgxsGzfZWC9eSPvAX1 X-Proofpoint-ORIG-GUID: OwNEz86RX_9nBuMgxsGzfZWC9eSPvAX1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-24_06,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=959 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2502240104 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 From: Zijun Hu There are several places which check if a property name is one of 'name'|'phandle'|'linux,phandle'. Introduce and apply private is_pseudo_property() for the check. Signed-off-by: Zijun Hu --- drivers/of/base.c | 4 +--- drivers/of/of_private.h | 7 +++++++ drivers/of/overlay.c | 4 +--- drivers/of/resolver.c | 4 +--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index d2d41601136bc8ee2b97e31b83af1b361ba03261..001ff6ce4abf85c07f13649d5a9= f691f549a8ccc 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1855,9 +1855,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 a= lign)) int id, len; =20 /* Skip those we do not want to proceed */ - if (!of_prop_cmp(pp->name, "name") || - !of_prop_cmp(pp->name, "phandle") || - !of_prop_cmp(pp->name, "linux,phandle")) + if (is_pseudo_property(pp->name)) continue; =20 np =3D of_find_node_by_path(pp->value); diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index f3e1193c8ded4899f39677a76da073e2266a1b9a..b0c077867bf4abc045ca332ebac= b988cdead90fc 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -208,4 +208,11 @@ static void __maybe_unused of_dump_addr(const char *s,= const __be32 *addr, int n static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr,= int na) { } #endif =20 +static inline bool is_pseudo_property(const char *prop_name) +{ + return !of_prop_cmp(prop_name, "name") || + !of_prop_cmp(prop_name, "phandle") || + !of_prop_cmp(prop_name, "linux,phandle"); +} + #endif /* _LINUX_OF_PRIVATE_H */ diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 434f6dd6a86c1ffad2b0d490b2b612a5147994c5..5a51c52b9729af2ab77b5a9365c= b72d30740f3b0 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -304,9 +304,7 @@ static int add_changeset_property(struct overlay_change= set *ovcs, int ret =3D 0; =20 if (target->in_livetree) - if (!of_prop_cmp(overlay_prop->name, "name") || - !of_prop_cmp(overlay_prop->name, "phandle") || - !of_prop_cmp(overlay_prop->name, "linux,phandle")) + if (is_pseudo_property(overlay_prop->name)) return 0; =20 if (target->in_livetree) diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index 779db058c42f5b8198ee3417dfaab80c81b43e4c..31eb80d894ec569e5b7538cbc07= 895803ca7d402 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -161,9 +161,7 @@ static int adjust_local_phandle_references(const struct= device_node *local_fixup for_each_property_of_node(local_fixups, prop_fix) { =20 /* skip properties added automatically */ - if (!of_prop_cmp(prop_fix->name, "name") || - !of_prop_cmp(prop_fix->name, "phandle") || - !of_prop_cmp(prop_fix->name, "linux,phandle")) + if (is_pseudo_property(prop_fix->name)) continue; =20 if ((prop_fix->length % 4) !=3D 0 || prop_fix->length =3D=3D 0) --=20 2.34.1 From nobody Thu Dec 18 22:14:48 2025 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B64D71EA7E6 for ; Mon, 24 Feb 2025 14:28:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407322; cv=none; b=lFozNeb/ALioQRps/Y7El/RwQbDCQU2bIFnv7ciTklQgtUXZlHwG91u3PInI4bPXJGbHz+NQz5L3BTezpdwL+c8sP5V54E0JSQClXjBLmjPBkdwqWxuawJrzUFyuV15L2LZ7e7zXMM2UNflIGtYarQ9aMN5x9g/r+P94e0CLfP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407322; c=relaxed/simple; bh=oOm1FU6bnGwCzq6hDTWsx6pFHsKwB8TyNvtEkuEDz5A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hII+ONr2DhTaIzrETONS2q99Fip2LxsS9FDt1zcNY0rE3qlaarnIeP/CvnGb8mEBy3MaF2wSO8osSOZ9akYlZB6y8XFxfB1eTen7vmKAienbYPR/6Ogg6QPAUyBkVR1xfBZz75IrrV114EjcotzCJo3oiP/GZNEajK7yMv62WOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=g/L/E01V; arc=none smtp.client-ip=17.58.6.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="g/L/E01V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=zx7MvlB6HU8Mone1UvhmXub58CbDSzOvGiV2JBKE2U4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=g/L/E01V8FGxZOKgANrpGazYxXi0CW/GwTeo5EfmWANP7kCOO5WVyLjUbAGQq4qP0 SwJvb+a1DYGi1q7fjbun1nskPZCVbBTx7mPfA50ZuEwilrYTeooRuSN/b4RbpdZE2q xdX5L4+api1iqvhIyzOe61Ao98iB3LmrQU9Cbc3dqw/1mCyKxFN47UV/G3Pa2ni2/8 8xS323BgLKM1ycQR0cmkADWNPIBLGKVGhXmNhnW/0ES151setkafqki/z3vODaoPFU Eiz2eADSsOPtmTwIXd94dQxkjji+wWPdUhJRS5xIPqvDmpG0Ffmggpu2dtwSJ8EohC NFeaZFYOjmWMw== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id CE0714A0446; Mon, 24 Feb 2025 14:28:33 +0000 (UTC) From: Zijun Hu Date: Mon, 24 Feb 2025 22:27:59 +0800 Subject: [PATCH 3/5] of: Correct property name comparison in __of_add_property() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250224-of_bugfix-v1-3-03640ae8c3a6@quicinc.com> References: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> In-Reply-To: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> To: Rob Herring , Saravana Kannan Cc: Zijun Hu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-GUID: f8g7UmWd-tUBLPefCfnrNeoZNjUjwumV X-Proofpoint-ORIG-GUID: f8g7UmWd-tUBLPefCfnrNeoZNjUjwumV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-24_06,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=846 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2502240104 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 From: Zijun Hu __of_add_property() compares property name by strcmp(), and that is improper for SPARC which wants strcasecmp(). Fix by using dedicated property name comparison macro of_prop_cmp(). Signed-off-by: Zijun Hu --- drivers/of/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 001ff6ce4abf85c07f13649d5a9f691f549a8ccc..c810014957e81171675b63f25ea= abe391cc903e4 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1651,7 +1651,7 @@ int __of_add_property(struct device_node *np, struct = property *prop) prop->next =3D NULL; next =3D &np->properties; while (*next) { - if (strcmp(prop->name, (*next)->name) =3D=3D 0) { + if (of_prop_cmp(prop->name, (*next)->name) =3D=3D 0) { /* duplicate ! don't insert it */ rc =3D -EEXIST; goto out_unlock; --=20 2.34.1 From nobody Thu Dec 18 22:14:48 2025 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACCCA23BCE6 for ; Mon, 24 Feb 2025 14:28:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407322; cv=none; b=MDjFinQA5rMGSPCGMoInQq0QWeN/+ESUq4ee/hvMf5+hXtku0YwqDbVOSx16QLAZI327FtHo5MaiY2livddBgwsSOhIbV0VtxJU6GmYnuC5nTixPEUN1I/BSZHNPr5k7oSB4qlDp4sFRcGSbw1DbDtGPxYBtredSLsliidE899c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407322; c=relaxed/simple; bh=ybdGidDMMARstNJjmL2Y9lZwUtBE5WDst4P9wmI55WQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OrtP2h82SboU8lLt6j47STy/CjxPxqGCTUWYkJmI2jIT+XJnGotHgmqzMlsbR3Ds5hp+/RMqHwC7Aa+PEQA53zDKf4YK1KaZwXd3hh05OUgyCtKKVpJO5lCzLtDhmJ0ziCa5TL19zftp0TUaSv7KM72R0yKt0e3Bramj7QuK+II= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=tTiwJnBW; arc=none smtp.client-ip=17.58.6.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="tTiwJnBW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=/83hjhNrUe8nENtR9sKze0gL5j9ZTF3LM/sVQ4s0mdA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=tTiwJnBWTJCI3NXr9V1a/oPqoiY5KZX2rZ7dmgq9ljTihpPw5rXZfsSidOV6h6rSU fuVJKbvzTMN9PFJFYBJx/AJppwzBDeuvHKSQK4WqbTL3L3WW1bDEHUAsMjGAnnrs8x RzI2unsCwz5iT73g1CnIMSvdluqMEdf7AqJ1Zz087GD458kyUNZfICcQD0MuGLJC9P gA38TMyM3amYUPof45wlcelvGZImJf4usJ+viuXDTu7bMuvDguKJnjFzfOAWZWQbqK F/0Z4R2v1jHPIak6onAlpgbiHw3xQt5W23eZLvL6h3/4pA4LvPPXZyKChszU74c9XT qWc/6ZU92c/aw== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id C2A2B4A0429; Mon, 24 Feb 2025 14:28:37 +0000 (UTC) From: Zijun Hu Date: Mon, 24 Feb 2025 22:28:00 +0800 Subject: [PATCH 4/5] of: Do not change property state under __of_add_property() failure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250224-of_bugfix-v1-4-03640ae8c3a6@quicinc.com> References: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> In-Reply-To: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> To: Rob Herring , Saravana Kannan Cc: Zijun Hu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-GUID: pIZTEKEm3iay74eJglrzwHvFHeHPxKFp X-Proofpoint-ORIG-GUID: pIZTEKEm3iay74eJglrzwHvFHeHPxKFp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-24_06,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=653 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2502240104 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 From: Zijun Hu Do not remove the property from list @np->deadprops if __of_add_property() encounters -EEXIST failure. Signed-off-by: Zijun Hu --- 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..47cae6e48a48a7e1312c25fc526= 7bcf39102bbe9 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) =20 raw_spin_lock_irqsave(&devtree_lock, flags); =20 - __of_remove_property_from_list(&np->deadprops, prop); - - prop->next =3D NULL; next =3D &np->properties; while (*next) { if (of_prop_cmp(prop->name, (*next)->name) =3D=3D 0) { @@ -1660,6 +1657,9 @@ int __of_add_property(struct device_node *np, struct = property *prop) } *next =3D prop; =20 + __of_remove_property_from_list(&np->deadprops, prop); + prop->next =3D NULL; + out_unlock: raw_spin_unlock_irqrestore(&devtree_lock, flags); if (rc) --=20 2.34.1 From nobody Thu Dec 18 22:14:48 2025 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A51E23BCE6 for ; Mon, 24 Feb 2025 14:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407327; cv=none; b=l9wvTZhZHXDIhIZt6TultxG2fkFwhhyysgOpBZ/PCoI0jmPwWskj5gcAvVlpag4tmn7nRkIzH+pVmyHhKr5nEIuP6X03UH3qeaucZYBzC0ZDu3D0oHPWIkMB4JyevLrAHcsbhEtA741QaMcLbnGVGNf9KhzxnyvFvpFfdx0hY0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407327; c=relaxed/simple; bh=mapRDN3HmNowumqQ4AbGWmkw1jGcaPY0QCuprNxO1Cw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PHrjXbTWcr1JGFTwzXWqBA97sr1EnzYj8w7S3LzngfGxaZRPQ0NVPyXO8W6DTflV22FJ68L5Q5BwbA9woGI2+gB2vECkZEEn0R0FvOdsRwSxU02lOWM94AaSPV8s/yOUaaZXhfabg31A6lr83+omWyKYyPQLOzUQP2PV1Jztqqw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=GvyU8712; arc=none smtp.client-ip=17.58.6.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="GvyU8712" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=vvliTZqkvFiLtaTFlSrVgIoli1W/zpsKrqdEP7k/+Hk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=GvyU8712glho1BNcs0stlsdMOQ78+YVZ27WpqajF2AaqRFC4US0LiOOHXJk6+JBxE T6oK3/CQpCZjhP4RVHJACQGfkS8Hh/Q0F6i5g9tK04YVZtqQIpg0XjCmQFJmfRpfdY jsGUGmV3LEiHuBALPqayQXlBen6SuGnogz/j+uJFI7aZvJPrkNRPtjKrJeH+nJyjMd Vrt4HnKoJLA6XxKtMt7IAi0ZN7jmXAULp4yh3TReNVEEphZfbTgQRsj3LnTuggee0B C70FdWHQUXqCP9RIL6+GIR/+6ayA/+laW0hvNDZQS1WbqvT6Hv+PgiqcnVQUschUKk PG2ElWrUTtBzw== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id D0C344A0437; Mon, 24 Feb 2025 14:28:41 +0000 (UTC) From: Zijun Hu Date: Mon, 24 Feb 2025 22:28:01 +0800 Subject: [PATCH 5/5] of/platform: Do not use of_get_property() to test property presence Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250224-of_bugfix-v1-5-03640ae8c3a6@quicinc.com> References: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> In-Reply-To: <20250224-of_bugfix-v1-0-03640ae8c3a6@quicinc.com> To: Rob Herring , Saravana Kannan Cc: Zijun Hu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-GUID: Gg8-Nbpk663mvUZGSILliK5xphjlUl91 X-Proofpoint-ORIG-GUID: Gg8-Nbpk663mvUZGSILliK5xphjlUl91 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-24_06,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=670 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2502240104 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 From: Zijun Hu Use of_property_present() instead of of_get_property() to test property 'compatible' presence in of_platform_bus_create(). Signed-off-by: Zijun Hu --- drivers/of/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index c6d8afb284e88061eb6fb0ba02e429cec702664c..242172e4b8757eec9a7ccb41376= 4b475046dbae8 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -334,7 +334,7 @@ static int of_platform_bus_create(struct device_node *b= us, int rc =3D 0; =20 /* Make sure it has a compatible property */ - if (strict && (!of_get_property(bus, "compatible", NULL))) { + if (strict && (!of_property_present(bus, "compatible"))) { pr_debug("%s() - skipping %pOF, no compatible prop\n", __func__, bus); return 0; --=20 2.34.1