From: Greg Kroah-Hartman Date: Wed, 25 Mar 2020 09:17:25 +0000 (+0100) Subject: 5.5-stable patches X-Git-Tag: v5.5.13~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e4ece9679b0cd62cedeba6ff86f52b2ff2a2fd6;p=thirdparty%2Fkernel%2Fstable-queue.git 5.5-stable patches added patches: driver-core-add-dev_has_sync_state.patch driver-core-skip-unnecessary-work-when-device-doesn-t-have-sync_state.patch --- diff --git a/queue-5.4/series b/queue-5.4/series new file mode 100644 index 00000000000..e69de29bb2d 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 index 00000000000..06c64a099ae --- /dev/null +++ b/queue-5.5/driver-core-add-dev_has_sync_state.patch @@ -0,0 +1,41 @@ +From ac338acf514e7b578fa9e3742ec2c292323b4c1a Mon Sep 17 00:00:00 2001 +From: Saravana Kannan +Date: Fri, 21 Feb 2020 00:05:09 -0800 +Subject: driver core: Add dev_has_sync_state() + +From: Saravana Kannan + +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 +Link: https://lore.kernel.org/r/20200221080510.197337-3-saravanak@google.com +Cc: Davide Caratti +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..ad88a6b951e --- /dev/null +++ b/queue-5.5/driver-core-skip-unnecessary-work-when-device-doesn-t-have-sync_state.patch @@ -0,0 +1,41 @@ +From 77036165d8bcf7c7b2a2df28a601ec2c52bb172d Mon Sep 17 00:00:00 2001 +From: Saravana Kannan +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 + +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 +Link: https://lore.kernel.org/r/20200221080510.197337-4-saravanak@google.com +Cc: Davide Caratti +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..fa0301d05da --- /dev/null +++ b/queue-5.5/series @@ -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