From: frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org,
Pantelis Antoniou
<panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
Subject: [PATCH 0/2] of: change overlay apply input data from EDT to FDT
Date: Sun, 28 Jan 2018 18:53:32 -0800 [thread overview]
Message-ID: <1517194414-19932-1-git-send-email-frowand.list@gmail.com> (raw)
From: Frank Rowand <frank.rowand-7U/KSKJipcs@public.gmane.org>
Move duplicating and unflattening of an overlay flattened devicetree
(FDT) into the overlay application code. To accomplish this,
of_overlay_apply() is replaced by of_overlay_fdt_apply().
The copy of the FDT (aka "duplicate FDT") now belongs to devicetree
code, which is thus responsible for freeing the duplicate FDT. The
caller of of_overlay_fdt_apply() remains responsible for freeing the
original FDT.
The unflattened device tree (aka expanded device tree, EDT) now
belongs to devicetree code, which is thus responsible for freeing
the EDT.
These ownership changes prevent early freeing of the duplicated FDT
or the EDT, which could result in use after free errors.
These changes led to migrating some unittest overlay data into
their own devicetree source files, and then converting most of
them to use sugar syntax instead of hand coding fragments.
Frank Rowand (2):
of: change overlay apply input data from EDT to FDT
of: convert unittest overlay devicetree source to sugar syntax
drivers/of/of_private.h | 1 +
drivers/of/overlay.c | 124 +++++++++-
drivers/of/resolver.c | 6 -
drivers/of/unittest-data/Makefile | 16 ++
drivers/of/unittest-data/overlay.dts | 101 ++++----
drivers/of/unittest-data/overlay_0.dts | 14 ++
drivers/of/unittest-data/overlay_1.dts | 14 ++
drivers/of/unittest-data/overlay_10.dts | 27 +++
drivers/of/unittest-data/overlay_11.dts | 28 +++
drivers/of/unittest-data/overlay_12.dts | 14 ++
drivers/of/unittest-data/overlay_13.dts | 14 ++
drivers/of/unittest-data/overlay_15.dts | 30 +++
drivers/of/unittest-data/overlay_2.dts | 9 +
drivers/of/unittest-data/overlay_3.dts | 9 +
drivers/of/unittest-data/overlay_4.dts | 18 ++
drivers/of/unittest-data/overlay_5.dts | 9 +
drivers/of/unittest-data/overlay_6.dts | 10 +
drivers/of/unittest-data/overlay_7.dts | 10 +
drivers/of/unittest-data/overlay_8.dts | 10 +
drivers/of/unittest-data/overlay_9.dts | 10 +
drivers/of/unittest-data/overlay_bad_phandle.dts | 23 +-
drivers/of/unittest-data/overlay_bad_symbol.dts | 27 +--
drivers/of/unittest-data/tests-overlay.dtsi | 217 +----------------
drivers/of/unittest.c | 296 +++++++++++------------
include/linux/of.h | 7 -
25 files changed, 564 insertions(+), 480 deletions(-)
create mode 100644 drivers/of/unittest-data/overlay_0.dts
create mode 100644 drivers/of/unittest-data/overlay_1.dts
create mode 100644 drivers/of/unittest-data/overlay_10.dts
create mode 100644 drivers/of/unittest-data/overlay_11.dts
create mode 100644 drivers/of/unittest-data/overlay_12.dts
create mode 100644 drivers/of/unittest-data/overlay_13.dts
create mode 100644 drivers/of/unittest-data/overlay_15.dts
create mode 100644 drivers/of/unittest-data/overlay_2.dts
create mode 100644 drivers/of/unittest-data/overlay_3.dts
create mode 100644 drivers/of/unittest-data/overlay_4.dts
create mode 100644 drivers/of/unittest-data/overlay_5.dts
create mode 100644 drivers/of/unittest-data/overlay_6.dts
create mode 100644 drivers/of/unittest-data/overlay_7.dts
create mode 100644 drivers/of/unittest-data/overlay_8.dts
create mode 100644 drivers/of/unittest-data/overlay_9.dts
--
Frank Rowand <frank.rowand-7U/KSKJipcs@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2018-01-29 2:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-29 2:53 frowand.list-Re5JQEeQqe8AvxtiuMwx3w [this message]
[not found] ` <1517194414-19932-1-git-send-email-frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-29 2:53 ` [PATCH 1/2] of: change overlay apply input data from EDT to FDT frowand.list-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <1517194414-19932-2-git-send-email-frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-29 3:21 ` Masahiro Yamada
2018-01-29 8:12 ` Frank Rowand
2018-01-29 14:42 ` Rob Herring
2018-01-29 15:05 ` Geert Uytterhoeven
[not found] ` <CAMuHMdVz05Ygk34y-DiBGraf3xSh8deRoKGDfHv92-WYCu4HfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-30 0:13 ` Frank Rowand
2018-01-30 0:01 ` Frank Rowand
[not found] ` <d2ad9f6f-bf66-10bc-6156-cb006ab9447d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-05 6:07 ` Rob Herring
2018-01-29 2:53 ` [PATCH 2/2] of: convert unittest overlay devicetree source to sugar syntax frowand.list-Re5JQEeQqe8AvxtiuMwx3w
2018-01-29 10:37 ` Geert Uytterhoeven
[not found] ` <CAMuHMdVSDj2MmTzbxgZeBx94EKdcRr6B_3Bh+Mb35XhBRPPGXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-30 0:14 ` Frank Rowand
2018-01-29 14:08 ` [PATCH 0/2] of: change overlay apply input data from EDT to FDT Geert Uytterhoeven
2018-01-30 0:22 ` Frank Rowand
[not found] ` <df065acc-2479-2513-ac3d-63d065d2ffa1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-30 0:35 ` Frank Rowand
[not found] ` <d009592b-ee82-7706-29ff-2749cd0e3c20-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-30 16:28 ` Alan Tull
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=1517194414-19932-1-git-send-email-frowand.list@gmail.com \
--to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
--cc=panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).