<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/mfd/mfd-core.c, branch v6.6.131</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.131</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.131'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-04T12:21:11+00:00</updated>
<entry>
<title>mfd: core: Add locking around 'mfd_of_node_list'</title>
<updated>2026-03-04T12:21:11+00:00</updated>
<author>
<name>Douglas Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2025-12-10T19:30:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e2e7c275f557e2b75e3128f4818063798248774c'/>
<id>urn:sha1:e2e7c275f557e2b75e3128f4818063798248774c</id>
<content type='text'>
[ Upstream commit 20117c92bcf9c11afd64d7481d8f94fdf410726e ]

Manipulating a list in the kernel isn't safe without some sort of
mutual exclusion. Add a mutex any time we access / modify
'mfd_of_node_list' to prevent possible crashes.

Cc: stable@vger.kernel.org
Fixes: 466a62d7642f ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Link: https://patch.msgid.link/20251210113002.1.I6ceaca2cfb7eb25737012b166671f516696be4fd@changeid
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>mfd: core: Ensure disabled devices are skipped without aborting</title>
<updated>2023-11-20T10:59:24+00:00</updated>
<author>
<name>Herve Codina</name>
<email>herve.codina@bootlin.com</email>
</author>
<published>2023-08-18T16:39:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=82fa83fbcc114f550472aebf5c61c5c7744d91f3'/>
<id>urn:sha1:82fa83fbcc114f550472aebf5c61c5c7744d91f3</id>
<content type='text'>
[ Upstream commit 7ba7bdef4d14e3722e2842da3b48cbadb73e52d6 ]

The loop searching for a matching device based on its compatible
string is aborted when a matching disabled device is found.
This abort prevents to add devices as soon as one disabled device
is found.

Continue searching for an other device instead of aborting on the
first disabled one fixes the issue.

Fixes: 22380b65dc70 ("mfd: mfd-core: Ensure disabled devices are ignored without error")
Signed-off-by: Herve Codina &lt;herve.codina@bootlin.com&gt;
Reviewed-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Link: https://lore.kernel.org/r/528425d6472176bb1d02d79596b51f8c28a551cc.1692376361.git.christophe.leroy@csgroup.eu
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>mfd: core: Use of_property_read_reg() to parse "reg"</title>
<updated>2023-06-15T15:22:54+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-06-09T18:31:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c7fe3bbfd622b5ee2341f38421217f56629832a1'/>
<id>urn:sha1:c7fe3bbfd622b5ee2341f38421217f56629832a1</id>
<content type='text'>
Use the recently added of_property_read_reg() helper to get the
untranslated "reg" address value.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Link: https://lore.kernel.org/r/20230609183159.1766429-1-robh@kernel.org
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
</content>
</entry>
<entry>
<title>mfd: core: Remove .enable() and .disable() callbacks</title>
<updated>2023-04-26T10:40:29+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-03-08T09:12:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a0b9becad8a7d62a81530035a69f744c0e389737'/>
<id>urn:sha1:a0b9becad8a7d62a81530035a69f744c0e389737</id>
<content type='text'>
With commit dd77f5fa97d3 ("mfd: Remove toshiba tmio drivers") the last
mfd driver that implements these callbacks is gone and since commit
652719b1003a ("w1: remove ds1wm driver") the last user is gone. The
corresponding functions mfd_cell_enable() and mfd_cell_disable() are
also unused (since commit 0ca222c81977 ("leds: Remove asic3 driver")).

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Link: https://lore.kernel.org/r/20230308091257.2404932-1-u.kleine-koenig@pengutronix.de
</content>
</entry>
<entry>
<title>mfd: Move from strlcpy with unused retval to strscpy</title>
<updated>2022-09-28T15:17:39+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2022-08-18T21:00:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a32d3995f7bcf04598548778da54d2b6932b6a5'/>
<id>urn:sha1:6a32d3995f7bcf04598548778da54d2b6932b6a5</id>
<content type='text'>
Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Link: https://lore.kernel.org/r/20220818210030.7012-1-wsa+renesas@sang-engineering.com
</content>
</entry>
<entry>
<title>mfd: core: Delete corresponding OF node entries from list on MFD removal</title>
<updated>2022-09-28T15:09:50+00:00</updated>
<author>
<name>Michal Oleszczyk</name>
<email>oleszczyk.m@gmail.com</email>
</author>
<published>2022-08-09T06:03:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8e88c61d6f3432f27a2c6b8bc58ae4fe974f4b6d'/>
<id>urn:sha1:8e88c61d6f3432f27a2c6b8bc58ae4fe974f4b6d</id>
<content type='text'>
When we consider MFD which implements hotplug (e.g. USB hotplug
driver based on product and vendor IDs) functionality it turns out
that its sub-devices are correctly matched with corresponding device
tree nodes only at the first time. When physical device reboots
or is replugged (and MFD driver is disconnected and probed back
again) all sub-devices fails in mfd_add_device() with error
'Failed to locate of_node'.

The reason of that behavior is that when any MFD sub-device is
created for the first time (and matched with device tree node) it
is added to the mfd_of_node_list. It looks like this list is never
cleaned even if devices added there are intentionally removed from
the system. So when MFD device is replugged and all sub-devices
are matched with their device tree nodes again they fail as matched
nodes already exist in mfd_of_node_list. In other words current
implementation does not support MFD with hotplug feature.

This commit extends MFD core for hotplugging support by removing
appropriate OF node entry from mfd_of_node_list when corresponding
device is removed from the system. Thanks to that when device is
added once again it can be matched with its device tree node
successfully.

Signed-off-by: Michal Oleszczyk &lt;oleszczyk.m@gmail.com&gt;
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Link: https://lore.kernel.org/r/20220809060336.31892-1-m.oleszczyk@grinn-global.com
</content>
</entry>
<entry>
<title>mfd: core: Use acpi_dev_for_each_child()</title>
<updated>2022-06-27T11:22:06+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-06-13T18:31:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0c9b9c2ac0df57b6b5949a51c45043b345698428'/>
<id>urn:sha1:0c9b9c2ac0df57b6b5949a51c45043b345698428</id>
<content type='text'>
Instead of walking the list of children of an ACPI device directly,
use acpi_dev_for_each_child() to carry out an action for all of
the given ACPI device's children.

This will help to eliminate the children list head from struct
acpi_device as it is redundant and it is used in questionable ways
in some places (in particular, locking is needed for walking the
list pointed to it safely, but it is often missing).

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/2726954.BEx9A2HvPv@kreacher
</content>
</entry>
<entry>
<title>mfd: core: Add missing of_node_put for loop iteration</title>
<updated>2021-11-05T14:40:25+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@canonical.com</email>
</author>
<published>2021-05-28T11:51:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=002be81140075e17a1ebd5c3c55e356fbab0ddad'/>
<id>urn:sha1:002be81140075e17a1ebd5c3c55e356fbab0ddad</id>
<content type='text'>
Early exits from for_each_child_of_node() should decrement the
node reference counter.  Reported by Coccinelle:

  drivers/mfd/mfd-core.c:197:2-24: WARNING:
    Function "for_each_child_of_node" should have of_node_put() before goto around lines 209.

Fixes: c94bb233a9fe ("mfd: Make MFD core code Device Tree and IRQ domain aware")
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20210528115126.18370-1-krzysztof.kozlowski@canonical.com
</content>
</entry>
<entry>
<title>mfd: Remove software node conditionally and locate at right place</title>
<updated>2021-06-02T09:50:00+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2021-05-10T14:15:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5a23e8b0fd6010e25ae58362292235cc9213ca57'/>
<id>urn:sha1:5a23e8b0fd6010e25ae58362292235cc9213ca57</id>
<content type='text'>
Currently the software node is removed in error case and at -&gt;remove()
stage unconditionally, that ruins the symmetry. Besides, in some cases,
when mfd_add_device() fails, the device_remove_software_node() call
may lead to NULL pointer dereference:

  BUG: kernel NULL pointer dereference, address: 00000000
  ...
  EIP: strlen+0x12/0x20
  ...
  kernfs_name_hash+0x13/0x70
  kernfs_find_ns+0x32/0xc0
  kernfs_remove_by_name_ns+0x2a/0x90
  sysfs_remove_link+0x16/0x30
  software_node_notify.cold+0x34/0x6b
  device_remove_software_node+0x5a/0x90
  mfd_add_device.cold+0x30a/0x427

Fix all these by guarding device_remove_software_node() with a conditional
and locating it at the right place.

Fixes: 42e59982917a ("mfd: core: Add support for software nodes")
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: core: Use acpi_find_child_device() for child devices lookup</title>
<updated>2021-04-14T15:06:36+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2021-04-06T12:32:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=40cb71f321dd753afa65cf9d90fb803f13b82df0'/>
<id>urn:sha1:40cb71f321dd753afa65cf9d90fb803f13b82df0</id>
<content type='text'>
Use acpi_find_child_device() for child devices lookup in mfd_acpi_add_device()
instead of open coded approach. No functional change intended.

While at it, amend a note comment, since usage of _ADR is found on other
platforms and tables than Intel Galileo Gen 2, in particular USB wired devices
are using it, according to Microsoft specifications for embedded platforms.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
</feed>
