<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/base/component.c, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-02-08T12:33:10+00:00</updated>
<entry>
<title>drivers: base: component: fix memory leak with using debugfs_lookup()</title>
<updated>2023-02-08T12:33:10+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-02-02T14:16:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8deb87b1e810dd558371e88ffd44339fbef27870'/>
<id>urn:sha1:8deb87b1e810dd558371e88ffd44339fbef27870</id>
<content type='text'>
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time.  To make things simpler, just
call debugfs_lookup_and_remove() instead which handles all of the logic
at once.

Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Link: https://lore.kernel.org/r/20230202141621.2296458-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: Add common helper for compare/release functions</title>
<updated>2022-02-25T11:16:12+00:00</updated>
<author>
<name>Yong Wu</name>
<email>yong.wu@mediatek.com</email>
</author>
<published>2022-02-14T06:07:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2502960fba7e94e090112069694365295c32ccc5'/>
<id>urn:sha1:2502960fba7e94e090112069694365295c32ccc5</id>
<content type='text'>
The component requires the compare/release functions, there are so many
copies in current kernel. Just define four common helpers for them.

Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Signed-off-by: Yong Wu &lt;yong.wu@mediatek.com&gt;
Link: https://lore.kernel.org/r/20220214060819.7334-2-yong.wu@mediatek.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: Replace most references to 'master' with 'aggregate device'</title>
<updated>2022-01-31T13:45:35+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2022-01-27T20:01:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=13e906e50a8cf6033f22c03c4d772e36a9e02c6b'/>
<id>urn:sha1:13e906e50a8cf6033f22c03c4d772e36a9e02c6b</id>
<content type='text'>
Remove most references to 'master' in the code and replace them with
some form of 'aggregate device'. This better reflects the reality of
what this code does, i.e. an aggregate device that represents a
device like a GPU card once some set of devices that make up the
aggregate device probe and register with the component framework.

Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Link: https://lore.kernel.org/r/20220127200141.1295328-2-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: do not leave master devres group open after bind</title>
<updated>2021-10-21T11:01:56+00:00</updated>
<author>
<name>Kai Vehmanen</name>
<email>kai.vehmanen@linux.intel.com</email>
</author>
<published>2021-10-13T16:13:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c87761db2100677a69be551365105125d872af5b'/>
<id>urn:sha1:c87761db2100677a69be551365105125d872af5b</id>
<content type='text'>
In current code, the devres group for aggregate master is left open
after call to component_master_add_*(). This leads to problems when the
master does further managed allocations on its own. When any
participating driver calls component_del(), this leads to immediate
release of resources.

This came up when investigating a page fault occurring with i915 DRM
driver unbind with 5.15-rc1 kernel. The following sequence occurs:

 i915_pci_remove()
   -&gt; intel_display_driver_unregister()
     -&gt; i915_audio_component_cleanup()
       -&gt; component_del()
         -&gt; component.c:take_down_master()
           -&gt; hdac_component_master_unbind() [via master-&gt;ops-&gt;unbind()]
           -&gt; devres_release_group(master-&gt;parent, NULL)

With older kernels this has not caused issues, but with audio driver
moving to use managed interfaces for more of its allocations, this no
longer works. Devres log shows following to occur:

component_master_add_with_match()
[  126.886032] snd_hda_intel 0000:00:1f.3: DEVRES ADD 00000000323ccdc5 devm_component_match_release (24 bytes)
[  126.886045] snd_hda_intel 0000:00:1f.3: DEVRES ADD 00000000865cdb29 grp&lt; (0 bytes)
[  126.886049] snd_hda_intel 0000:00:1f.3: DEVRES ADD 000000001b480725 grp&lt; (0 bytes)

audio driver completes its PCI probe()
[  126.892238] snd_hda_intel 0000:00:1f.3: DEVRES ADD 000000001b480725 pcim_iomap_release (48 bytes)

component_del() called() at DRM/i915 unbind()
[  137.579422] i915 0000:00:02.0: DEVRES REL 00000000ef44c293 grp&lt; (0 bytes)
[  137.579445] snd_hda_intel 0000:00:1f.3: DEVRES REL 00000000865cdb29 grp&lt; (0 bytes)
[  137.579458] snd_hda_intel 0000:00:1f.3: DEVRES REL 000000001b480725 pcim_iomap_release (48 bytes)

So the "devres_release_group(master-&gt;parent, NULL)" ends up freeing the
pcim_iomap allocation. Upon next runtime resume, the audio driver will
cause a page fault as the iomap alloc was released without the driver
knowing about it.

Fix this issue by using the "struct master" pointer as identifier for
the devres group, and by closing the devres group after
the master-&gt;ops-&gt;bind() call is done. This allows devres allocations
done by the driver acting as master to be isolated from the binding state
of the aggregate driver. This modifies the logic originally introduced in
commit 9e1ccb4a7700 ("drivers/base: fix devres handling for master device")

Fixes: 9e1ccb4a7700 ("drivers/base: fix devres handling for master device")
Cc: stable@vger.kernel.org
Acked-by: Imre Deak &lt;imre.deak@intel.com&gt;
Acked-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Kai Vehmanen &lt;kai.vehmanen@linux.intel.com&gt;
BugLink: https://gitlab.freedesktop.org/drm/intel/-/issues/4136
Link: https://lore.kernel.org/r/20211013161345.3755341-1-kai.vehmanen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/base/component.c: remove superfluous header files from component.c</title>
<updated>2021-10-05T14:21:10+00:00</updated>
<author>
<name>Mianhan Liu</name>
<email>liumh1@shanghaitech.edu.cn</email>
</author>
<published>2021-09-28T19:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=30b7ecf731ae800f4231fae8dbf3b47cf3d39142'/>
<id>urn:sha1:30b7ecf731ae800f4231fae8dbf3b47cf3d39142</id>
<content type='text'>
component.c hasn't use any macro or function declared in linux/kref.h.
Thus, these files can be removed from component.c safely without
affecting the compilation of the drivers/base/ module

Signed-off-by: Mianhan Liu &lt;liumh1@shanghaitech.edu.cn&gt;
Link: https://lore.kernel.org/r/20210928193849.28717-1-liumh1@shanghaitech.edu.cn
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: Rename 'dev' to 'parent'</title>
<updated>2021-05-27T13:49:59+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2021-05-20T00:25:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d52ff34ee952b68c6d08eb56f2e99b926188f9e6'/>
<id>urn:sha1:d52ff34ee952b68c6d08eb56f2e99b926188f9e6</id>
<content type='text'>
Let's rename this struct member to 'parent' to better reflect the
reality that it's the parent device of this psuedo-device. In the next
patch we'll put a 'struct device' inside of this struct so moving this
away simplifies that patch by reducing the number of places that 'dev'
is modified.

Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Link: https://lore.kernel.org/r/20210520002519.3538432-3-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: Drop 'dev' argument to component_match_realloc()</title>
<updated>2021-05-27T13:49:32+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2021-05-20T00:25:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=82769cc671b6ddfc87654ff8169efdb3925a621b'/>
<id>urn:sha1:82769cc671b6ddfc87654ff8169efdb3925a621b</id>
<content type='text'>
This argument isn't used. Drop it.

Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Link: https://lore.kernel.org/r/20210520002519.3538432-2-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: component: remove dentry pointer in "struct master"</title>
<updated>2021-03-23T09:49:02+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2021-02-16T14:23:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c654cea59dbc352fceafddd44893f3523fdcc08e'/>
<id>urn:sha1:c654cea59dbc352fceafddd44893f3523fdcc08e</id>
<content type='text'>
There is no need to keep around a pointer to a dentry when all it is
used for is to remove the debugfs file when tearing things down.  As the
name is simple, have debugfs look up the dentry when removing things,
keeping the logic much simpler.

Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Link: https://lore.kernel.org/r/20210216142400.3759099-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: Silence bind error on -EPROBE_DEFER</title>
<updated>2020-04-28T15:54:15+00:00</updated>
<author>
<name>James Hilliard</name>
<email>james.hilliard1@gmail.com</email>
</author>
<published>2020-04-11T19:02:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7706b0a76a9697021e2bf395f3f065c18f51043d'/>
<id>urn:sha1:7706b0a76a9697021e2bf395f3f065c18f51043d</id>
<content type='text'>
If a component fails to bind due to -EPROBE_DEFER we should not log an
error as this is not a real failure.

Fixes messages like:
vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517
vc4-drm soc:gpu: master bind failed: -517

Signed-off-by: James Hilliard &lt;james.hilliard1@gmail.com&gt;
Link: https://lore.kernel.org/r/20200411190241.89404-1-james.hilliard1@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: allow missing unbind callback</title>
<updated>2020-03-18T13:13:33+00:00</updated>
<author>
<name>Marco Felsch</name>
<email>m.felsch@pengutronix.de</email>
</author>
<published>2020-02-27T10:45:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=14422f14da818a3f12344dceee47b4206870a24d'/>
<id>urn:sha1:14422f14da818a3f12344dceee47b4206870a24d</id>
<content type='text'>
The component framework reuses the devres managed functions. There is no
need to specify an unbind() callback if the driver only wants to release
the devres managed resources. The bind/unbind is like the probe/remove
pair. The bind/probe is necessary and the unbind/remove is optional.

Signed-off-by: Marco Felsch &lt;m.felsch@pengutronix.de&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20200227104547.30085-1-m.felsch@pengutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
