- 02 4月, 2021 1 次提交
-
-
由 Saravana Kannan 提交于
remote-endpoint property seems to always come in pairs where two devices point to each other. So, we can't really tell from DT if there is a functional probe order dependency between these two devices. However, there can be other dependencies between two devices that point to each other with remote-endpoint. This non-remote-endpoint dependency combined with one of the remote-endpoint dependency can lead to a cyclic dependency[1]. To avoid this cyclic dependency from incorrectly blocking probes, fw_devlink needs to be made aware of remote-endpoint dependencies even though remote-endpoint dependencies by themselves won't affect probe ordering (because fw_devlink will see the cyclic dependency between remote-endpoint devices and ignore the dependencies that cause the cycle). Also, if a device ever needs to know if a non-probe-blocking remote-endpoint has finished probing, it can now use the sync_state() to figure it out. [1] - https://lore.kernel.org/lkml/CAGETcx9Snf23wrXqjDhJiTok9M3GcoVYDSyNYSMj9QnSRrA=cA@mail.gmail.com/#t Fixes: ea718c69 ("Revert "Revert "driver core: Set fw_devlink=on by default""") Reported-by: NStephen Boyd <swboyd@chromium.org> Tested-by: NStephen Boyd <swboyd@chromium.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210330185056.1022008-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 19 2月, 2021 1 次提交
-
-
由 Saravana Kannan 提交于
When CONFIG_OF_IRQ is not defined, it doesn't make sense to parse interrupts property. Also, parsing and tracking interrupts property breaks some PPC devices[1]. But none of the IRQ drivers in PPC seem ready to be converted to a proper platform (or any bus) driver. So, there's not much of a point in tracking the interrupts property for CONFIG_PPC. So, let's stop parsing interrupts for CONFIG_PPC. [1] - https://lore.kernel.org/lkml/20210213185422.GA195733@roeck-us.net/ Fixes: 4104ca77 ("of: property: Add fw_devlink support for interrupts") Reported-by: NGuenter Roeck <linux@roeck-us.net> Tested-by: NGuenter Roeck <linux@roeck-us.net> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210215224258.1231449-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 09 2月, 2021 3 次提交
-
-
由 Saravana Kannan 提交于
Not all DT bindings are mandatory bindings. Add support for optional DT bindings and mark iommus, iommu-map, dmas as optional DT bindings. Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210205222644.2357303-5-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
If driver core marks a firmware node as not a device, don't add fwnode links where it's a supplier. Fixes: e5904747 ("driver core: Set fw_devlink=on by default") Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210205222644.2357303-3-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
Commit 4104ca77 ("of: property: Add fw_devlink support for interrupts") was not taking interrupt-map into account. Fix that. Fixes: 4104ca77 ("of: property: Add fw_devlink support for interrupts") Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com> Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210209010439.3529036-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 26 1月, 2021 2 次提交
-
-
由 Saravana Kannan 提交于
This allows fw_devlink to create device links between consumers of an interrupt and the supplier of the interrupt. Cc: Marc Zyngier <maz@kernel.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: NRob Herring <robh@kernel.org> Reviewed-by: NThierry Reding <treding@nvidia.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210121225712.1118239-3-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
To provide backward compatibility for boards that use deprecated DT bindings, we need to add fw_devlink support for "gpio" and "gpios". We also need to ignore these properties on nodes with "gpio-hog" property because their gpio[s] are all supplied by the parent node. Fixes: e5904747 ("driver core: Set fw_devlink=on by default") Cc: linux-tegra <linux-tegra@vger.kernel.org> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: NJon Hunter <jonathanh@nvidia.com> Reviewed-by: NRob Herring <robh@kernel.org> Reviewed-by: NThierry Reding <treding@nvidia.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20210121225712.1118239-2-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 10 12月, 2020 2 次提交
-
-
由 Saravana Kannan 提交于
The struct device input to add_links() is not used for anything. So delete it. Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20201121020232.908850-18-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
The semantics of add_links() has changed from creating device link between devices to creating fwnode links between fwnodes. So, update the implementation of add_links() to match the new semantics. Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20201121020232.908850-15-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 28 7月, 2020 2 次提交
-
-
由 Saravana Kannan 提交于
Add support for pinctrl-0 through pinctrl-8 explicitly instead of trying to add support for pinctrl-%d properties. Of all the pinctrl-* properties in dts files (20322), only 47% (9531) are pinctrl-%d properties. Of all the pinctrl-%d properties, 99.5% (9486) are made up of pinctrl-[0-2]. 'pinctrl-8' is the current maximum found in dts files. Trying to parse all pinctrl-* properties and checking for pinctrl-%d is unnecessarily complicated. So, just add support for pinctrl-[0-8] for now. In the unlikely event we ever exceed pinctrl-8, we can come back and improve this. Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20200724234415.1651639-2-saravanak@google.comSigned-off-by: NRob Herring <robh@kernel.org>
-
由 Saravana Kannan 提交于
Add support for creating device links out of the following DT bindings: - interrupts-extended - nvmem-cells - phys - wakeup-parent Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20200724234415.1651639-1-saravanak@google.comSigned-off-by: NRob Herring <robh@kernel.org>
-
- 01 7月, 2020 1 次提交
-
-
由 Dmitry Osipenko 提交于
In some cases it's very useful to silently check whether port node exists at all in a device-tree before proceeding with parsing the graph. The DRM bridges code is one example of such case where absence of a graph in a device-tree is a legit condition. This patch adds of_graph_is_present() which returns true if given device-tree node contains OF graph port. Reviewed-by: NRob Herring <robh@kernel.org> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: NSam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200701074232.13632-2-digetx@gmail.com
-
- 18 6月, 2020 1 次提交
-
-
由 Saravana Kannan 提交于
Consider this example where -> means LHS device is a consumer of RHS device and indentation represents "child of" of the previous device. Device A -> Device C Device B -> Device A Device C Without this commit: 1. Device A is added. 2. Device A is added to waiting for supplier list (Device C) 3. Device B is added 4. Device B is linked as a consumer to Device A 5. Device A doesn't probe because it's waiting for Device C to be added. 6. Device B doesn't probe because Device A hasn't probed. 7. Device C will never be added because it's parent hasn't probed. So, Device A, B and C will be in a probe/add deadlock. This commit detects this scenario and stops trying to create a device link between Device A and Device C since doing so would create the following cycle: Device A -> Devic C -(parent)-> Device B -> Device A. With this commit: 1. Device A is added. 3. Device B is added 4. Device B is linked as a consumer to Device A 5. Device A probes. 6. Device B probes because Device A has probed. 7. Device C is added and probed. Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20200610011934.49795-3-saravanak@google.comSigned-off-by: NRob Herring <robh@kernel.org>
-
- 29 4月, 2020 3 次提交
-
-
由 Nicolas Saenz Julienne 提交于
When creating a consumer/supplier relationship between two devices, make sure the supplier node is actually active. Otherwise this will create a link relationship that will never be fulfilled. This, in the worst case scenario, will hang the system during boot. Note that, in practice, the fact that a device-tree represented consumer/supplier relationship isn't fulfilled will not prevent devices from successfully probing. Fixes: a3e1d1a7 ("of: property: Add functional dependency link from DT bindings") Signed-off-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: NSaravana Kannan <saravanak@google.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Nicolas Saenz Julienne 提交于
Upon adding a new device from a DT node, we scan its properties and its children's properties in order to create a consumer/supplier relationship between the device and the property provider. That said, it's possible for some of the node's children to be disabled, which will create links that'll never be fulfilled. To get around this, use the for_each_available_child_of_node() function instead of for_each_available_node() when iterating over the node's children. Fixes: d4387cd1 ("of: property: Create device links for all child-supplier depencencies") Signed-off-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: NSaravana Kannan <saravanak@google.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
由 Saravana Kannan 提交于
When of_link_to_phandle() was implemented initially, there was no way to tell if device_link_add() was failing because the supplier device hasn't been parsed yet, hasn't been added yet, the links were creating a cycle, etc. Some of these were transient errors that'd go away at a later point. However, with the current set of improved checks, if device_link_add() fails, it'll only be for permanent errors like cycles or out-of-memory errors. Also, with the addition of DL_FLAG_SYNC_STATE_ONLY flag [1] to device links, all the valid dependency cycles due to "proxy" device links (needed for correctness of sync_state() device callback) will never fail device_link_add() due to cycles. So, continuing to retry failing device links (by returning -EAGAIN) is no longer useful. At worst, it prevents platforms from setting fw_devlink=on (or better) because it prevents proper boot up. So, let's not do that anymore. [1] - https://lore.kernel.org/lkml/20191028220027.251605-1-saravanak@google.com/ Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Tested-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 15 4月, 2020 1 次提交
-
-
由 Saravana Kannan 提交于
Add support for creating device links out of more DT properties. Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: NSaravana Kannan <saravanak@google.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 05 3月, 2020 2 次提交
-
-
由 Saravana Kannan 提交于
With the addition of fw_devlink kernel commandline option, of_devlink is redundant and not useful anymore. So, delete it. Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20200222014038.180923-6-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
The fw_devlink_get_flags() provides the right flags to use when creating mandatory device links derived from information provided by the firmware. So, use that. Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20200222014038.180923-5-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 26 2月, 2020 1 次提交
-
-
由 Saravana Kannan 提交于
Add support for creating device links out of more DT properties. To: lkml <linux-kernel@vger.kernel.org> To: John Stultz <john.stultz@linaro.org> To: Rob Herring <robh@kernel.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Kevin Hilman <khilman@kernel.org> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Len Brown <len.brown@intel.com> Cc: Todd Kjos <tkjos@google.com> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-pm@vger.kernel.org Signed-off-by: NSaravana Kannan <saravanak@google.com> Tested-by: NJohn Stultz <john.stultz@linaro.org> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 22 11月, 2019 1 次提交
-
-
由 Saravana Kannan 提交于
Add support for creating device links out of more DT properties. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vinod Koul <vkoul@kernel.org> Signed-off-by: NSaravana Kannan <saravanak@google.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20191120071302.227777-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 21 11月, 2019 2 次提交
-
-
由 Will Deacon 提交于
Commit 8e12257d ("of: property: Add device link support for iommus, mboxes and io-channels") added device link support for IOMMU linkages described using the "iommus" property. For PCI devices, this property is not present and instead the "iommu-map" property is used on the host bridge node to map the endpoint RequesterIDs to their corresponding IOMMU instance. Add support for "iommu-map" to the device link supplier bindings so that probing of PCI devices can be deferred until after the IOMMU is available. Cc: Rob Herring <robh@kernel.org> Cc: Robin Murphy <robin.murphy@arm.com> Signed-off-by: NWill Deacon <will@kernel.org> Acked-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20191120190028.4722-1-will@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
The of_is_ancestor_of() function was renamed from of_link_is_valid() based on review feedback. The rename meant the semantics of the function had to be inverted, but this was missed in the earlier patch. So, fix the semantics of of_is_ancestor_of() and invert the conditional expressions where it is used. Fixes: a3e1d1a7 ("of: property: Add functional dependency link from DT bindings") Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20191120080230.16007-1-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 15 11月, 2019 1 次提交
-
-
由 Matti Vaittinen 提交于
Property fetching functions which return number of successfully fetched properties should not state that out-values are only modified if 0 is returned. Fix this. Also, "pointer to return value" is slightly suboptimal phrase as "return value" commonly refers to value function returns (not via arguments). Rather use "pointer to found values". Signed-off-by: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: NFrank Rowand <frowand.list@gmail.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 07 11月, 2019 3 次提交
-
-
由 Saravana Kannan 提交于
Add support for creating device links out of more DT properties. Signed-off-by: NSaravana Kannan <saravanak@google.com> Reviewed-by: NRob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20191105065000.50407-4-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
Add a DEFINE_SIMPLE_PROP macro to make it easy to add support for simple properties with fixed names that just list phandles and phandle args. Add a DEFINE_SUFFIX_PROP macro to make it easy to add support for properties with fixes suffix that just list phandles and phandle args. Signed-off-by: NSaravana Kannan <saravanak@google.com> Reviewed-by: NRob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20191105065000.50407-3-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
Adding a debug log instead of silently ignoring a phandle for an early device. Also, return the right error code instead of 0 even though the actual execution flow won't change. Signed-off-by: NSaravana Kannan <saravanak@google.com> Reviewed-by: NRob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20191105065000.50407-2-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 03 11月, 2019 2 次提交
-
-
由 Saravana Kannan 提交于
Some devices need to be initialized really early and can't wait for driver core or drivers to be functional. These devices are typically initialized without creating a struct device for their device nodes. If a supplier ends up being one of these devices, skip trying to add device links to them. Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20191028220027.251605-6-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
When creating device links to proxy the sync_state() needs of child dependencies, create SYNC_STATE_ONLY device links so that children dependencies don't block probing of the parent. Also, differentiate between missing suppliers of parent device vs missing suppliers of child devices so that driver core doesn't block parent device probing when only child supplier dependencies are missing. Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20191028220027.251605-5-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 17 10月, 2019 1 次提交
-
-
由 Saravana Kannan 提交于
Better variable and function names. Remove "," after the sentinel in an array initialization list. Signed-off-by: NSaravana Kannan <saravanak@google.com> Acked-by: NRob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20191011191521.179614-2-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 11 10月, 2019 2 次提交
-
-
由 Sakari Ailus 提交于
The prefix is used for printing purpose before a node, and it also works as a separator between two nodes. Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Rob Herring <robh@kernel.org> (for OF) Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Sakari Ailus 提交于
The fwnode framework did not have means to obtain the name of a node. Add that now, in form of the fwnode_get_name() function and a corresponding get_name fwnode op. OF and ACPI support is included. Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Rob Herring <robh@kernel.org> (for OF) Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 04 10月, 2019 2 次提交
-
-
由 Saravana Kannan 提交于
A parent device can have child devices that it adds when it probes. But this probing of the parent device can happen way after kernel init is done -- for example, when the parent device's driver is loaded as a module. In such cases, if the child devices depend on a supplier in the system, we need to make sure the supplier gets the sync_state() callback only after these child devices are added and probed. To achieve this, when creating device links for a device by looking at its DT node, don't just look at DT references at the top node level. Look at DT references in all the descendant nodes too and create device links from the ancestor device to all these supplier devices. This way, when the parent device probes and adds child devices, the child devices can then create their own device links to the suppliers and further delay the supplier's sync_state() callback to after the child devices are probed. Example: In this illustration, -> denotes DT references and indentation represents child status. Device node A Device node B -> D Device node C -> B, D Device node D Assume all these devices have their drivers loaded as modules. Without this patch, this is the sequence of events: 1. D is added. 2. A is added. 3. Device D probes. 4. Device D gets its sync_state() callback. 5. Device B and C might malfunction because their resources got altered/turned off before they can make active requests for them. With this patch, this is the sequence of events: 1. D is added. 2. A is added and creates device links to D. 3. Device link from A to B is not added because A is a parent of B. 4. Device D probes. 5. Device D does not get it's sync_state() callback because consumer A hasn't probed yet. 5. Device A probes. 5. a. Devices B and C are added. 5. b. Device links from B and C to D are added. 5. c. Device A's probe completes. 6. Device D does not get it's sync_state() callback because consumer A has probed but consumers B and C haven't probed yet. 7. Device B and C probe. 8. Device D gets it's sync_state() callback because all its consumers have probed. 9. None of the devices malfunction. Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20190904211126.47518-7-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Saravana Kannan 提交于
Add device links after the devices are created (but before they are probed) by looking at common DT bindings like clocks and interconnects. Automatically adding device links for functional dependencies at the framework level provides the following benefits: - Optimizes device probe order and avoids the useless work of attempting probes of devices that will not probe successfully (because their suppliers aren't present or haven't probed yet). For example, in a commonly available mobile SoC, registering just one consumer device's driver at an initcall level earlier than the supplier device's driver causes 11 failed probe attempts before the consumer device probes successfully. This was with a kernel with all the drivers statically compiled in. This problem gets a lot worse if all the drivers are loaded as modules without direct symbol dependencies. - Supplier devices like clock providers, interconnect providers, etc need to keep the resources they provide active and at a particular state(s) during boot up even if their current set of consumers don't request the resource to be active. This is because the rest of the consumers might not have probed yet and turning off the resource before all the consumers have probed could lead to a hang or undesired user experience. Some frameworks (Eg: regulator) handle this today by turning off "unused" resources at late_initcall_sync and hoping all the devices have probed by then. This is not a valid assumption for systems with loadable modules. Other frameworks (Eg: clock) just don't handle this due to the lack of a clear signal for when they can turn off resources. This leads to downstream hacks to handle cases like this that can easily be solved in the upstream kernel. By linking devices before they are probed, we give suppliers a clear count of the number of dependent consumers. Once all of the consumers are active, the suppliers can turn off the unused resources without making assumptions about the number of consumers. By default we just add device-links to track "driver presence" (probe succeeded) of the supplier device. If any other functionality provided by device-links are needed, it is left to the consumer/supplier devices to change the link when they probe. kbuild test robot reported clang error about missing const Reported-by: Nkbuild test robot <lkp@intel.com> Signed-off-by: NSaravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20190904211126.47518-4-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 10 4月, 2019 1 次提交
-
-
由 Maxime Ripard 提交于
The node returned by of_graph_get_endpoint_by_regs has a reference taken, and we need to put that reference back when done with the node. However, the documentation for that node doesn't mention it, so let's make sure it does. Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 17 1月, 2019 1 次提交
-
-
由 Julia Lawall 提交于
Add an of_node_put when the result of of_graph_get_remote_port_parent is not available. The semantic match that finds this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @r exists@ local idexpression e; expression x; @@ e = of_graph_get_remote_port_parent(...); ... when != x = e when != true e == NULL when != of_node_put(e) when != of_fwnode_handle(e) ( return e; | *return ...; ) // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Cc: stable@vger.kernel.org Signed-off-by: NRob Herring <robh@kernel.org>
-
- 06 12月, 2018 1 次提交
-
-
由 Rob Herring 提交于
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. Cc: Frank Rowand <frowand.list@gmail.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: devicetree@vger.kernel.org Signed-off-by: NRob Herring <robh@kernel.org>
-
- 12 2月, 2018 1 次提交
-
-
由 Andy Shevchenko 提交于
Constify device_get_match_data() as OF and ACPI variants return constant value. Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 08 1月, 2018 1 次提交
-
-
由 Rob Herring 提交于
Convert remaining DT files to use SPDX-License-Identifier tags. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Reviewed-by: NFrank Rowand <frank.rowand@sony.com> Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com> Signed-off-by: NRob Herring <robh@kernel.org>
-
- 13 12月, 2017 1 次提交
-
-
由 Sinan Kaya 提交于
Now that we have a get_match_data() callback as part of the firmware node, implement the OF specific piece for it. Signed-off-by: NSinan Kaya <okaya@codeaurora.org> Reviewed-by: NRob Herring <robh@kernel.org> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: NVinod Koul <vinod.koul@intel.com>
-