<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/base/component.c, branch v4.19.107</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.107</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.107'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-02-01T09:37:03Z</updated>
<entry>
<title>component: do not dereference opaque pointer in debugfs</title>
<updated>2020-02-01T09:37:03Z</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2019-11-18T11:54:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b7d002c50902fdde05a087fb7c776287be0b86f1'/>
<id>urn:sha1:b7d002c50902fdde05a087fb7c776287be0b86f1</id>
<content type='text'>
commit ef9ffc1e5f1ac73ecd2fb3b70db2a3b2472ff2f7 upstream.

The match data does not have to be a struct device pointer, and indeed
very often is not. Attempt to treat it as such easily results in a
crash.

For the components that are not registered, we don't know which device
is missing. Once it it is there, we can use the struct component to get
the device and whether it's bound or not.

Fixes: 59e73854b5fd ('component: add debugfs support')
Signed-off-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Arnaud Pouliquen &lt;arnaud.pouliquen@st.com&gt;
Link: https://lore.kernel.org/r/20191118115431.63626-1-lkundrak@v3.sk
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>component: fix loop condition to call unbind() if bind() fails</title>
<updated>2019-11-20T17:46:47Z</updated>
<author>
<name>Banajit Goswami</name>
<email>bgoswami@codeaurora.org</email>
</author>
<published>2018-08-28T04:15:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5fba8151069702486138d05cd96c1713f1720343'/>
<id>urn:sha1:5fba8151069702486138d05cd96c1713f1720343</id>
<content type='text'>
[ Upstream commit bdae566d5d9733b6e32b378668b84eadf28a94d4 ]

During component_bind_all(), if bind() fails for any
particular component associated with a master, unbind()
should be called for all previous components in that
master's match array, whose bind() might have completed
successfully. As per the current logic, if bind() fails
for the component at position 'n' in the master's match
array, it would start calling unbind() from component in
'n'th position itself and work backwards, and will always
skip calling unbind() for component in 0th position in the
master's match array.
Fix this by updating the loop condition, and the logic to
refer to the components in master's match array, so that
unbind() is called for all components starting from 'n-1'st
position in the array, until (and including) component in
0th position.

Signed-off-by: Banajit Goswami &lt;bgoswami@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>component: add debugfs support</title>
<updated>2017-12-18T15:51:11Z</updated>
<author>
<name>Maciej Purski</name>
<email>m.purski@samsung.com</email>
</author>
<published>2017-12-01T13:23:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=59e73854b5fd1213fe90ae993d98c759786c3712'/>
<id>urn:sha1:59e73854b5fd1213fe90ae993d98c759786c3712</id>
<content type='text'>
Currently there is no information in any vfs about which devices
a master component consists of, what makes debugging hard if
one of the component devices fails to register.

Add 'device_component' directory to debugfs. Create a new file for each
component master, when it has been added. Remove it on a master
deletion. Show a list of devices required by the given master and their
status (registered or not). This provides an easy way to check, which
device has failed to register if the given master device is not
available in the system.

Signed-off-by: Maciej Purski &lt;m.purski@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Remove redundant license text</title>
<updated>2017-12-07T17:36:44Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-07T16:30:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=328257099077e8affd438c179d8a938948de2e7f'/>
<id>urn:sha1:328257099077e8affd438c179d8a938948de2e7f</id>
<content type='text'>
Now that the SPDX tag is in all driver core files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: "Luis R. Rodriguez" &lt;mcgrof@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: add SPDX identifiers to all driver core files</title>
<updated>2017-12-07T17:36:43Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-07T16:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=989d42e85dc2f6823f39b8e9d080fd04bae0645d'/>
<id>urn:sha1:989d42e85dc2f6823f39b8e9d080fd04bae0645d</id>
<content type='text'>
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the driver core files files with the correct SPDX license
identifier based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: "Luis R. Rodriguez" &lt;mcgrof@kernel.org&gt;
Cc: William Breathitt Gray &lt;vilhelm.gray@gmail.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Cc: Philippe Ombredanne &lt;pombredanne@nexb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 4.5-rc4 into driver-core-next</title>
<updated>2016-02-14T22:29:55Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-02-14T22:29:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c21b04f9890ce35bfbb4f5ee1937017613f66017'/>
<id>urn:sha1:c21b04f9890ce35bfbb4f5ee1937017613f66017</id>
<content type='text'>
We want the fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: remove device from master match list on failed add</title>
<updated>2016-02-11T09:42:09Z</updated>
<author>
<name>Daniel Stone</name>
<email>daniels@collabora.com</email>
</author>
<published>2016-02-08T21:12:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8e7199c2c50fff1969302643171eaa33f1ca148f'/>
<id>urn:sha1:8e7199c2c50fff1969302643171eaa33f1ca148f</id>
<content type='text'>
Calling component_add() may result in the completion of a set of
devices, which will try to bring up a master. In bringing the master
up, we populate its match array with the current set of children.

If binding any of the devices fails, component_add() itself will fail,
free the struct component entry, and return to the caller. The
now-freed entry is never removed from the master's match array, and
will later be used in a futile attempt to bind to freed memory.

Bring component_add's behaviour on failure to bring up a master into
line with component_del by removing the (to-be-freed) component from
the master's match array.

The specific case which broke was:
  - rockchip_drm_drv adds a component master
  - dwhdmi_rockchip adds a child component in probe (master incomplete)
  - rockchip_drm_vop adds two children in probe, which completes the
    set
  - inside component_add, we try to bring up the master, having
    populated the master's match array, and fail with EPROBE_DEFER from
    dwhdmi_rockchip; we delete the putative component
  - rockchip_drm_vop's probe fails and returns EPROBE_DEFER
  - we later re-probe rockchip_drm_vop and add the component; the
    master is complete, so we attempt to bring it up again
  - walking the match array, we find the previous child, whose master
    pointer doesn't match (as it has been freed in the meantime)
  - rockchip_drm_vop probe fails, and will never be attempted again

Fixes: ffc30b74fd6d01588bd3fdebc3b1acc0857e6fc8
Signed-off-by: Daniel Stone &lt;daniels@collabora.com&gt;
Cc: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Thierry Reding &lt;treding@nvidia.com&gt;
Cc: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>component: remove impossible condition</title>
<updated>2016-02-10T01:39:33Z</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-02T07:27:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4877bb91786e41426bcbec0e151c048a9bd8a1ce'/>
<id>urn:sha1:4877bb91786e41426bcbec0e151c048a9bd8a1ce</id>
<content type='text'>
We will be evaluating this condition only if match-&gt;num == match-&gt;alloc
and that means we have already dereferenced match which implies match
can not be NULL at this point.
Moreover we have done a NULL check on match just before this.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>component: Detach components when deleting master struct</title>
<updated>2016-01-27T19:07:51Z</updated>
<author>
<name>Jon Medhurst (Tixy)</name>
<email>tixy@linaro.org</email>
</author>
<published>2016-01-26T17:59:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=57480484f9f7631738ef28b952eca3c9081c4291'/>
<id>urn:sha1:57480484f9f7631738ef28b952eca3c9081c4291</id>
<content type='text'>
component_master_add_with_match calls find_components which, if any
components already exist, it attaches to the master struct. However, if
we later encounter an error the master struct is deleted, leaving
components with a dangling pointer to it.

If the error was a temporary one, e.g. for probe deferral, then when
the master device is re-probed, it will fail to find the required
components as they appear to already be attached to a master.

Fix this by nulling components pointers to the master struct when it is
deleted. This code is factored out into a separate function so it can be
shared with component_master_del.

Signed-off-by: Jon Medhurst &lt;tixy@linaro.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>component: fix crash on x86_64 with hda audio drivers</title>
<updated>2016-01-26T18:13:33Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2016-01-26T14:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9a4e7849b5e4e8742d71fa90fbf0722dd0710a56'/>
<id>urn:sha1:9a4e7849b5e4e8742d71fa90fbf0722dd0710a56</id>
<content type='text'>
Maarten reports that the addition of releasing match data to the
component helper results in a general protection fault on x86_64.

This is caused by the devm resources being freed in reverse order
to their allocation, which caused a use-after-free of the match
array.

Switch the match array to be a more conventional kmalloc/kfree()
affair, explicitly freeing it along with the parent match data
structure.

Reported-by: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Fixes: ce657b1cddf1 ("component: add support for releasing match data")
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
