<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/of/of_private.h, branch v6.6.148</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.148</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.148'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-09-04T13:30:18+00:00</updated>
<entry>
<title>of: Add a helper to free property struct</title>
<updated>2025-09-04T13:30:18+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2024-04-09T18:59:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=749137b41e7064ee8b8b1f04a5a27478226d09fc'/>
<id>urn:sha1:749137b41e7064ee8b8b1f04a5a27478226d09fc</id>
<content type='text'>
[ Upstream commit 1c5e3d9bf33b811e1c6dd9081b322004acc4a1fd ]

Freeing a property struct is 3 kfree()'s which is duplicated in multiple
spots. Add a helper, __of_prop_free(), and replace all the open coded
cases in the DT code.

Reviewed-by: Saravana Kannan &lt;saravanak@google.com&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Link: https://lore.kernel.org/r/20240409-dt-cleanup-free-v2-1-5b419a4af38d@kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Stable-dep-of: 80af3745ca46 ("of: dynamic: Fix use after free in of_changeset_add_prop_helper()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>of/irq: Factor out parsing of interrupt-map parent phandle+args from of_irq_parse_raw()</title>
<updated>2024-07-25T07:50:43+00:00</updated>
<author>
<name>Rob Herring (Arm)</name>
<email>robh@kernel.org</email>
</author>
<published>2024-05-29T19:59:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b0f79bda5501524f24e1ed5a3c66b705d9a331b5'/>
<id>urn:sha1:b0f79bda5501524f24e1ed5a3c66b705d9a331b5</id>
<content type='text'>
[ Upstream commit 935df1bd40d43c4ee91838c42a20e9af751885cc ]

Factor out the parsing of interrupt-map interrupt parent phandle and its
arg cells to a separate function, of_irq_parse_imap_parent(), so that it
can be used in other parsing scenarios (e.g. fw_devlink).

There was a refcount leak on non-matching entries when iterating thru
"interrupt-map" which is fixed.

Tested-by: Marc Zyngier &lt;maz@kernel.org&gt;
Tested-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Link: https://lore.kernel.org/r/20240529-dt-interrupt-map-fix-v2-1-ef86dc5bcd2a@kernel.org
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Move of_platform_register_reconfig_notifier() into DT core</title>
<updated>2023-08-04T17:36:33+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-07-17T14:37:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=73aca58b781e3e3d52bb7247b374fb5334a05001'/>
<id>urn:sha1:73aca58b781e3e3d52bb7247b374fb5334a05001</id>
<content type='text'>
There's no reason the generic platform bus code needs to call
of_platform_register_reconfig_notifier(). The notifier can be setup
before the platform bus is. Let's move it into of_core_init() which is
called just before platform_bus_init() instead to keep more of the DT
bits in the DT code.

Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20230717143718.1715773-1-robh@kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Make devtree_lock declaration private</title>
<updated>2023-04-10T23:32:31+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-03-29T15:51:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1dd5474ee6ee1d6ddc95f1423966ab8d4afda448'/>
<id>urn:sha1:1dd5474ee6ee1d6ddc95f1423966ab8d4afda448</id>
<content type='text'>
Sparc is the only place devtree_lock is used outside of drivers/of/.
Move the devtree_lock declaration into of_private.h and Sparc's prom.h
so pulling in spinlock.h to of.h can be avoided for everything besides
Sparc.

Link: https://lore.kernel.org/r/20230329-dt-cpu-header-cleanups-v1-1-581e2605fe47@kernel.org
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Fix "dma-ranges" handling for bus controllers</title>
<updated>2022-09-30T19:35:43+00:00</updated>
<author>
<name>Robin Murphy</name>
<email>robin.murphy@arm.com</email>
</author>
<published>2022-09-29T12:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f1ad5338a4d57fe1fe6475003acb8c70bf9d1bdf'/>
<id>urn:sha1:f1ad5338a4d57fe1fe6475003acb8c70bf9d1bdf</id>
<content type='text'>
Commit 951d48855d86 ("of: Make of_dma_get_range() work on bus nodes")
relaxed the handling of "dma-ranges" for any leaf node on the assumption
that it would still represent a usage error for the property to be
present on a non-bus leaf node. However there turns out to be a fiddly
case where a bus also represents a DMA-capable device in its own right,
such as a PCIe root complex with an integrated DMA engine on its
platform side. In such cases, "dma-ranges" translation is entirely valid
for devices discovered behind the bus, but should not be erroneously
applied to the bus controller device itself which operates in its
parent's address space. Fix this by restoring the previous behaviour for
the specific case where a device is configured via its own OF node,
since it is logical to assume that a device should never represent its
own parent bus.

Reported-by: Serge Semin &lt;Sergey.Semin@baikalelectronics.ru&gt;
Signed-off-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Link: https://lore.kernel.org/r/112e8f3d3e7c054ecf5e12b5ac0aa5596ec00681.1664455433.git.robin.murphy@arm.com
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: kobj: make of_node_is_(initialized|attached) parameters const</title>
<updated>2021-10-20T18:37:25+00:00</updated>
<author>
<name>Nathan Lynch</name>
<email>nathanl@linux.ibm.com</email>
</author>
<published>2021-10-14T17:30:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6effc8857b24350cb7534cb1029ade9a8573e04a'/>
<id>urn:sha1:6effc8857b24350cb7534cb1029ade9a8573e04a</id>
<content type='text'>
of_node_is_initialized() and of_node_is_attached() don't modify the node
objects passed to them, so those parameters should be const.

Signed-off-by: Nathan Lynch &lt;nathanl@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20211014173023.2117799-1-nathanl@linux.ibm.com
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: remove duplicate declarations of __of_*_sysfs() functions</title>
<updated>2021-10-06T19:14:38+00:00</updated>
<author>
<name>Zev Weiss</name>
<email>zev@bewilderbeest.net</email>
</author>
<published>2021-10-06T06:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6663ae07d995f5fbe2988a19858b2f87e68cf929'/>
<id>urn:sha1:6663ae07d995f5fbe2988a19858b2f87e68cf929</id>
<content type='text'>
When CONFIG_OF_KOBJ was introduced in commit b56b5528f5b3 ("of: make
kobject and bin_attribute support configurable") and #ifdef-ed
versions of these declarations got added, the originals didn't get
removed.

Fixes: b56b5528f5b3 ("of: make kobject and bin_attribute support configurable")
Signed-off-by: Zev Weiss &lt;zev@bewilderbeest.net&gt;
Link: https://lore.kernel.org/r/20211006061943.8472-1-zev@bewilderbeest.net
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Move reserved memory private function declarations</title>
<updated>2021-06-03T01:59:28+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2021-05-27T19:38:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=12d55d3b5370448f6568d0031b5e401cc050c29e'/>
<id>urn:sha1:12d55d3b5370448f6568d0031b5e401cc050c29e</id>
<content type='text'>
fdt_init_reserved_mem() and fdt_reserved_mem_save_node() are private to
the DT code, so move there declarations to of_private.h. There's no need
for the dummy functions as CONFIG_OF_RESERVED_MEM is always enabled for
CONFIG_OF_EARLY_FLATTREE.

Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Link: https://lore.kernel.org/r/20210527193841.1284169-1-robh@kernel.org
</content>
</entry>
<entry>
<title>of: unittest: overlay: ensure proper alignment of copied FDT</title>
<updated>2021-04-08T21:38:47+00:00</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@sony.com</email>
</author>
<published>2021-04-08T20:45:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48d499bd89191b359a6dbe44d32107e3021571c2'/>
<id>urn:sha1:48d499bd89191b359a6dbe44d32107e3021571c2</id>
<content type='text'>
The Devicetree standard specifies an 8 byte alignment of the FDT.
Code in libfdt expects this alignment for an FDT image in memory.
kmemdup() returns 4 byte alignment on openrisc.  Replace kmemdup()
with kmalloc(), align pointer, memcpy() to get proper alignment.

The 4 byte alignment exposed a related bug which triggered a crash
on openrisc with:
commit 79edff12060f ("scripts/dtc: Update to upstream version v1.6.0-51-g183df9e9c2b9")
as reported in:
https://lore.kernel.org/lkml/20210327224116.69309-1-linux@roeck-us.net/

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Link: https://lore.kernel.org/r/20210408204508.2276230-1-frowand.list@gmail.com
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>dma-mapping: introduce DMA range map, supplanting dma_pfn_offset</title>
<updated>2020-09-17T16:43:56+00:00</updated>
<author>
<name>Jim Quinlan</name>
<email>james.quinlan@broadcom.com</email>
</author>
<published>2020-09-17T16:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0d072782c734d27f5af062c62266f2598f68542'/>
<id>urn:sha1:e0d072782c734d27f5af062c62266f2598f68542</id>
<content type='text'>
The new field 'dma_range_map' in struct device is used to facilitate the
use of single or multiple offsets between mapping regions of cpu addrs and
dma addrs.  It subsumes the role of "dev-&gt;dma_pfn_offset" which was only
capable of holding a single uniform offset and had no region bounds
checking.

The function of_dma_get_range() has been modified so that it takes a single
argument -- the device node -- and returns a map, NULL, or an error code.
The map is an array that holds the information regarding the DMA regions.
Each range entry contains the address offset, the cpu_start address, the
dma_start address, and the size of the region.

of_dma_configure() is the typical manner to set range offsets but there are
a number of ad hoc assignments to "dev-&gt;dma_pfn_offset" in the kernel
driver code.  These cases now invoke the function
dma_direct_set_offset(dev, cpu_addr, dma_addr, size).

Signed-off-by: Jim Quinlan &lt;james.quinlan@broadcom.com&gt;
[hch: various interface cleanups]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
Tested-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
Tested-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
</content>
</entry>
</feed>
