<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/core.c, branch v5.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-03-04T12:46:03Z</updated>
<entry>
<title>driver core: Skip unnecessary work when device doesn't have sync_state()</title>
<updated>2020-03-04T12:46:03Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2020-02-21T08:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77036165d8bcf7c7b2a2df28a601ec2c52bb172d'/>
<id>urn:sha1:77036165d8bcf7c7b2a2df28a601ec2c52bb172d</id>
<content type='text'>
A bunch of busy work is done for devices that don't have sync_state()
support. Stop doing the busy work.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20200221080510.197337-4-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Call sync_state() even if supplier has no consumers</title>
<updated>2020-03-04T12:46:03Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2020-02-21T08:05:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=21eb93f432b1a785df193df1a56a59e9eb3a985f'/>
<id>urn:sha1:21eb93f432b1a785df193df1a56a59e9eb3a985f</id>
<content type='text'>
The initial patch that added sync_state() support didn't handle the case
where a supplier has no consumers. This was because when a device is
successfully bound with a driver, only its suppliers were checked to see
if they are eligible to get a sync_state(). This is not sufficient for
devices that have no consumers but still need to do device state clean
up. So fix this.

Fixes: fc5a251d0fd7ca90 (driver core: Add sync_state driver/bus callback)
Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200221080510.197337-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Allow device link operations inside sync_state()</title>
<updated>2019-11-15T02:06:54Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2019-11-14T22:56:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=26e77708fdc20ec6c24759602640ac42b8e4e88a'/>
<id>urn:sha1:26e77708fdc20ec6c24759602640ac42b8e4e88a</id>
<content type='text'>
Some sync_state() implementations might need to call APIs that in turn
make calls to device link APIs. So, do the sync_state() callbacks
without holding the device link lock.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Link: https://lore.kernel.org/r/20191114225646.251277-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Allow fwnode_operations.add_links to differentiate errors</title>
<updated>2019-11-02T17:05:18Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2019-10-28T22:00:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=03324507e66c7664c754b1ef92c5c3be24c78aa2'/>
<id>urn:sha1:03324507e66c7664c754b1ef92c5c3be24c78aa2</id>
<content type='text'>
When add_links() still has suppliers that it needs to link to in the
future, this patch allows it to differentiate between suppliers that are
needed for probing vs suppliers that are needed for sync_state()
correctness.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20191028220027.251605-4-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Allow a device to wait on optional suppliers</title>
<updated>2019-11-02T17:05:17Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2019-10-28T22:00:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bcbbcfd57247f4c2976055995e5760fb576aae1e'/>
<id>urn:sha1:bcbbcfd57247f4c2976055995e5760fb576aae1e</id>
<content type='text'>
Before this change, if a device is waiting on suppliers, it's assumed
that all those suppliers are needed for the device to probe
successfully. This change allows marking a devices as waiting only on
optional suppliers. This allows a device to wait on suppliers (and link
to them as soon as they are available) without preventing the device
from being probed.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20191028220027.251605-3-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Add device link support for SYNC_STATE_ONLY flag</title>
<updated>2019-11-02T17:05:17Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2019-10-28T22:00:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05ef983e0d65a31b370a4e1b93c1efd490ae778f'/>
<id>urn:sha1:05ef983e0d65a31b370a4e1b93c1efd490ae778f</id>
<content type='text'>
Parent devices might need to create "proxy" device links from themselves
to supplier devices to make sure the supplier devices don't get a
sync_state() before the child consumer devices get a chance to add
device links to the supplier devices.

However, the parent device has no real dependency on the supplier device
and probing, suspend/resume or runtime PM don't need to be affected by
the supplier device.  To capture these cases, create a SYNC_STATE_ONLY
device link flag that only affects sync_state() behavior and doesn't
affect probing, suspend/resume or runtime PM.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20191028220027.251605-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 5.4-rc5 into driver-core-next</title>
<updated>2019-10-27T17:54:13Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-10-27T17:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8f677bc819e7a74cf10e30daf06e8b151d1e6a94'/>
<id>urn:sha1:8f677bc819e7a74cf10e30daf06e8b151d1e6a94</id>
<content type='text'>
We want the sysfs fix in here as well to build on top of.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: Avoid cpufreq_suspend() deadlock on system shutdown</title>
<updated>2019-10-10T09:11:17Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2019-10-08T23:29:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=65650b35133ff20f0c9ef0abd5c3c66dbce3ae57'/>
<id>urn:sha1:65650b35133ff20f0c9ef0abd5c3c66dbce3ae57</id>
<content type='text'>
It is incorrect to set the cpufreq syscore shutdown callback pointer
to cpufreq_suspend(), because that function cannot be run in the
syscore stage of system shutdown for two reasons: (a) it may attempt
to carry out actions depending on devices that have already been shut
down at that point and (b) the RCU synchronization carried out by it
may not be able to make progress then.

The latter issue has been present since commit 45975c7d21a1 ("rcu:
Define RCU-sched API in terms of RCU for Tree RCU PREEMPT builds"),
but the former one has been there since commit 90de2a4aa9f3 ("cpufreq:
suspend cpufreq governors on shutdown") regardless.

Fix that by dropping cpufreq_syscore_ops altogether and making
device_shutdown() call cpufreq_suspend() directly before shutting
down devices, which is along the lines of what system-wide power
management does.

Fixes: 45975c7d21a1 ("rcu: Define RCU-sched API in terms of RCU for Tree RCU PREEMPT builds")
Fixes: 90de2a4aa9f3 ("cpufreq: suspend cpufreq governors on shutdown")
Reported-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Tested-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 4.0+ &lt;stable@vger.kernel.org&gt; # 4.0+
</content>
</entry>
<entry>
<title>driver core: Add sync_state driver/bus callback</title>
<updated>2019-10-04T15:30:19Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2019-09-04T21:11:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fc5a251d0fd7ca9038bab78a8c97932c8c6ca23b'/>
<id>urn:sha1:fc5a251d0fd7ca9038bab78a8c97932c8c6ca23b</id>
<content type='text'>
This sync_state driver/bus callback is called once all the consumers
of a supplier have probed successfully.

This allows the supplier device's driver/bus to sync the supplier
device's state to the software state with the guarantee that all the
consumers are actively managing the resources provided by the supplier
device.

To maintain backwards compatibility and ease transition from existing
frameworks and resource cleanup schemes, late_initcall_sync is the
earliest when the sync_state callback might be called.

There is no upper bound on the time by which the sync_state callback
has to be called. This is because if a consumer device never probes,
the supplier has to maintain its resources in the state left by the
bootloader. For example, if the bootloader leaves the display
backlight at a fixed voltage and the backlight driver is never probed,
you don't want the backlight to ever be turned off after boot up.

Also, when multiple devices are added after kernel init, some
suppliers could be added before their consumer devices get added. In
these instances, the supplier devices could get their sync_state
callback called right after they probe because the consumers devices
haven't had a chance to create device links to the suppliers.

To handle this correctly, this change also provides APIs to
pause/resume sync state callbacks so that when multiple devices are
added, their sync_state callback evaluation can be postponed to happen
after all of them are added.

kbuild test robot reported missing documentation for device.state_synced
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20190904211126.47518-5-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Add support for linking devices during device addition</title>
<updated>2019-10-04T15:29:50Z</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2019-09-04T21:11:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2ae9bcc4aaacda04edb75c4eea93384719efaa5'/>
<id>urn:sha1:e2ae9bcc4aaacda04edb75c4eea93384719efaa5</id>
<content type='text'>
The firmware corresponding to a device (dev.fwnode) might be able to
provide functional dependency information between a device and its
supplier and consumer devices.  Tracking this functional dependency
allows optimizing device probe order and informing a supplier when all
its consumers have probed (and thereby actively managing their
resources).

The existing device links feature allows tracking and using
supplier-consumer relationships. So, this patch adds the add_links()
fwnode callback to allow firmware to create device links for each
device as the device is added.

However, when consumer devices are added, they might not have a supplier
device to link to despite needing mandatory resources/functionality from
one or more suppliers. A waiting_for_suppliers list is created to track
such consumers and retry linking them when new devices get added.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20190904211126.47518-3-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
