|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3 |
|
| #
bc2c4642 |
| 14-Apr-2025 |
Lizhi Xu <[email protected]> |
software node: Prevent link creation failure from causing kobj reference count imbalance
syzbot reported a uaf in software_node_notify_remove. [1]
When any of the two sysfs_create_link() in softwar
software node: Prevent link creation failure from causing kobj reference count imbalance
syzbot reported a uaf in software_node_notify_remove. [1]
When any of the two sysfs_create_link() in software_node_notify() fails, the swnode->kobj reference count will not increase normally, which will cause swnode to be released incorrectly due to the imbalance of kobj reference count when executing software_node_notify_remove().
Increase the reference count of kobj before creating the link to avoid uaf.
[1] BUG: KASAN: slab-use-after-free in software_node_notify_remove+0x1bc/0x1c0 drivers/base/swnode.c:1108 Read of size 1 at addr ffff888033c08908 by task syz-executor105/5844 Freed by task 5844: software_node_notify_remove+0x159/0x1c0 drivers/base/swnode.c:1106 device_platform_notify_remove drivers/base/core.c:2387 [inline]
Fixes: 9eb59204d519 ("iommufd/selftest: Add set_dev_pasid in mock iommu") Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=2ff22910687ee0dfd48e Tested-by: [email protected] Signed-off-by: Lizhi Xu <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7 |
|
| #
bb391410 |
| 09-Jan-2025 |
Rob Herring (Arm) <[email protected]> |
device property: Split property reading bool and presence test ops
The fwnode/device property API currently implement (fwnode|device)_property_read_bool() with (fwnode|device)_property_present(). Th
device property: Split property reading bool and presence test ops
The fwnode/device property API currently implement (fwnode|device)_property_read_bool() with (fwnode|device)_property_present(). That does not allow having different behavior depending on the backend.
Specifically, the usage of (fwnode|device)_property_read_bool() on non-boolean properties is deprecated on DT. In order to add a warning on this deprecated use, these 2 APIs need separate ops for the backend.
Acked-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7 |
|
| #
4dc3d612 |
| 01-Mar-2024 |
Andy Shevchenko <[email protected]> |
device property: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use) principle.
Reviewed-by: Sakari Ailus <[email protected]> Acked-by: "Rafael J. Wy
device property: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use) principle.
Reviewed-by: Sakari Ailus <[email protected]> Acked-by: "Rafael J. Wysocki" <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1 |
|
| #
1eaea4b3 |
| 09-Nov-2023 |
Sakari Ailus <[email protected]> |
software node: Let args be NULL in software_node_get_reference_args
fwnode_get_property_reference_args() may not be called with args argument NULL and while OF already supports this. Add the missing
software node: Let args be NULL in software_node_get_reference_args
fwnode_get_property_reference_args() may not be called with args argument NULL and while OF already supports this. Add the missing NULL check.
The purpose is to be able to count the references.
Fixes: b06184acf751 ("software node: Add software_node_get_reference_args()") Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| #
4c095734 |
| 01-Nov-2023 |
Christophe JAILLET <[email protected]> |
software node: Remove usage of the deprecated ida_simple_xx() API
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove().
This is less verbose.
S
software node: Remove usage of the deprecated ida_simple_xx() API
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove().
This is less verbose.
Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/c7cdc3566c783d106138698b1e1923351fabace8.1698831275.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4, v6.3-rc3, v6.3-rc2, v6.3-rc1, v6.2, v6.2-rc8, v6.2-rc7 |
|
| #
c83d9ab4 |
| 04-Feb-2023 |
Thomas Weißschuh <[email protected]> |
driver core: make kobj_type structures constant
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type.
Take advantage of thi
driver core: make kobj_type structures constant
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type.
Take advantage of this to constify the structure definitions to prevent modification at runtime.
Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.2-rc6, v6.2-rc5, v6.2-rc4, v6.2-rc3, v6.2-rc2 |
|
| #
3dbdd920 |
| 28-Dec-2022 |
Andy Shevchenko <[email protected]> |
software node: Remove unused APIs
There are no more users of software_node_register_nodes() and software_node_unregister_nodes(). Remove them.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linu
software node: Remove unused APIs
There are no more users of software_node_register_nodes() and software_node_unregister_nodes(). Remove them.
Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Sakari Ailus <[email protected]> Tested-by: Daniel Scally <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.2-rc1, v6.1, v6.1-rc8, v6.1-rc7, v6.1-rc6, v6.1-rc5, v6.1-rc4, v6.1-rc3, v6.1-rc2, v6.1-rc1, v6.0, v6.0-rc7, v6.0-rc6, v6.0-rc5, v6.0-rc4, v6.0-rc3, v6.0-rc2, v6.0-rc1, v5.19, v5.19-rc8, v5.19-rc7, v5.19-rc6, v5.19-rc5, v5.19-rc4, v5.19-rc3, v5.19-rc2, v5.19-rc1, v5.18, v5.18-rc7, v5.18-rc6, v5.18-rc5, v5.18-rc4, v5.18-rc3, v5.18-rc2, v5.18-rc1, v5.17, v5.17-rc8, v5.17-rc7, v5.17-rc6, v5.17-rc5, v5.17-rc4, v5.17-rc3, v5.17-rc2, v5.17-rc1, v5.16, v5.16-rc8, v5.16-rc7 |
|
| #
c5fc5ba8 |
| 20-Dec-2021 |
Clément Léger <[email protected]> |
software node: fix wrong node passed to find nargs_prop
nargs_prop refers to a property located in the reference that is found within the nargs property. Use the correct reference node in call to pr
software node: fix wrong node passed to find nargs_prop
nargs_prop refers to a property located in the reference that is found within the nargs property. Use the correct reference node in call to property_entry_read_int_array() to retrieve the correct nargs value.
Fixes: b06184acf751 ("software node: Add software_node_get_reference_args()") Signed-off-by: Clément Léger <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Reviewed-by: Daniel Scally <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v5.16-rc6, v5.16-rc5, v5.16-rc4, v5.16-rc3, v5.16-rc2, v5.16-rc1, v5.15 |
|
| #
27e0bcd0 |
| 26-Oct-2021 |
Andy Shevchenko <[email protected]> |
device property: Drop redundant NULL checks
In cases when functions are called via fwnode operations, we already know that this is software node we are dealing with, hence no need to check if it's N
device property: Drop redundant NULL checks
In cases when functions are called via fwnode operations, we already know that this is software node we are dealing with, hence no need to check if it's NULL, it can't be,
Reported-by: YE Chengfeng <[email protected]> Reviewed-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v5.15-rc7, v5.15-rc6, v5.15-rc5, v5.15-rc4, v5.15-rc3, v5.15-rc2 |
|
| #
5aeb05b2 |
| 15-Sep-2021 |
Laurentiu Tudor <[email protected]> |
software node: balance refcount for managed software nodes
software_node_notify(), on KOBJ_REMOVE drops the refcount twice on managed software nodes, thus leading to underflow errors. Balance the re
software node: balance refcount for managed software nodes
software_node_notify(), on KOBJ_REMOVE drops the refcount twice on managed software nodes, thus leading to underflow errors. Balance the refcount by bumping it in the device_create_managed_software_node() function.
The error [1] was encountered after adding a .shutdown() op to our fsl-mc-bus driver.
[1] pc : refcount_warn_saturate+0xf8/0x150 lr : refcount_warn_saturate+0xf8/0x150 sp : ffff80001009b920 x29: ffff80001009b920 x28: ffff1a2420318000 x27: 0000000000000000 x26: ffffccac15e7a038 x25: 0000000000000008 x24: ffffccac168e0030 x23: ffff1a2428a82000 x22: 0000000000080000 x21: ffff1a24287b5000 x20: 0000000000000001 x19: ffff1a24261f4400 x18: ffffffffffffffff x17: 6f72645f726f7272 x16: 0000000000000000 x15: ffff80009009b607 x14: 0000000000000000 x13: ffffccac16602670 x12: 0000000000000a17 x11: 000000000000035d x10: ffffccac16602670 x9 : ffffccac16602670 x8 : 00000000ffffefff x7 : ffffccac1665a670 x6 : ffffccac1665a670 x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000ffffffff x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff1a2420318000 Call trace: refcount_warn_saturate+0xf8/0x150 kobject_put+0x10c/0x120 software_node_notify+0xd8/0x140 device_platform_notify+0x4c/0xb4 device_del+0x188/0x424 fsl_mc_device_remove+0x2c/0x4c rebofind sp.c__fsl_mc_device_remove+0x14/0x2c device_for_each_child+0x5c/0xac dprc_remove+0x9c/0xc0 fsl_mc_driver_remove+0x28/0x64 __device_release_driver+0x188/0x22c device_release_driver+0x30/0x50 bus_remove_device+0x128/0x134 device_del+0x16c/0x424 fsl_mc_bus_remove+0x8c/0x114 fsl_mc_bus_shutdown+0x14/0x20 platform_shutdown+0x28/0x40 device_shutdown+0x15c/0x330 __do_sys_reboot+0x218/0x2a0 __arm64_sys_reboot+0x28/0x34 invoke_syscall+0x48/0x114 el0_svc_common+0x40/0xdc do_el0_svc+0x2c/0x94 el0_svc+0x2c/0x54 el0t_64_sync_handler+0xa8/0x12c el0t_64_sync+0x198/0x19c ---[ end trace 32eb1c71c7d86821 ]---
Fixes: 151f6ff78cdf ("software node: Provide replacement for device_add_properties()") Reported-by: Jon Nettleton <[email protected]> Suggested-by: Heikki Krogerus <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Laurentiu Tudor <[email protected]> Cc: 5.12+ <[email protected]> # 5.12+ [ rjw: Fix up the software_node_notify() invocation ] Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v5.15-rc1, v5.14, v5.14-rc7, v5.14-rc6, v5.14-rc5, v5.14-rc4, v5.14-rc3, v5.14-rc2 |
|
| #
384f5a85 |
| 12-Jul-2021 |
Rafael J. Wysocki <[email protected]> |
software nodes: Split software_node_notify()
Split software_node_notify_remove) out of software_node_notify() and make device_platform_notify() call the latter on device addition and the former on d
software nodes: Split software_node_notify()
Split software_node_notify_remove) out of software_node_notify() and make device_platform_notify() call the latter on device addition and the former on device removal.
While at it, put the headers of the above functions into base.h, because they don't need to be present in a global header file.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
show more ...
|
|
Revision tags: v5.14-rc1, v5.13 |
|
| #
5dca69e2 |
| 23-Jun-2021 |
Heikki Krogerus <[email protected]> |
software node: Handle software node injection to an existing device properly
The function software_node_notify() - the function that creates and removes the symlinks between the node and the device
software node: Handle software node injection to an existing device properly
The function software_node_notify() - the function that creates and removes the symlinks between the node and the device - was called unconditionally in device_add_software_node() and device_remove_software_node(), but it needs to be called in those functions only in the special case where the node is added to a device that has already been registered.
This fixes NULL pointer dereference that happens if device_remove_software_node() is used with device that was never registered.
Fixes: b622b24519f5 ("software node: Allow node addition to already existing device") Reported-and-tested-by: Dominik Brodowski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v5.13-rc7, v5.13-rc6, v5.13-rc5, v5.13-rc4, v5.13-rc3, v5.13-rc2, v5.13-rc1, v5.12, v5.12-rc8 |
|
| #
b622b245 |
| 14-Apr-2021 |
Heikki Krogerus <[email protected]> |
software node: Allow node addition to already existing device
If the node is added to an already exiting device, the node needs to be also linked to the device separately.
This will make sure the r
software node: Allow node addition to already existing device
If the node is added to an already exiting device, the node needs to be also linked to the device separately.
This will make sure the reference count is kept in balance also when the node is injected to a device afterwards.
Fixes: e68d0119e328 ("software node: Introduce device_add_software_node()") Reported-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v5.12-rc7, v5.12-rc6 |
|
| #
4a32e384 |
| 29-Mar-2021 |
Andy Shevchenko <[email protected]> |
software node: Imply kobj_to_swnode() to be no-op
Since we don't use structure field layout randomization the manual shuffling can affect some macros, in particular kobj_to_swnode(), which becomes a
software node: Imply kobj_to_swnode() to be no-op
Since we don't use structure field layout randomization the manual shuffling can affect some macros, in particular kobj_to_swnode(), which becomes a no-op when kobj member is the first one in the struct swnode.
Bloat-o-meter statistics for swnode.o:
add/remove: 0/0 grow/shrink: 2/10 up/down: 9/-100 (-91) Total: Before=7217, After=7126, chg -1.26%
Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| #
73c93426 |
| 29-Mar-2021 |
Andy Shevchenko <[email protected]> |
software node: Deduplicate code in fwnode_create_software_node()
Deduplicate conditional and assignment in fwnode_create_software_node(), i.e. parent is checked in two out of three cases and parent
software node: Deduplicate code in fwnode_create_software_node()
Deduplicate conditional and assignment in fwnode_create_software_node(), i.e. parent is checked in two out of three cases and parent software node is assigned by to_swnode() call.
Reviewed-by: Daniel Scally <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| #
06ad93c3 |
| 29-Mar-2021 |
Andy Shevchenko <[email protected]> |
software node: Introduce software_node_alloc()/software_node_free()
Introduce software_node_alloc() and software_node_free() helpers. This will help with code readability and maintenance.
Signed-of
software node: Introduce software_node_alloc()/software_node_free()
Introduce software_node_alloc() and software_node_free() helpers. This will help with code readability and maintenance.
Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| #
3f6b6536 |
| 29-Mar-2021 |
Andy Shevchenko <[email protected]> |
software node: Free resources explicitly when swnode_register() fails
Currently we have a slightly twisted logic in swnode_register(). It frees resources that it doesn't allocate on error path and i
software node: Free resources explicitly when swnode_register() fails
Currently we have a slightly twisted logic in swnode_register(). It frees resources that it doesn't allocate on error path and in once case it relies on the ->release() implementation.
Untwist the logic by freeing resources explicitly when swnode_register() fails. Currently it happens only in fwnode_create_software_node().
Tested-by: Daniel Scally <[email protected]> Reviewed-by: Daniel Scally <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v5.12-rc5, v5.12-rc4, v5.12-rc3 |
|
| #
0b8bf06f |
| 08-Mar-2021 |
Andy Shevchenko <[email protected]> |
device property: Sync descriptions of swnode array and group APIs
After a few updates against swnode APIs the kernel documentation, i.e. for swnode group registration and unregistration deviates fro
device property: Sync descriptions of swnode array and group APIs
After a few updates against swnode APIs the kernel documentation, i.e. for swnode group registration and unregistration deviates from the one for swnode array. In general, the same rules are applied to both. Hence, synchronize descriptions of swnode array and group APIs
Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v5.12-rc2 |
|
| #
2a92c90f |
| 01-Mar-2021 |
Heikki Krogerus <[email protected]> |
software node: Fix device_add_software_node()
The function device_add_software_node() was meant to register the node supplied to it, but only if that node wasn't already registered. Right now the fu
software node: Fix device_add_software_node()
The function device_add_software_node() was meant to register the node supplied to it, but only if that node wasn't already registered. Right now the function attempts to always register the node. That will cause a failure with nodes that are already registered.
Fixing that by incrementing the reference count of the nodes that have already been registered, and only registering the new nodes. Also, clarifying the behaviour in the function documentation.
Fixes: e68d0119e328 ("software node: Introduce device_add_software_node()") Signed-off-by: Heikki Krogerus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
| #
8891123f |
| 01-Mar-2021 |
Heikki Krogerus <[email protected]> |
software node: Fix node registration
Software node can not be registered before its parent.
Fixes: 80488a6b1d3c ("software node: Add support for static node descriptors") Cc: 5.10+ <[email protected]
software node: Fix node registration
Software node can not be registered before its parent.
Fixes: 80488a6b1d3c ("software node: Add support for static node descriptors") Cc: 5.10+ <[email protected]> # 5.10+ Signed-off-by: Heikki Krogerus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
show more ...
|
|
Revision tags: v5.12-rc1, v5.12-rc1-dontuse, v5.11, v5.11-rc7 |
|
| #
151f6ff7 |
| 04-Feb-2021 |
Heikki Krogerus <[email protected]> |
software node: Provide replacement for device_add_properties()
At the moment the function device_del() is calling device_remove_properties() unconditionally. That will result into the reference coun
software node: Provide replacement for device_add_properties()
At the moment the function device_del() is calling device_remove_properties() unconditionally. That will result into the reference count of the software node attached to the device being decremented, and in most cases it will hit 0 at that point. So in practice device_del() will unregister the software node attached to the device, even if that was not the intention of the caller. Right now software nodes can not be reused or shared because of that.
So device_del() can not unregister the software nodes unconditionally like that. Unfortunately some of the users of device_add_properties() are now relying on this behaviour. Because of that, and also in general, we do need a function that can offer similar behaviour where the lifetime of the software node is bound to the lifetime of the device. But it just has to be a separate function so the behaviour is optional. We can not remove the device_remove_properties() call from device_del() before we have that new function, and before we have replaced device_add_properties() calls with it in all the places that require that behaviour.
This adds function device_create_managed_software_node() that can be used for exactly that purpose. Software nodes created with it are declared "managed", and separate handling for those nodes is added to the software node code. The reference count of the "managed" nodes is decremented when the device they are attached to is removed. This will not affect the other nodes that are not declared "managed".
The function device_create_managed_software_node() has also one additional feature that device_add_properties() does not have. It allows the software nodes created with it to be part of a node hierarchy by taking also an optional parent node as parameter.
Reviewed-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v5.11-rc6, v5.11-rc5, v5.11-rc4, v5.11-rc3 |
|
| #
000c08fd |
| 07-Jan-2021 |
Heikki Krogerus <[email protected]> |
media: software_node: Add support for fwnode_graph*() family of functions
This implements the remaining .graph_*() callbacks in the fwnode operations structure for the software nodes. That makes the
media: software_node: Add support for fwnode_graph*() family of functions
This implements the remaining .graph_*() callbacks in the fwnode operations structure for the software nodes. That makes the fwnode_graph_*() functions available in the drivers also when software nodes are used.
The implementation tries to mimic the "OF graph" as much as possible, but there is no support for the "reg" device property. The ports will need to have the index in their name which starts with "port@" (for example "port@0", "port@1", ...) and endpoints will use the index of the software node that is given to them during creation. The port nodes can also be grouped under a specially named "ports" subnode, just like in DT, if necessary.
The remote-endpoints are reference properties under the endpoint nodes that are named "remote-endpoint".
Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Co-developed-by: Daniel Scally <[email protected]> Signed-off-by: Daniel Scally <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|
| #
fc002f0f |
| 07-Jan-2021 |
Daniel Scally <[email protected]> |
media: software_node: unregister software_nodes in reverse order
To maintain consistency with software_node_unregister_nodes(), reverse the order in which the software_node_unregister_node_group() f
media: software_node: unregister software_nodes in reverse order
To maintain consistency with software_node_unregister_nodes(), reverse the order in which the software_node_unregister_node_group() function unregisters nodes.
Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Daniel Scally <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|
| #
d9b1103b |
| 07-Jan-2021 |
Daniel Scally <[email protected]> |
media: software_node: Enforce parent before child ordering of nodes arrays
Registering software_nodes with the .parent member set to point to a currently unregistered software_node has the potential
media: software_node: Enforce parent before child ordering of nodes arrays
Registering software_nodes with the .parent member set to point to a currently unregistered software_node has the potential for problems, so enforce parent -> child ordering in arrays passed in to software_node_register_nodes().
Software nodes that are children of another software node should be unregistered before their parent. To allow easy unregistering of an array of software_nodes ordered parent to child, reverse the order in which software_node_unregister_nodes() unregisters software_nodes.
Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Daniel Scally <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|
| #
fb5ec981 |
| 07-Jan-2021 |
Daniel Scally <[email protected]> |
media: software_node: Fix refcounts in software_node_get_next_child()
The software_node_get_next_child() function currently does not hold references to the child software_node that it finds or put t
media: software_node: Fix refcounts in software_node_get_next_child()
The software_node_get_next_child() function currently does not hold references to the child software_node that it finds or put the ref that is held against the old child - fix that.
Fixes: 59abd83672f7 ("drivers: base: Introducing software nodes to the firmware node framework") Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Daniel Scally <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
show more ...
|