<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/interconnect-provider.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-06-27T18:43:40+00:00</updated>
<entry>
<title>interconnect: avoid memory allocation when 'icc_bw_lock' is held</title>
<updated>2025-06-27T18:43:40+00:00</updated>
<author>
<name>Gabor Juhos</name>
<email>j4g8y7@gmail.com</email>
</author>
<published>2025-06-27T07:58:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c5b60592886f97b01503c1bb553f88d6a7df42ea'/>
<id>urn:sha1:c5b60592886f97b01503c1bb553f88d6a7df42ea</id>
<content type='text'>
The 'icc_bw_lock' mutex is introduced in commit af42269c3523
("interconnect: Fix locking for runpm vs reclaim") in order to decouple
serialization of bw aggregation from codepaths that require memory
allocation.

However commit d30f83d278a9 ("interconnect: core: Add dynamic id
allocation support") added a devm_kasprintf() call into a path protected
by the 'icc_bw_lock' which causes the following lockdep warning on
machines like the Lenovo ThinkPad X13s:

    ======================================================
    WARNING: possible circular locking dependency detected
    6.16.0-rc3 #15 Not tainted
    ------------------------------------------------------
    (udev-worker)/342 is trying to acquire lock:
    ffffb973f7ec4638 (fs_reclaim){+.+.}-{0:0}, at: __kmalloc_node_track_caller_noprof+0xa0/0x3e0

    but task is already holding lock:
    ffffb973f7f7f0e8 (icc_bw_lock){+.+.}-{4:4}, at: icc_node_add+0x44/0x154

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -&gt; #1 (icc_bw_lock){+.+.}-{4:4}:
           icc_init+0x48/0x108
           do_one_initcall+0x64/0x30c
           kernel_init_freeable+0x27c/0x500
           kernel_init+0x20/0x1d8
           ret_from_fork+0x10/0x20

    -&gt; #0 (fs_reclaim){+.+.}-{0:0}:
           __lock_acquire+0x136c/0x2114
           lock_acquire+0x1c8/0x354
           fs_reclaim_acquire+0x74/0xa8
           __kmalloc_node_track_caller_noprof+0xa0/0x3e0
           devm_kmalloc+0x54/0x124
           devm_kvasprintf+0x74/0xd4
           devm_kasprintf+0x58/0x80
           icc_node_add+0xb4/0x154
           qcom_osm_l3_probe+0x20c/0x314 [icc_osm_l3]
           platform_probe+0x68/0xd8
           really_probe+0xc0/0x38c
           __driver_probe_device+0x7c/0x160
           driver_probe_device+0x40/0x110
           __driver_attach+0xfc/0x208
           bus_for_each_dev+0x74/0xd0
           driver_attach+0x24/0x30
           bus_add_driver+0x110/0x234
           driver_register+0x60/0x128
           __platform_driver_register+0x24/0x30
           osm_l3_driver_init+0x20/0x1000 [icc_osm_l3]
           do_one_initcall+0x64/0x30c
           do_init_module+0x58/0x23c
           load_module+0x1df8/0x1f70
           init_module_from_file+0x88/0xc4
           idempotent_init_module+0x188/0x280
           __arm64_sys_finit_module+0x6c/0xd8
           invoke_syscall+0x48/0x110
           el0_svc_common.constprop.0+0xc0/0xe0
           do_el0_svc+0x1c/0x28
           el0_svc+0x4c/0x158
           el0t_64_sync_handler+0xc8/0xcc
           el0t_64_sync+0x198/0x19c

    other info that might help us debug this:

     Possible unsafe locking scenario:

           CPU0                    CPU1
           ----                    ----
      lock(icc_bw_lock);
                                   lock(fs_reclaim);
                                   lock(icc_bw_lock);
      lock(fs_reclaim);

     *** DEADLOCK ***

The icc_node_add() functions is not designed to fail, and as such it
should not do any memory allocation. In order to avoid this, add a new
helper function for the name generation to be called by drivers which
are using the new dynamic id feature.

Fixes: d30f83d278a9 ("interconnect: core: Add dynamic id allocation support")
Signed-off-by: Gabor Juhos &lt;j4g8y7@gmail.com&gt;
Link: https://lore.kernel.org/r/20250625-icc-bw-lockdep-v3-1-2b8f8b8987c4@gmail.com
Co-developed-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Link: https://lore.kernel.org/r/20250627075854.26943-1-johan+linaro@kernel.org
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>interconnect: core: Add dynamic id allocation support</title>
<updated>2025-04-15T11:13:36+00:00</updated>
<author>
<name>Raviteja Laggyshetty</name>
<email>quic_rlaggysh@quicinc.com</email>
</author>
<published>2025-04-15T09:53:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d30f83d278a921485b3e877d03fe937bccfcbcdd'/>
<id>urn:sha1:d30f83d278a921485b3e877d03fe937bccfcbcdd</id>
<content type='text'>
The current interconnect framework relies on static IDs for node
creation and registration, which limits topologies with multiple
instances of the same interconnect provider. To address this,
introduce icc_node_create_dyn() and icc_link_nodes() APIs to
dynamically allocate IDs for interconnect nodes during creation
and link. This change removes the dependency on static IDs,
allowing multiple instances of the same hardware, such as EPSS L3.

Signed-off-by: Raviteja Laggyshetty &lt;quic_rlaggysh@quicinc.com&gt;
Link: https://lore.kernel.org/r/20250415095343.32125-3-quic_rlaggysh@quicinc.com
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>interconnect: constify of_phandle_args in xlate</title>
<updated>2024-02-25T22:38:17+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2024-02-20T07:22:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0dc5b8abfa03e8720cb341699e3ece194058bb03'/>
<id>urn:sha1:0dc5b8abfa03e8720cb341699e3ece194058bb03</id>
<content type='text'>
The xlate callbacks are supposed to translate of_phandle_args to proper
provider without modifying the of_phandle_args.  Make the argument
pointer to const for code safety and readability.

Acked-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Acked-by: Thierry Reding &lt;treding@nvidia.com&gt; # Tegra
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Acked-by: Alim Akhtar &lt;alim.akhtar@samsung.com&gt; # Samsung
Link: https://lore.kernel.org/r/20240220072213.35779-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>interconnect: qcom: Annotate struct icc_onecell_data with __counted_by</title>
<updated>2023-08-21T22:11:32+00:00</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2023-08-17T20:42:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dd4904f3b924b489a0adbd88768fadaadab94156'/>
<id>urn:sha1:dd4904f3b924b489a0adbd88768fadaadab94156</id>
<content type='text'>
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct icc_onecell_data.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc: Andy Gross &lt;agross@kernel.org&gt;
Cc: Bjorn Andersson &lt;andersson@kernel.org&gt;
Cc: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Cc: Georgi Djakov &lt;djakov@kernel.org&gt;
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Acked-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Link: https://lore.kernel.org/r/20230817204215.never.916-kees@kernel.org
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>interconnect: drop unused icc_link_destroy() interface</title>
<updated>2023-04-05T08:29:59+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan+linaro@kernel.org</email>
</author>
<published>2023-03-06T07:56:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b2d110cd5d28ded813f060b735cd68bfe2e5010f'/>
<id>urn:sha1:b2d110cd5d28ded813f060b735cd68bfe2e5010f</id>
<content type='text'>
Now that the link array is deallocated when destroying nodes and the
explicit link removal has been dropped from the exynos driver there are
no further users of and no need for the icc_link_destroy() interface.

Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Link: https://lore.kernel.org/r/20230306075651.2449-24-johan+linaro@kernel.org
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>interconnect: drop racy registration API</title>
<updated>2023-03-20T14:44:04+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan+linaro@kernel.org</email>
</author>
<published>2023-03-06T07:56:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=419405c92299d793b95053aa54d95e2d3f45a1a4'/>
<id>urn:sha1:419405c92299d793b95053aa54d95e2d3f45a1a4</id>
<content type='text'>
Now that all interconnect drivers have been converted to the new
provider registration API, the old racy interface can be removed.

Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Link: https://lore.kernel.org/r/20230306075651.2449-22-johan+linaro@kernel.org
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>interconnect: fix provider registration API</title>
<updated>2023-03-07T20:19:05+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan+linaro@kernel.org</email>
</author>
<published>2023-03-06T07:56:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb59eca0d8ac15f8c1b7f1cd35999455a90292c0'/>
<id>urn:sha1:eb59eca0d8ac15f8c1b7f1cd35999455a90292c0</id>
<content type='text'>
The current interconnect provider interface is inherently racy as
providers are expected to be added before being fully initialised.

Specifically, nodes are currently not added and the provider data is not
initialised until after registering the provider which can cause racing
DT lookups to fail.

Add a new provider API which will be used to fix up the interconnect
drivers.

The old API is reimplemented using the new interface and will be removed
once all drivers have been fixed.

Fixes: 11f1ceca7031 ("interconnect: Add generic on-chip interconnect API")
Fixes: 87e3031b6fbd ("interconnect: Allow endpoints translation via DT")
Cc: stable@vger.kernel.org      # 5.1
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Tested-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt; # i.MX8MP MSC SM2-MB-EP1 Board
Link: https://lore.kernel.org/r/20230306075651.2449-4-johan+linaro@kernel.org
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>interconnect: Make icc_provider_del() return void</title>
<updated>2022-08-16T13:38:42+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2022-07-18T12:14:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=680f8666baf6b4a6cc368dfff6614010ec23c51d'/>
<id>urn:sha1:680f8666baf6b4a6cc368dfff6614010ec23c51d</id>
<content type='text'>
All users ignore the return value of icc_provider_del(). Consequently
make it not return an error code.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20220718121409.171773-8-u.kleine-koenig@pengutronix.de
Signed-off-by: Georgi Djakov &lt;djakov@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'icc-syncstate' into icc-next</title>
<updated>2020-09-18T06:13:40+00:00</updated>
<author>
<name>Georgi Djakov</name>
<email>georgi.djakov@linaro.org</email>
</author>
<published>2020-09-18T06:12:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=628fdbcf9d665ab68f5493936ca23383a5844ff7'/>
<id>urn:sha1:628fdbcf9d665ab68f5493936ca23383a5844ff7</id>
<content type='text'>
* icc-syncstate:
  interconnect: Add get_bw() callback
  interconnect: Add sync state support
  interconnect: qcom: Use icc_sync_state

Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
</content>
</entry>
<entry>
<title>interconnect: Add sync state support</title>
<updated>2020-09-18T05:56:52+00:00</updated>
<author>
<name>Georgi Djakov</name>
<email>georgi.djakov@linaro.org</email>
</author>
<published>2020-08-25T17:01:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b1d681d8d32499bcf284462d92aeb5f9fe72bf5b'/>
<id>urn:sha1:b1d681d8d32499bcf284462d92aeb5f9fe72bf5b</id>
<content type='text'>
The bootloaders often do some initial configuration of the interconnects
in the system and we want to keep this configuration until all consumers
have probed and expressed their bandwidth needs. This is because we don't
want to change the configuration by starting to disable unused paths until
every user had a chance to request the amount of bandwidth it needs.

To accomplish this we will implement an interconnect specific sync_state
callback which will synchronize (aggregate and set) the current bandwidth
settings when all consumers have been probed.

Link: https://lore.kernel.org/r/20200825170152.6434-3-georgi.djakov@linaro.org
Reviewed-by: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Georgi Djakov &lt;georgi.djakov@linaro.org&gt;
</content>
</entry>
</feed>
