<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mfd/mfd-core.c, branch linux-6.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-09-28T15:17:39Z</updated>
<entry>
<title>mfd: Move from strlcpy with unused retval to strscpy</title>
<updated>2022-09-28T15:17:39Z</updated>
<author>
<name>Wolfram Sang</name>
</author>
<published>2022-08-18T21:00:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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:50Z</updated>
<author>
<name>Michal Oleszczyk</name>
</author>
<published>2022-08-09T06:03:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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:06Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2022-06-13T18:31:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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:25Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-05-28T11:51:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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:00Z</updated>
<author>
<name>Andy Shevchenko</name>
</author>
<published>2021-05-10T14:15:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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:36Z</updated>
<author>
<name>Andy Shevchenko</name>
</author>
<published>2021-04-06T12:32:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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>
<entry>
<title>mfd: core: Remove support for dangling device properties</title>
<updated>2021-04-14T15:06:14Z</updated>
<author>
<name>Heikki Krogerus</name>
</author>
<published>2021-03-01T14:42:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b4a66acc0997cff7cb9a4c3992e97808700aa1ff'/>
<id>urn:sha1:b4a66acc0997cff7cb9a4c3992e97808700aa1ff</id>
<content type='text'>
From now on only accepting complete software nodes.

Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
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: Add support for software nodes</title>
<updated>2021-04-14T15:06:07Z</updated>
<author>
<name>Heikki Krogerus</name>
</author>
<published>2021-03-01T14:42:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=42e59982917a25ad254b74e6e8decee5e684763d'/>
<id>urn:sha1:42e59982917a25ad254b74e6e8decee5e684763d</id>
<content type='text'>
The old device property API is going to be removed and
replaced with the newer software node API. This prepares MFD
subsystem for the transition.

Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
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: mfd-core: Ensure disabled devices are ignored without error</title>
<updated>2020-08-28T08:51:41Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2020-08-19T08:16:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22380b65dc70f5b132c5afdf6b4011e2a84ec34a'/>
<id>urn:sha1:22380b65dc70f5b132c5afdf6b4011e2a84ec34a</id>
<content type='text'>
Commit e49aa9a9bd22 ("mfd: core: Make a best effort attempt to match
devices with the correct of_nodes") changed the semantics for disabled
devices in mfd_add_device().  Instead of silently ignoring a disabled
child device, an error was returned.  On receipt of the error
mfd_add_devices() the precedes to remove *all* child devices and
returns an all-failed error to the caller, which will inevitably fail
the parent device as well.

This patch reverts back to the old semantics and ignores child devices
which are disabled in Device Tree.

Fixes: e49aa9a9bd22 ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
Reported-by: Icenowy Zheng &lt;icenowy@aosc.io&gt;
Tested-by: Icenowy Zheng &lt;icenowy@aosc.io&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: core: Fix double-free in mfd_remove_devices_fn()</title>
<updated>2020-08-24T13:23:55Z</updated>
<author>
<name>Dmitry Osipenko</name>
</author>
<published>2020-08-17T23:50:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b6cf2b5debd42de39afd8ac84b60faeca62cfaf'/>
<id>urn:sha1:6b6cf2b5debd42de39afd8ac84b60faeca62cfaf</id>
<content type='text'>
The pdev.mfd_cell is released by platform_device_release(), which is
invoked by platform_device_unregister(). Hence mfd_remove_devices_fn()
shouldn't release the cell variable. The double-free bug is reported KASAN
during of MFD driver module removal.

Fixes: 466a62d7642f ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
Reported-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
</feed>
