From nobody Sat Jul 25 00:18:23 2026 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FBAA35C6A0 for ; Tue, 21 Jul 2026 21:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669801; cv=none; b=nKIQMDiwy/pnP85vPPUIISilZ1e60batZMbhu5ajudETLZJl1sJf5zKiLAlwBrMYWBVDFDvkXVGscMKSb+7HPlgvYHQhB9XAFtt2Zo1BBI8E0tQxH1F0Y4Nyc8k/CHrE5j9t+JXePNMamEPC8yTwCN+aOhONB5Nva6yxuDdfV54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669801; c=relaxed/simple; bh=5o7m4TaStMbJi2U08yjskXG0HR3s5aGGGp0eAox2r4c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c1MRHlERonbButGWEZYyWCdslJhfGOgMaiCfSpumfWCJH2ESyG3pi/xSHglreT9ic/O9UMs5Dua52fDYtARqbgFx6pDd3Vz1YWYDkLKKDnDMW9yE8MZwPKMkX9BAd35SuXfuwEcKej2tauWQvUJ3VtrbVfuxx+UxjxOPf8fYuPQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai; spf=pass smtp.mailfrom=nexthop.ai; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b=Upc9ZFrf; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b="Upc9ZFrf" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-38511175ad3so9620591a91.2 for ; Tue, 21 Jul 2026 14:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexthop.ai; s=google; t=1784669799; x=1785274599; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/Wv6ot9GbFzw2gYUrpt0f/TE0Wgvmc4WGK8iqhr7K3k=; b=Upc9ZFrf7AunYFTYqyQbIXM17cQbVQ4wrfYYT58HQuy7jsYMgmxN7fJWmkMKCiuYRE R4SnIGDlaRNXpF1l09SaDlMtxLTK3rfvanIElJBIuqyEwyurcYZ+vTZKdvV5Qrf6Hvl+ LZ7fgxY/oh3z0SPVDlZG24AellmQ66Y4rBIbJb2Z10CQGIBOpNu0NYNay5BFdQ/oknRG vhQi8b4rVRfR7hljLt+LF8j/dGDebM3EUAkGwhkcrINFqNpgiUwSo2h78VV2fSUt9hlk oeFSnOdLULzHt8uaA32/hVTsctiU38fPoWfDeTbwSI34zSOBq+dEjkxDsXMCW2NMZRTR D75Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784669799; x=1785274599; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/Wv6ot9GbFzw2gYUrpt0f/TE0Wgvmc4WGK8iqhr7K3k=; b=NR6JZq9pD1f5+rbqkJX93lW+1AY7TXhMg3XCrD2JlcYOyeQENej64OCnvu4EUtv12T rdGeaS3e4rRDPKh0l7Zhz8DsHoaAFYdPn7N2f3EUA1vjkBKGwbbhxDsip6bJ4diDsq9A 5uUAt1FjdT8c1W/zOI/+qdvGkHZfYd1ksXd6ndrawcH0SZlHI7cu5zZXsEdgcX+Anw9e n6l7gAPvVt1IyShmv3oKUG2SxaxRMUoD+yyz9YyGNHeiSflkqe+OPGAUPAzUH8I23UsL ewF/kCXe6g9nA4J3NBa2kHBMreF9DOmoVeX7KNiCqkWnKqPm/FCtPQuB4JKNzoJiQkJe /HZw== X-Forwarded-Encrypted: i=1; AHgh+RoYAnxX4JJ9PbbMy/QhxCoCY2JrZFpTqAj0ERSeP26qNGKzieYVpjJUuT5aHgnce30C1zrYUQKI7OrQvgA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6NU05oHA1Hf2Kgl0ySdsXjxBu4cZV6fn/xAL4p6o1bKVIP4QS 9q1uCr6UHOP/YiTB6nVbs/vGQF9cVsr8FjzD5mxsWz1mWvsReovRY3eP1sTZiBTo7tjAK2r/UJt 5E/F/+Pc= X-Gm-Gg: AR+sD12xeEdxtBj/rLnv8ej5pivpNrfFHDB0IU/+0EiAKMi/5q+iVGsDhKM+P6dyd08 +IbS7pt7lQcvWcNsaCWtZR/ojyYNxU7I61dzqxuYqJskXlFBME+5RUSmf9xrJgBbjA6U+51Jhwk ZnFm01ok+Le0P97BygToK7FvkzjXiS4f3RCUM51Q9LcDnTQ86R936vB9M7tJS888TDYHlK6WciS YWp06aZN7Fp5Mz2UAqnkdya5R8YPvTNgTBLL+rccmNn/wNYf42ASTOmh1jcTKRp10FYfCc5h99x JyDMFFOsbIt+JSfhwb0L79qrnzndp4NWrcgmowVVNZmt0ThXSVgq+PMT7K1SVZhxCkOlz0baD1C x+WIw9zBUeknj2dSABOi6V6CuLkY5cfx6MDrKZsr75r1E5PcsMfiT8t9FeHewI4KHrwuAVSDmEB mPgUVa X-Received: by 2002:a17:90a:d405:b0:38e:712a:bb38 with SMTP id 98e67ed59e1d1-38e712ac393mr13423305a91.24.1784669798516; Tue, 21 Jul 2026 14:36:38 -0700 (PDT) Received: from [127.0.0.2] ([50.145.100.174]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13ce2cbb6e8sm40706521c88.9.2026.07.21.14.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 14:36:37 -0700 (PDT) From: Abdurrahman Hussain Date: Tue, 21 Jul 2026 14:36:32 -0700 Subject: [PATCH v3 1/4] of: incrementally update /aliases lookup on reconfig notifications 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: <20260721-nh-of-alias-overlay-v3-1-7001028fe2f5@nexthop.ai> References: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> In-Reply-To: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> To: Rob Herring , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784669796; l=14000; i=abdurrahman@nexthop.ai; s=20260510; h=from:subject:message-id; bh=5o7m4TaStMbJi2U08yjskXG0HR3s5aGGGp0eAox2r4c=; b=kRwK93K1S4KYzWgr/StkgNRBizxJPTFuBzUZrCGcXvF1yTwWurrVdV38MG2ioSv22FEcoY+wj THY3eKq1MrkCiJ0T9SF7Rdvcns5FqugBjHd66xqdt2+bKFt2ZvHY39z X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=omTm9cCAbO0ZhS32aKfJDKue0W3sQGpG9ub5eYHif8I= /aliases entries added by a device-tree overlay are stored in the live tree but never enter the global aliases_lookup list that of_alias_scan() builds at boot. As a result, of_alias_get_id() returns -ENODEV for aliases declared inside overlays, and any driver that relies on alias-based numbering (i2c-xiic, spi, tty, mmc, ...) silently loses its pinned id and falls back to auto-assignment. Fix by registering an internal OF reconfig notifier that mirrors /aliases changes into aliases_lookup. Registration happens at core_initcall_sync time, safely after the boot-time of_alias_scan(), which runs pre-initcall from unflatten_device_tree() (or of_pdt_build_devicetree() on OF-real platforms): OF_RECONFIG_ADD_PROPERTY -> of_alias_create() OF_RECONFIG_REMOVE_PROPERTY -> of_alias_destroy() OF_RECONFIG_UPDATE_PROPERTY -> destroy + create OF_RECONFIG_ATTACH_NODE -> adopt the node as of_aliases OF_RECONFIG_DETACH_NODE -> drop every aliases_lookup entry The reconfig notifier chain fires from both direct changesets and overlay apply/revert, so the same code path covers runtime dt modifications and overlay-declared aliases without any overlay- specific hook in drivers/of/overlay.c. Grant Likely suggested this shape on Geert Uytterhoeven's 2015 RFC [1]; Geert's original hook was in dynamic.c directly. Match the /aliases target node structurally (name =3D=3D "aliases" and parent =3D=3D root) rather than by pointer against the of_aliases global. A system with no boot-time /aliases has of_aliases =3D=3D NULL, so an overlay that creates /aliases from scratch would otherwise be missed from the first ATTACH_NODE onward. The ATTACH handler takes a reference on the adopted node that is deliberately never dropped: of_find_node_opts_by_path() reads of_aliases and walks its property list locklessly, so the node must stay valid even after DETACH clears the pointer. Only per-property notifications populate aliases_lookup =E2=80= =94 the notifier does not walk the attached node's property list, which would race with devtree_lock-protected property mutations. A direct of_attach_node() caller that pre-populates /aliases is not tracked, matching pre-series behavior. DETACH_NODE conversely drops every aliases_lookup entry: the only /aliases node in the tree is going away, so every entry is backed by it. Walking aliases_lookup itself (under aliases_mutex) avoids the same property-list race. Overlay revert additionally emits per- property REMOVE events beforehand; the sweep catches direct of_detach_node() callers that don't. Factor the per-property loop body of of_alias_scan() into of_alias_create() so the boot-time scan and the runtime notifier share one code path. Owned (runtime) entries kstrdup the alias name so the alias_prop survives the property that spawned it =E2=80=94 required for the overlay revert path where the source property is freed. A one-bit @owned flag on struct alias_prop distinguishes kmalloc'd entries from memblock-backed ones so the destroy path kfree()s the right ones. Every entry, boot-time or runtime, holds the target-node reference that of_find_node_by_path() returned at create time; destroy drops it symmetrically. The destroy path unlinks matching entries regardless of ownership (freeing storage only for owned ones) so an overlay UPDATE against a boot-time alias leaves at most one entry per stem+id. This addresses the allocator-mismatch worry Grant flagged on the 2015 series [2] and the duplicate-mapping side effect that would otherwise leak through. Serialize aliases_lookup on a dedicated aliases_mutex: readers (of_alias_get_id, of_alias_get_highest_id, of_device_uevent) and the reconfig notifier hold it around every access. Boot-time of_alias_scan() runs single-threaded during init and stays lockless. This is preferable to piggy-backing on of_mutex because the reconfig notifier is called both under of_mutex (overlay apply path) and outside of it (direct of_add_property() path from dynamic.c), so a nested acquisition would deadlock on some callers. Validate the property value before feeding it to of_find_node_by_path(): pp->value must be non-empty and null-terminated within pp->length. An overlay that hasn't been through /aliases fixup can otherwise present a fragment-internal string that isn't a valid live-tree path or a malformed non-terminated value, and of_find_node_by_path() derefs it as a C string =E2=80=94 an OOB read on the malformed case. The refactor also fixes a pre-existing one-byte out-of-bounds read in the stem parser: the old loop tested isdigit(*(end - 1)) before checking end > start, reading one byte before the property name when the name is empty or all digits. of_alias_create() checks the bound first and rejects a zero-length stem. Naming builds on Geert's original series: - "of: Extract of_alias_create()" [3] - "of: Add of_alias_destroy()" [4] - "of/dynamic: Update list of aliases on aliases changes" [5] Link: https://lore.kernel.org/lkml/1435675876-2159-1-git-send-email-geert+r= enesas@glider.be/ [1] Link: https://lore.kernel.org/lkml/20150630172131.D4E6CC4041A@trevor.secret= lab.ca/ [2] Link: https://lore.kernel.org/lkml/1435675876-2159-2-git-send-email-geert+r= enesas@glider.be/ [3] Link: https://lore.kernel.org/lkml/1435675876-2159-3-git-send-email-geert+r= enesas@glider.be/ [4] Link: https://lore.kernel.org/lkml/1435675876-2159-4-git-send-email-geert+r= enesas@glider.be/ [5] Signed-off-by: Abdurrahman Hussain --- drivers/of/base.c | 200 ++++++++++++++++++++++++++++++++++++++------= ---- drivers/of/device.c | 4 +- drivers/of/of_private.h | 7 ++ 3 files changed, 169 insertions(+), 42 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 6e7a42dedad3..4e34c65a8f9f 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1915,6 +1915,160 @@ static void of_alias_add(struct alias_prop *ap, str= uct device_node *np, ap->alias, ap->stem, ap->id, np); } =20 +/* + * Protects aliases_lookup and of_aliases. of_alias_scan() runs single- + * threaded at init and skips it; every other reader/writer must hold it. + */ +DEFINE_MUTEX(aliases_mutex); + +/* Callers other than of_alias_scan() must hold @aliases_mutex. */ +static void of_alias_create(const struct property *pp, + void *(*dt_alloc)(u64 size, u64 align), + bool owned) +{ + const char *start =3D pp->name; + const char *end; + struct device_node *np; + struct alias_prop *ap; + const char *dup; + int id, len; + + if (is_pseudo_property(pp->name)) + return; + + /* of_find_node_by_path() derefs the value as a C string */ + if (!pp->value || pp->length < 2 || + strnlen(pp->value, pp->length) >=3D pp->length) + return; + + np =3D of_find_node_by_path(pp->value); + if (!np) + return; + + end =3D start + strlen(start); + while (end > start && isdigit(*(end - 1))) + end--; + len =3D end - start; + if (len =3D=3D 0) + goto out_put; + + if (kstrtoint(end, 10, &id) < 0) + goto out_put; + + ap =3D dt_alloc(sizeof(*ap) + len + 1, __alignof__(*ap)); + if (!ap) + goto out_put; + memset(ap, 0, sizeof(*ap) + len + 1); + + if (owned) { + dup =3D kstrdup(pp->name, GFP_KERNEL); + if (!dup) { + kfree(ap); + goto out_put; + } + } else { + dup =3D start; + } + ap->alias =3D dup; + ap->owned =3D owned; + of_alias_add(ap, np, id, start, len); + return; + +out_put: + of_node_put(np); +} + +/* Callers must hold @aliases_mutex. */ +static void of_alias_destroy(const char *name) +{ + struct alias_prop *ap, *tmp; + + list_for_each_entry_safe(ap, tmp, &aliases_lookup, link) { + if (strcmp(ap->alias, name) !=3D 0) + continue; + list_del(&ap->link); + of_node_put(ap->np); + if (ap->owned) { + kfree(ap->alias); + kfree(ap); + } + return; + } +} + +static void *alias_alloc(u64 size, u64 align) +{ + return kzalloc(size, GFP_KERNEL); +} + +/* Callers must hold @aliases_mutex. */ +static void of_aliases_forget_all(void) +{ + struct alias_prop *ap, *tmp; + + list_for_each_entry_safe(ap, tmp, &aliases_lookup, link) { + list_del(&ap->link); + of_node_put(ap->np); + if (ap->owned) { + kfree(ap->alias); + kfree(ap); + } + } +} + +static int of_aliases_reconfig_notifier(struct notifier_block *nb, + unsigned long action, void *arg) +{ + struct of_reconfig_data *rd =3D arg; + + /* of_aliases may still be NULL when an overlay creates the node */ + if (!rd->dn || !rd->dn->parent || + !of_node_is_root(rd->dn->parent) || + !of_node_name_eq(rd->dn, "aliases")) + return NOTIFY_DONE; + + mutex_lock(&aliases_mutex); + switch (action) { + case OF_RECONFIG_ATTACH_NODE: + if (!of_aliases) + of_aliases =3D of_node_get(rd->dn); + break; + case OF_RECONFIG_DETACH_NODE: + of_aliases_forget_all(); + /* keep the ATTACH reference: lockless readers may hold the node */ + if (of_aliases =3D=3D rd->dn) + of_aliases =3D NULL; + break; + case OF_RECONFIG_ADD_PROPERTY: + of_alias_create(rd->prop, alias_alloc, true); + break; + case OF_RECONFIG_REMOVE_PROPERTY: + of_alias_destroy(rd->prop->name); + break; + case OF_RECONFIG_UPDATE_PROPERTY: + if (rd->old_prop) + of_alias_destroy(rd->old_prop->name); + of_alias_create(rd->prop, alias_alloc, true); + break; + default: + break; + } + mutex_unlock(&aliases_mutex); + return NOTIFY_OK; +} + +static struct notifier_block of_aliases_nb =3D { + .notifier_call =3D of_aliases_reconfig_notifier, +}; + +static int __init of_aliases_reconfig_init(void) +{ + return of_reconfig_notifier_register(&of_aliases_nb); +} + +/* of_alias_scan() runs pre-initcall, so the boot-time scan is complete */ +core_initcall_sync(of_aliases_reconfig_init); + /** * of_alias_scan - Scan all properties of the 'aliases' node * @dt_alloc: An allocator that provides a virtual address to memory @@ -1950,42 +2104,8 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 = align)) if (!of_aliases) return; =20 - for_each_property_of_node(of_aliases, pp) { - const char *start =3D pp->name; - const char *end =3D start + strlen(start); - struct device_node *np; - struct alias_prop *ap; - int id, len; - - /* Skip those we do not want to proceed */ - if (is_pseudo_property(pp->name)) - continue; - - np =3D of_find_node_by_path(pp->value); - if (!np) - continue; - - /* walk the alias backwards to extract the id and work out - * the 'stem' string */ - while (isdigit(*(end-1)) && end > start) - end--; - len =3D end - start; - - if (kstrtoint(end, 10, &id) < 0) { - of_node_put(np); - continue; - } - - /* Allocate an alias_prop with enough space for the stem */ - ap =3D dt_alloc(sizeof(*ap) + len + 1, __alignof__(*ap)); - if (!ap) { - of_node_put(np); - continue; - } - memset(ap, 0, sizeof(*ap) + len + 1); - ap->alias =3D start; - of_alias_add(ap, np, id, start, len); - } + for_each_property_of_node(of_aliases, pp) + of_alias_create(pp, dt_alloc, false); } =20 /** @@ -2003,7 +2123,7 @@ int of_alias_get_id(const struct device_node *np, con= st char *stem) struct alias_prop *app; int id =3D -ENODEV; =20 - mutex_lock(&of_mutex); + mutex_lock(&aliases_mutex); list_for_each_entry(app, &aliases_lookup, link) { if (strcmp(app->stem, stem) !=3D 0) continue; @@ -2013,7 +2133,7 @@ int of_alias_get_id(const struct device_node *np, con= st char *stem) break; } } - mutex_unlock(&of_mutex); + mutex_unlock(&aliases_mutex); =20 return id; } @@ -2031,7 +2151,7 @@ int of_alias_get_highest_id(const char *stem) struct alias_prop *app; int id =3D -ENODEV; =20 - mutex_lock(&of_mutex); + mutex_lock(&aliases_mutex); list_for_each_entry(app, &aliases_lookup, link) { if (strcmp(app->stem, stem) !=3D 0) continue; @@ -2039,7 +2159,7 @@ int of_alias_get_highest_id(const char *stem) if (app->id > id) id =3D app->id; } - mutex_unlock(&of_mutex); + mutex_unlock(&aliases_mutex); =20 return id; } diff --git a/drivers/of/device.c b/drivers/of/device.c index b3dc78f2fa3a..fa0cc8129ab0 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -237,7 +237,7 @@ void of_device_uevent(const struct device *dev, struct = kobj_uevent_env *env) add_uevent_var(env, "OF_COMPATIBLE_N=3D%d", seen); =20 seen =3D 0; - mutex_lock(&of_mutex); + mutex_lock(&aliases_mutex); list_for_each_entry(app, &aliases_lookup, link) { if (dev->of_node =3D=3D app->np) { add_uevent_var(env, "OF_ALIAS_%d=3D%s", seen, @@ -245,7 +245,7 @@ void of_device_uevent(const struct device *dev, struct = kobj_uevent_env *env) seen++; } } - mutex_unlock(&of_mutex); + mutex_unlock(&aliases_mutex); } EXPORT_SYMBOL_GPL(of_device_uevent); =20 diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index 0ae16da066e2..3ed4ad64ff43 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -17,6 +17,11 @@ * @alias: Alias property name * @np: Pointer to device_node that the alias stands for * @id: Index value from end of alias name + * @owned: True for runtime entries, where the struct and @alias are + * kmalloc'd/kstrdup'd and freed on removal. False for boot-time + * entries, which live in memblock (@alias points into the FDT) + * and are only unlinked. Every entry holds a reference on @np; + * removal drops it regardless of @owned. * @stem: Alias string without the index * * The structure represents one alias property of 'aliases' node as @@ -27,6 +32,7 @@ struct alias_prop { const char *alias; struct device_node *np; int id; + bool owned; char stem[]; }; =20 @@ -40,6 +46,7 @@ struct alias_prop { =20 extern struct mutex of_mutex; extern raw_spinlock_t devtree_lock; +extern struct mutex aliases_mutex; extern struct list_head aliases_lookup; extern struct kset *of_kset; =20 --=20 2.54.0 From nobody Sat Jul 25 00:18:23 2026 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F300A3B8412 for ; Tue, 21 Jul 2026 21:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669802; cv=none; b=XG3rLOLPDTqfQnWSH/XdWQcciWob9Hbiv6JSrCHAfF6g7z3IgDuzoU8MpJAiR0nqRtA3kC/d0Jn8hVPRY1qAYDGkVRgncb6yKawfvqmRrqdIYvYuahzaKUZT8LD24ZqGEZoORF+YgbBHC6xZjnvj6cDv+gsAeOfE1lnY+BCB9bE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669802; c=relaxed/simple; bh=9F7dJ+inrhVNDc21QsXGgXk/0suh7nvq9ES3M6+Hft4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NcQI5Q1IGa2JPIvMI+M9APPE7Xrm2N4bCRAYnq885pi2NUTgRXI/TMgnGyuNXVXeI0DOHXyymqHQzdBVyg7ubPLctb8SxMZ4rY63LTIZIy6EJu2lJUBIgviCEaAnsW+iagooZTFVxKX+lW/7ZQ51Sc7zdNxri1vqF1kc2d7evHw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai; spf=pass smtp.mailfrom=nexthop.ai; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b=Dk4XN3yw; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b="Dk4XN3yw" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c99eaa1f020so8413892a12.2 for ; Tue, 21 Jul 2026 14:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexthop.ai; s=google; t=1784669799; x=1785274599; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1+NMrtww3p/ZfbpmtINPl3bPptXhkVES+niqW4felRA=; b=Dk4XN3ywMVy2yc00ilGFMKmjBC357Xk6KI7jPecqL0J8BtAuygMdIhho+EMhncEEN2 btvjlQYp2lVM1pSJmwQ7TLL6hFrwR8c/Trhm8DC0lszApB8VPwAhR1e4zY4ATHud5pyf /z4dgUx0tHDQz+JMi2hCADpde0qzPz6iv0oemh995aIFkSR3h9vgqhIY76Pw5oys3yAW n8CZ/owPV/TzOAFQX+TNMJlRte6/2CtpOLJbwQOhWTqAX2whIRofyCviqcTBFRF0Vmcp YuAJKSok9TSs4/taX5akBAgb3qkLj79jnPINpqsGNSoFWJ1yUjqcLSZw3d9S8MsXKufa huaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784669799; x=1785274599; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1+NMrtww3p/ZfbpmtINPl3bPptXhkVES+niqW4felRA=; b=TCfesc9Gp4qH6BTJQkADm86R6Ny9/EJ+3N2woGhZPkOrdNEM2NIAob7f9/Ey9wI10q +InquF0CGiE0xMlvGVg8u+WKiRfdVVxi9rOrMNP5r4IxL2QhmP88CjG6q9CzAptxkkah wBYzkZCqHeP8ch7id3qdC/UVmrN8Z6lv+4L2rVy9mRpzu5Ir6tiN3DpjH5NdAP4SXI2y MyJC9A0RxgrGwyJpS4j+Be9t1hgCHdGrNa6q2P+utvceRKmDKdXekA/dV/XcwN6ryI8G GPiUYtXSljpS8KlPVIhXYrVacYEElGrvvlV1GRVUtFLfGtm6bK4dnIpz02M3biRBwYjW htxw== X-Forwarded-Encrypted: i=1; AHgh+RpgXxE0dDZSzKOy3hTV3FMtp/KCXc4eb7enjPsKmud8SKhEMueG0EmVklDP4udieUL66BRC1aNArNru7cc=@vger.kernel.org X-Gm-Message-State: AOJu0Yzuxf7zLlSIEK/4Q8IT+nlZyrequ1h8D67NgK2jBA+aqpUh3MPV ZCbysx+uTLuBs4DEVkJtY2yprMAuHfzb2DxKwZg+StOaREo7U+aKdImbphQC4rOdhVw= X-Gm-Gg: AR+sD10jPCWohEwn6Hw3aCdGvAkEaTpp3aiPd3Ol80bQxWVrbZJx/k4hfaEhRRczV3r Z6hXWGG5QNi/laxw1oWLCT+ei6M1vOL3rJ0ReQjygEhliCBvRZXdBjAryc3Y+fUmwbvsYqgVhG7 arSM6RyLqT+RYneLwuLi1KowF0Y1lFiQmZer3mZfCv86SiUkrLiA/x0iFD0LOhuAVTtblRzaFTD +SY6yT0A/z/9USg79p5QjqP4RG+5JTzvIc9rWe1d5FhGbOS/pvUjPYq8DvG8f9kmygFlLFQWb+I 721ZHpR248gAVMsFaZ+1em+OGXIn5Ddg6IW5Qvcg5y3Qvczh/zJZpRq9RBVaLfsUKto4n+zhkVV ZN8LS1GeYcOdaKFtZ4/fkJvW2SRz3G+amOF12g0FErBaKoYS1hgjLf0hUwV+4b4c2RnDvW4bcwE sI0M9TH46lCRjaw/o= X-Received: by 2002:a05:6a21:103:b0:3c3:8440:f6da with SMTP id adf61e73a8af0-3c3ad77e60bmr21400247637.29.1784669799421; Tue, 21 Jul 2026 14:36:39 -0700 (PDT) Received: from [127.0.0.2] ([50.145.100.174]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13ce2cbb6e8sm40706521c88.9.2026.07.21.14.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 14:36:38 -0700 (PDT) From: Abdurrahman Hussain Date: Tue, 21 Jul 2026 14:36:33 -0700 Subject: [PATCH v3 2/4] of/overlay: look up absolute target-paths absolutely 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: <20260721-nh-of-alias-overlay-v3-2-7001028fe2f5@nexthop.ai> References: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> In-Reply-To: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> To: Rob Herring , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784669796; l=2645; i=abdurrahman@nexthop.ai; s=20260510; h=from:subject:message-id; bh=9F7dJ+inrhVNDc21QsXGgXk/0suh7nvq9ES3M6+Hft4=; b=K7TWG8LDs1vQAWT8Lb0c9TsZlJLa7vzjS1nRi/14Qq0J3TrIdhHvpemb0gpGva/hOus0gGAH+ 1P0TO8V/VVsDqYrp6rdn91aPN2FqShtNB9LKBjKqJ3iV99H8srHug+R X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=omTm9cCAbO0ZhS32aKfJDKue0W3sQGpG9ub5eYHif8I= When of_overlay_fdt_apply() is called with a non-NULL target base, find_target() currently concatenates the base's full path with every fragment's target-path via "%pOF%s" =E2=80=94 so target-path=3D"" resolves = to the base itself (the intended common case), but target-path=3D"/foo" resolves to "/foo" (never the DT root) and target-path=3D"/" to "/" (never a valid node at all). That makes it impossible for a two-fragment overlay to modify one subtree under the base and one node at the DT root =E2=80=94 a shape that arises naturally when a PCI-attached device wants to declare its peripherals under dev_of_node(&pdev->dev) AND add /aliases entries so alias-aware drivers (i2c-xiic, spi, tty, ...) can pin bus numbers. Treat target-path as absolute whenever it is non-empty. An empty target-path continues to mean "the target base itself", preserving the existing shape used by drivers/misc/lan966x_pci.c and its dtso (the only in-tree of_overlay_fdt_apply() caller today that passes a non-NULL base). Signed-off-by: Abdurrahman Hussain --- drivers/of/overlay.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 08d5351746be..b6545905cf67 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -693,7 +693,6 @@ static struct device_node *find_target(const struct dev= ice_node *info_node, const struct device_node *target_base) { struct device_node *node; - char *target_path; const char *path; u32 val; int ret; @@ -709,23 +708,14 @@ static struct device_node *find_target(const struct d= evice_node *info_node, =20 ret =3D of_property_read_string(info_node, "target-path", &path); if (!ret) { - if (target_base) { - target_path =3D kasprintf(GFP_KERNEL, "%pOF%s", target_base, path); - if (!target_path) - return NULL; - node =3D of_find_node_by_path(target_path); - if (!node) { - pr_err("find target, node: %pOF, path '%s' not found\n", - info_node, target_path); - } - kfree(target_path); - } else { - node =3D of_find_node_by_path(path); - if (!node) { - pr_err("find target, node: %pOF, path '%s' not found\n", - info_node, path); - } - } + /* an empty target-path means the target base itself */ + if (target_base && path[0] =3D=3D '\0') + return of_node_get((struct device_node *)target_base); + + node =3D of_find_node_by_path(path); + if (!node) + pr_err("find target, node: %pOF, path '%s' not found\n", + info_node, path); return node; } =20 --=20 2.54.0 From nobody Sat Jul 25 00:18:23 2026 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29628357CEB for ; Tue, 21 Jul 2026 21:36:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669802; cv=none; b=lXJBzoYO8KtfaXksV58ZXPtFhZmuf02ebqjBuX/26QY7gmwj7mfFUDnYF1hSl/Sqd6Nyrt/BcmIWD2Zm//ri2MVMgrxYU4JSPdClaXhpX+lXQZODPGZ0wMmGC9ccRyFhNwnJRL9QblbWJq8z7HEKkvt9O0BescZzoS2j5cSZzR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669802; c=relaxed/simple; bh=DiTw4KlHNXPwCjxJDfLPQbOAtNxlbFmiz5S0sKBzzWc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oYOgc7ZpFLonMmhlnQVMPDc9HPOHmTfqYSNdtk7Bu6wWukRVLsLvkfZ0dzqdb0Y18wUiwqkxAyhmCLSUBFx9uvN8zn0NIT/WbiTD3odZVOjrO2ttmC0PzISfttOPfpYJcjmyvW0SvFFFyQuB1fG0nh6sDBAU/QNUxSWSE7SqvC8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai; spf=pass smtp.mailfrom=nexthop.ai; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b=GZm+0t5V; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b="GZm+0t5V" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-38511175ad3so9620604a91.2 for ; Tue, 21 Jul 2026 14:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexthop.ai; s=google; t=1784669800; x=1785274600; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=GW1Ca5rj7SkxZR/f2O8Y4WbAS6oHI0QQpqNUYxnjmuE=; b=GZm+0t5Vbuu7P6S6Ra0j7K8ifZ1FdQGBPbcIksl9jPb5d0vtmjyiMrkc5myzSWb+SW /LsNFCzcF4caCh5CDVFeOO7EltZ9dw4quph3fY94Ymv9kGjdtN7lFq5v8dFDmhCqWJ+t kZf/wRk8Z7KINxe/UxFhPWX5lu+MHS7rik6a15iMMAj1XyNIkwpSFuDDW69Iw7UuCnPT lenWeMcNQSsMPIAOMN59Zzn+dnIvjWlovh51mGS3SfGa09ScVldZx9bq7LFX9YUjyGO+ nLXu7RGUNzRtgFmukteNAFqEFbUULEG2YNJeG42Z1pDG8vkkZFN9rCFca7tgRZXUR39w VguQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784669800; x=1785274600; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=GW1Ca5rj7SkxZR/f2O8Y4WbAS6oHI0QQpqNUYxnjmuE=; b=k7hgCe/obKRlwsGhs90LPnAICFXWjwbPyh4tWmnwBtMIWkz+DAUS+9vmG95wj9rYqG DmaoWaJsIjkOs+ZcTfY6186mjrEM2E4few1VBEXLmP5XtbfC4Slc9sCato1dRanmYbcG K0jc8rGNuoHfITdDOippEY0k21wC4SHuHhUBGNDtoqyZPNh0Hq97Iq7wG5poURLf+9Dp tCWtiEME3jKBQ15cAXMbsPxLB+AWek0Zk2WmoRkYiAogx4Fwf2u7GBFqJjnIMl3xjkso pa6+/Zw1gJvdkSQQHEP2HThrnphv86m/YCJvldqn0WpAITPXnBp2bYDvPV/jKzMJilxn PWfg== X-Forwarded-Encrypted: i=1; AHgh+RqBAsvCLJK0piIvj9FXL47DfOi/YT5n5dh24vFtirP0VGTioqshvXHeq0bDujpm4ewlgktwuAWA02R9O9w=@vger.kernel.org X-Gm-Message-State: AOJu0YwDPCZkBCpP0TkknlHOxEq2WRT0D2EK+8AO+NQ98QNY+Uq6KKR4 AxL3EqF0mcnsrGZN9vzNAlSK4AqxhOKR145+jiqbsg1VMjT4i5faZHDf96ttQNS+Hrs= X-Gm-Gg: AR+sD128LPKBpF1l+GrywKJ+RqrbTQqbiAsX4ijFe+cBYSGmqFDNxn+AddHsJus8amN mqZCNsWXr3IeYr/B5GZBM8i4Vb4cP285F1OvKXIWwoN/tKlQtB4x6Aev4h0UkBll3tTDokVNVNX 8A3k8abNCbnCPYBJcLw/Ag630/X+aSOVJGEjJ/dc41hiM2KAdXRqliFacbZisv6kScn+nLFbGIB Bi50yBZmTtrE6uVIunbIS0bVmwEKFG52OwelO2SSwzw4YZLDo5/KQ7uHMMPYIkM4UZaLf+E9foM 6Z0ozaODNW4XVaKSwXfrAuyArSvtoh052YROhaBGfZOxvyUvdpVZmO4fYPwQbZAI4qA+n7DgjV2 DS4KDGwKQafQaSZ4dk9/Y2U6554Ja8U7bVON8LDzy/duFFO6P9yrpQII08kGro5Luu/CcjlYThy wk4cFm X-Received: by 2002:a17:90b:5604:b0:37f:e1af:df22 with SMTP id 98e67ed59e1d1-38e4b4312b7mr22172001a91.17.1784669800426; Tue, 21 Jul 2026 14:36:40 -0700 (PDT) Received: from [127.0.0.2] ([50.145.100.174]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13ce2cbb6e8sm40706521c88.9.2026.07.21.14.36.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 14:36:39 -0700 (PDT) From: Abdurrahman Hussain Date: Tue, 21 Jul 2026 14:36:34 -0700 Subject: [PATCH v3 3/4] of/overlay: rewrite /aliases path values to live-tree paths 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: <20260721-nh-of-alias-overlay-v3-3-7001028fe2f5@nexthop.ai> References: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> In-Reply-To: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> To: Rob Herring , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784669796; l=3285; i=abdurrahman@nexthop.ai; s=20260510; h=from:subject:message-id; bh=DiTw4KlHNXPwCjxJDfLPQbOAtNxlbFmiz5S0sKBzzWc=; b=PoUStDLuHf5Zx89MELwfA26Q3ZKaj1x1TzPHUEpT6is+cPVhMGlxV1ZxZyMSsmyQh/t1jV6W9 DNt5MrrluVPApfo5j+YisaTi8nzdP94Kc+Uko6e67JVdcuWVjmBuuLa X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=omTm9cCAbO0ZhS32aKfJDKue0W3sQGpG9ub5eYHif8I= /aliases entries added by an overlay reference labeled nodes inside the overlay via '&label' in the .dtso. dtc renders those references as string paths at compile time, but the paths encode the overlay's internal fragment layout (e.g. "/fragment@1/__overlay__/fpga@0/i2c@40000") rather than the location where the node will live after apply. Currently only /__symbols__ has its property values rewritten from overlay-internal paths to live-tree paths by dup_and_fixup_symbol_prop(). /aliases values fall through the plain __of_prop_dup() path and are copied byte-for-byte, so of_find_node_by_path() on such a value returns NULL, of_alias_get_id() reports -ENODEV =E2=80=94 and the reconfig notifier added earlier in this series sees uninterpretable paths and can't populate aliases_lookup for overlay-declared aliases. The values in /aliases follow the same textual convention as /__symbols__, so we can reuse the existing rewriter. Detect the /aliases target node, reject values that aren't non-empty C strings null-terminated within pp->length (of_alias_get_id() and of_find_node_by_path() dereference alias values as C strings, so a malformed one must not reach the live tree through either dup path), and then route values with a "/fragment@" prefix through dup_and_fixup_symbol_prop(). Other alias values =E2=80=94 legacy string aliases like "ttyS0" that some out-of-tree code writes verbatim =E2=80=94 pass through the plain __of_prop_dup() path unchanged. Discriminating up-front instead of falling back to a raw dup when dup_and_fixup_symbol_prop() returns NULL matters: a fallback would inject the unrewritten fragment path into the live tree where nothing can resolve it. With the string shape validated here, a NULL return means either allocation failure or a fragment path that doesn't resolve within the overlay; both are reported as -ENOMEM, matching the existing /__symbols__ handling of the same helper. Distinguishing the two would require an ERR_PTR conversion of the shared helper and is left for a separate cleanup. Signed-off-by: Abdurrahman Hussain --- drivers/of/overlay.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index b6545905cf67..9f85278c577a 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -350,6 +350,21 @@ static int add_changeset_property(struct overlay_chang= eset *ovcs, if (prop) return -EINVAL; new_prop =3D dup_and_fixup_symbol_prop(ovcs, overlay_prop); + } else if (target->np->parent && + of_node_is_root(target->np->parent) && + of_node_name_eq(target->np, "aliases")) { + /* /aliases values are deref'd as C strings; reject malformed input */ + if (!overlay_prop->value || overlay_prop->length < 2 || + strnlen(overlay_prop->value, overlay_prop->length) >=3D + overlay_prop->length) + return -EINVAL; + + /* rewrite overlay-internal paths to live-tree paths */ + if (!strncmp(overlay_prop->value, "/fragment@", + strlen("/fragment@"))) + new_prop =3D dup_and_fixup_symbol_prop(ovcs, overlay_prop); + else + new_prop =3D __of_prop_dup(overlay_prop, GFP_KERNEL); } else { new_prop =3D __of_prop_dup(overlay_prop, GFP_KERNEL); } --=20 2.54.0 From nobody Sat Jul 25 00:18:23 2026 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2154439903 for ; Tue, 21 Jul 2026 21:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669806; cv=none; b=OZuRTAyBp+9frl6tggo17pOwbMLHXlVQ97c9cVHCWhHb3KPChEwGpVBLCzsfRw4vD8fEJCDfuNIeYWXz21OLqunt6JfTVhxUCoUrGkrguF4JWCtBUMH7C+qydMAOUVHeGM5tQIs0svLvinOQTlTqqRXjeUfIQdKx0Q7RGwZtDnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669806; c=relaxed/simple; bh=1AqJjptPNcOHrmiu5mm4MU1/41U1adLcnSyOVe44xgU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EOLRn1lIJqaAjTqyLOq/lFrpyv2x1DyZdaHpKKbxPkgz9OSV13wzdoNZuO3YNJ+QhipqWsgGrwwzPcVnw08BUhuht8Pw0khH7CGedw8XqTm9kyWOMKv0fbaYlNjBrQWR/2H4IsBBO/Se6DJUMdkCw77RPJdu13Ujgxl6KYKNs1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai; spf=pass smtp.mailfrom=nexthop.ai; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b=KQxAo9PL; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b="KQxAo9PL" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-38e041ea211so9677458a91.0 for ; Tue, 21 Jul 2026 14:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexthop.ai; s=google; t=1784669801; x=1785274601; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=i1QYvxskec5dUTJ/7WHomj96AzPse0SLdtLdUj/bCfI=; b=KQxAo9PLKPjmF1zedD6L+LXZa+Qbpbr4fS59h1xaH/QrFA6QjsSItZzyKr1JMqgQ5c UqEDbbmNxRWLVq7zIdZTChGBeSd4etA1ja9WcvelSfzOu+uERlTlWvK1jmXzjWOsTy3K AY8FYWHHd33j+Q1tvnizjelKVNRe12yjuUyka+2/swf5jPOV2OqNa6Qbq1gu15XR1x3v h/o+R/FKxYEfRQPDh0q8yIFeSJ+cEJRJWEOhok4XmJyGCS10nKkU4/1HPV6ZOb5bjG4z FAsChs7/toS2B4W0rjcZepWbXqcEEiKJR/mJTDO2uNblRTw/IWR7RVN6Ed3M3zfK5xgs 2/8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784669801; x=1785274601; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=i1QYvxskec5dUTJ/7WHomj96AzPse0SLdtLdUj/bCfI=; b=ShMwMxCvq8HZDgJeu8ENZc8qpohxOV0ElEVQKsZKiC0goa/w7L76WUVLP5aMbWCvLU avtFT3aAo8Ifgwd/XTcEA6AOQywi9Ql5th3o51YkvbduvAGD0dQ79lMOdYyeL1w+eYzD wpONt/xT8uY0Zpk11gFQ1oeKWaaOYchvaTUhXx89rHOaDufQDukS8t+0ke1bu5tlTxFW Uq0SULy4OUuXkvwAenPZeyQ8Y/RSkngIWJ/L2538WGATTLFLsDNZSXfLwNZq7Yn2TTLo 0T6NTsXgsikAiNvANT80cLWcymnmrCYaE3ENIaaYWXMgt2pMZTSFZXZxco6LMziFem3q e2ZA== X-Forwarded-Encrypted: i=1; AHgh+RpZWPw3Ur8z1er66jSiCnRaLlg0TSK9mgF+8JpNerdxrySAVyvUN5IEjmITmuCO95g4TpTA+qG8ayE4GDo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz61D4RMvKnFM7NVC5hfveeDHHztwXi0fmf/ViiTc9KoDLanhyO z4BTOX9lYjpV+u86krjmtZGUaah4zeavSR8VVkhJEUepCV3aSp2kJj/W6kAow2iT9mw= X-Gm-Gg: AR+sD13MOAy7iRGG5Pfp9z8mRNUuYOwxzoIR/HT1XTG5cfcuIvm5iVXHit6TJ+u9wjT bmGNYgpMgaomloQvFxFY+TLpbHqjmD54PEryqSmpZJ1XdJhlqlvVcC8dKcH4/DpPaDIEAAGZq52 wGjJHZY0+NMqE/VvJ2CdfkEMFQ6j2mi6STpShxqMXEF/ee8n5Z0cDQoNuQkkJ0cLAKt3WIOEeP6 1nVOwXLTG9Vb8dPQHHb0NGaGZAUjHMHOS5DbTqs/LUy0ZFogIizF+8e1La2MZfz6JFrSPkXHT64 1efJ1I2p0EVyP/qQGbAWMh+oUFbS7kqaVQT5Ra9V7v4ZIofQtXZYadHsURgH76l99wps2mZ6+f0 s4Gv9Hc9+SBaWuYd/ZpV37VGFouqdtvt1R3CHaQieslwwYdUSYsCRpQg+a6s3Zo255YI16e7tFi 2uanW3JotOyfVND7M= X-Received: by 2002:a17:90b:3d86:b0:387:e0bb:57f7 with SMTP id 98e67ed59e1d1-38e4b59b913mr20726866a91.40.1784669801396; Tue, 21 Jul 2026 14:36:41 -0700 (PDT) Received: from [127.0.0.2] ([50.145.100.174]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13ce2cbb6e8sm40706521c88.9.2026.07.21.14.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 14:36:40 -0700 (PDT) From: Abdurrahman Hussain Date: Tue, 21 Jul 2026 14:36:35 -0700 Subject: [PATCH v3 4/4] of: unittest: cover /aliases updates from overlay apply/revert 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: <20260721-nh-of-alias-overlay-v3-4-7001028fe2f5@nexthop.ai> References: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> In-Reply-To: <20260721-nh-of-alias-overlay-v3-0-7001028fe2f5@nexthop.ai> To: Rob Herring , Saravana Kannan Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784669796; l=5750; i=abdurrahman@nexthop.ai; s=20260510; h=from:subject:message-id; bh=1AqJjptPNcOHrmiu5mm4MU1/41U1adLcnSyOVe44xgU=; b=CMHl+rx19XqZuiL5AqerXimikQ7tM4bbdwc6PkQdi4w3SDk8XAfgaekB9V3vdrDJt4T7L7mry 2Ap9CZ7Gk9fB4msYsUMv76hJ20jZXWJccHGsD2cR5wbR4CtrVUeN1jZ X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=omTm9cCAbO0ZhS32aKfJDKue0W3sQGpG9ub5eYHif8I= Add overlay_alias.dtso plus of_unittest_overlay_alias() to cover the "aliases inside an overlay" flow end-to-end. The overlay has two fragments: fragment@0: target-path=3D"" grafts a labeled node under target_base. fragment@1: target-path=3D"/aliases" adds `testcase-alias99 =3D &