devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] of: change overlay apply input data from EDT to FDT
@ 2018-01-29  2:53 frowand.list-Re5JQEeQqe8AvxtiuMwx3w
       [not found] ` <1517194414-19932-1-git-send-email-frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2018-01-29 14:08 ` [PATCH 0/2] of: change overlay apply input data from EDT to FDT Geert Uytterhoeven
  0 siblings, 2 replies; 16+ messages in thread
From: frowand.list-Re5JQEeQqe8AvxtiuMwx3w @ 2018-01-29  2:53 UTC (permalink / raw)
  To: Rob Herring, pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w, Pantelis Antoniou
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	geert-Td1EMuHUCqxL1ZNQvxDV9g

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-02-05  6:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-29  2:53 [PATCH 0/2] of: change overlay apply input data from EDT to FDT frowand.list-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <1517194414-19932-1-git-send-email-frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-29  2:53   ` [PATCH 1/2] " 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

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).