<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/device, branch v5.10.204</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.204</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.204'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2023-11-08T16:30:47Z</updated>
<entry>
<title>driver: platform: Add helper for safer setting of driver_override</title>
<updated>2023-11-08T16:30:47Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2023-10-31T11:33:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da369d3996ccd4ba6efaf73525789e70bd032168'/>
<id>urn:sha1:da369d3996ccd4ba6efaf73525789e70bd032168</id>
<content type='text'>
commit 6c2f421174273de8f83cde4286d1c076d43a2d35 upstream.

Several core drivers and buses expect that driver_override is a
dynamically allocated memory thus later they can kfree() it.

However such assumption is not documented, there were in the past and
there are already users setting it to a string literal. This leads to
kfree() of static memory during device release (e.g. in error paths or
during unbind):

    kernel BUG at ../mm/slub.c:3960!
    Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
    ...
    (kfree) from [&lt;c058da50&gt;] (platform_device_release+0x88/0xb4)
    (platform_device_release) from [&lt;c0585be0&gt;] (device_release+0x2c/0x90)
    (device_release) from [&lt;c0a69050&gt;] (kobject_put+0xec/0x20c)
    (kobject_put) from [&lt;c0f2f120&gt;] (exynos5_clk_probe+0x154/0x18c)
    (exynos5_clk_probe) from [&lt;c058de70&gt;] (platform_drv_probe+0x6c/0xa4)
    (platform_drv_probe) from [&lt;c058b7ac&gt;] (really_probe+0x280/0x414)
    (really_probe) from [&lt;c058baf4&gt;] (driver_probe_device+0x78/0x1c4)
    (driver_probe_device) from [&lt;c0589854&gt;] (bus_for_each_drv+0x74/0xb8)
    (bus_for_each_drv) from [&lt;c058b48c&gt;] (__device_attach+0xd4/0x16c)
    (__device_attach) from [&lt;c058a638&gt;] (bus_probe_device+0x88/0x90)
    (bus_probe_device) from [&lt;c05871fc&gt;] (device_add+0x3dc/0x62c)
    (device_add) from [&lt;c075ff10&gt;] (of_platform_device_create_pdata+0x94/0xbc)
    (of_platform_device_create_pdata) from [&lt;c07600ec&gt;] (of_platform_bus_create+0x1a8/0x4fc)
    (of_platform_bus_create) from [&lt;c0760150&gt;] (of_platform_bus_create+0x20c/0x4fc)
    (of_platform_bus_create) from [&lt;c07605f0&gt;] (of_platform_populate+0x84/0x118)
    (of_platform_populate) from [&lt;c0f3c964&gt;] (of_platform_default_populate_init+0xa0/0xb8)
    (of_platform_default_populate_init) from [&lt;c01031f8&gt;] (do_one_initcall+0x8c/0x404)

Provide a helper which clearly documents the usage of driver_override.
This will allow later to reuse the helper and reduce the amount of
duplicated code.

Convert the platform driver to use a new helper and make the
driver_override field const char (it is not modified by the core).

Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20220419113435.246203-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Rename deferred_probe_timeout and make it global</title>
<updated>2020-03-04T17:11:44Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2020-02-25T05:08:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=64c775fb4b21ab2532555e833edf52055df5fb1c'/>
<id>urn:sha1:64c775fb4b21ab2532555e833edf52055df5fb1c</id>
<content type='text'>
Since other subsystems (like regulator) have similar arbitrary
timeouts for how long they try to resolve driver dependencies,
rename deferred_probe_timeout to driver_deferred_probe_timeout
and set it as global, so it can be shared.

Cc: linux-pm@vger.kernel.org
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Thierry Reding &lt;treding@nvidia.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Cc: Todd Kjos &lt;tkjos@google.com&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Cc: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Kevin Hilman &lt;khilman@kernel.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@rjwysocki.net&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Link: https://lore.kernel.org/r/20200225050828.56458-6-john.stultz@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Remove driver_deferred_probe_check_state_continue()</title>
<updated>2020-03-04T17:11:44Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2020-02-25T05:08:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0e9f8d09d2806aa2e10a04a78f82544e4ee737a1'/>
<id>urn:sha1:0e9f8d09d2806aa2e10a04a78f82544e4ee737a1</id>
<content type='text'>
Now that driver_deferred_probe_check_state() works better, and
we've converted the only user of
driver_deferred_probe_check_state_continue() we can simply
remove it and simplify some of the logic.

Cc: linux-pm@vger.kernel.org
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Thierry Reding &lt;treding@nvidia.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Cc: Todd Kjos &lt;tkjos@google.com&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Cc: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Kevin Hilman &lt;khilman@kernel.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@rjwysocki.net&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Link: https://lore.kernel.org/r/20200225050828.56458-5-john.stultz@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>device.h: move 'struct driver' stuff out to device/driver.h</title>
<updated>2019-12-16T09:11:16Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-12-09T19:33:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4c002c978b7f2f2306d53de051c054504af920a9'/>
<id>urn:sha1:4c002c978b7f2f2306d53de051c054504af920a9</id>
<content type='text'>
device.h has everything and the kitchen sink when it comes to struct
device things, so split out the struct driver things things to a
separate .h file to make things easier to maintain and manage over time.

Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Cc: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20191209193303.1694546-7-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>device.h: move 'struct class' stuff out to device/class.h</title>
<updated>2019-12-16T09:11:14Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-12-09T19:33:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a8ae608529ab1b71a3830895f98a107be90fed48'/>
<id>urn:sha1:a8ae608529ab1b71a3830895f98a107be90fed48</id>
<content type='text'>
device.h has everything and the kitchen sink when it comes to struct
device things, so split out the struct class things things to a separate
.h file to make things easier to maintain and manage over time.

Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Cc: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20191209193303.1694546-6-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>device.h: move 'struct bus' stuff out to device/bus.h</title>
<updated>2019-12-16T09:11:12Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-12-09T19:33:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5aee2bf2629d7db2619110f62b15cf742c116e0b'/>
<id>urn:sha1:5aee2bf2629d7db2619110f62b15cf742c116e0b</id>
<content type='text'>
device.h has everything and the kitchen sink when it comes to struct
device things, so split out the struct bus things things to a separate
.h file to make things easier to maintain and manage over time.

Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Cc: Saravana Kannan &lt;saravanak@google.com&gt;
Cc: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20191209193303.1694546-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
