]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.5-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2020 09:17:25 +0000 (10:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2020 09:17:25 +0000 (10:17 +0100)
added patches:
driver-core-add-dev_has_sync_state.patch
driver-core-skip-unnecessary-work-when-device-doesn-t-have-sync_state.patch

queue-5.4/series [new file with mode: 0644]
queue-5.5/driver-core-add-dev_has_sync_state.patch [new file with mode: 0644]
queue-5.5/driver-core-skip-unnecessary-work-when-device-doesn-t-have-sync_state.patch [new file with mode: 0644]
queue-5.5/series [new file with mode: 0644]

diff --git a/queue-5.4/series b/queue-5.4/series
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/queue-5.5/driver-core-add-dev_has_sync_state.patch b/queue-5.5/driver-core-add-dev_has_sync_state.patch
new file mode 100644 (file)
index 0000000..06c64a0
--- /dev/null
@@ -0,0 +1,41 @@
+From ac338acf514e7b578fa9e3742ec2c292323b4c1a Mon Sep 17 00:00:00 2001
+From: Saravana Kannan <saravanak@google.com>
+Date: Fri, 21 Feb 2020 00:05:09 -0800
+Subject: driver core: Add dev_has_sync_state()
+
+From: Saravana Kannan <saravanak@google.com>
+
+commit ac338acf514e7b578fa9e3742ec2c292323b4c1a upstream.
+
+Add an API to check if a device has sync_state support in its driver or
+bus.
+
+Signed-off-by: Saravana Kannan <saravanak@google.com>
+Link: https://lore.kernel.org/r/20200221080510.197337-3-saravanak@google.com
+Cc: Davide Caratti <dcaratti@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/device.h |   11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/include/linux/device.h
++++ b/include/linux/device.h
+@@ -797,6 +797,17 @@ extern void class_destroy(struct class *
+       __class_create(owner, name, &__key);    \
+ })
++static inline bool dev_has_sync_state(struct device *dev)
++{
++      if (!dev)
++              return false;
++      if (dev->driver && dev->driver->sync_state)
++              return true;
++      if (dev->bus && dev->bus->sync_state)
++              return true;
++      return false;
++}
++
+ /*
+  * The type of device, "struct device" is embedded in. A class
+  * or bus can contain devices of different types
diff --git a/queue-5.5/driver-core-skip-unnecessary-work-when-device-doesn-t-have-sync_state.patch b/queue-5.5/driver-core-skip-unnecessary-work-when-device-doesn-t-have-sync_state.patch
new file mode 100644 (file)
index 0000000..ad88a6b
--- /dev/null
@@ -0,0 +1,41 @@
+From 77036165d8bcf7c7b2a2df28a601ec2c52bb172d Mon Sep 17 00:00:00 2001
+From: Saravana Kannan <saravanak@google.com>
+Date: Fri, 21 Feb 2020 00:05:10 -0800
+Subject: driver core: Skip unnecessary work when device doesn't have sync_state()
+
+From: Saravana Kannan <saravanak@google.com>
+
+commit 77036165d8bcf7c7b2a2df28a601ec2c52bb172d upstream.
+
+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 <saravanak@google.com>
+Link: https://lore.kernel.org/r/20200221080510.197337-4-saravanak@google.com
+Cc: Davide Caratti <dcaratti@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/base/core.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/base/core.c
++++ b/drivers/base/core.c
+@@ -718,6 +718,8 @@ static void __device_links_queue_sync_st
+ {
+       struct device_link *link;
++      if (!dev_has_sync_state(dev))
++              return;
+       if (dev->state_synced)
+               return;
+@@ -819,7 +821,7 @@ late_initcall(sync_state_resume_initcall
+ static void __device_links_supplier_defer_sync(struct device *sup)
+ {
+-      if (list_empty(&sup->links.defer_sync))
++      if (list_empty(&sup->links.defer_sync) && dev_has_sync_state(sup))
+               list_add_tail(&sup->links.defer_sync, &deferred_sync);
+ }
diff --git a/queue-5.5/series b/queue-5.5/series
new file mode 100644 (file)
index 0000000..fa0301d
--- /dev/null
@@ -0,0 +1,2 @@
+driver-core-add-dev_has_sync_state.patch
+driver-core-skip-unnecessary-work-when-device-doesn-t-have-sync_state.patch