All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] driver core: Skip unnecessary work when device doesn't have sync_state()
Date: Fri, 21 Feb 2020 00:05:10 -0800	[thread overview]
Message-ID: <20200221080510.197337-4-saravanak@google.com> (raw)
In-Reply-To: <20200221080510.197337-1-saravanak@google.com>

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>
---
 drivers/base/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 3306d5ae92a6..dbb0f9130f42 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -718,6 +718,8 @@ static void __device_links_queue_sync_state(struct device *dev,
 {
 	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);
 }
 
-- 
2.25.0.265.gbab2e86ba0-goog


  parent reply	other threads:[~2020-02-21  8:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  8:05 [PATCH v2 0/3] driver core: sync state fixups Saravana Kannan
2020-02-21  8:05 ` [PATCH v2 1/3] driver core: Call sync_state() even if supplier has no consumers Saravana Kannan
2020-02-21  9:25   ` Greg Kroah-Hartman
2020-02-21  9:48     ` Saravana Kannan
2020-02-21 10:32       ` Greg Kroah-Hartman
2020-02-21 16:00         ` Saravana Kannan
2020-02-21  8:05 ` [PATCH v2 2/3] driver core: Add dev_has_sync_state() Saravana Kannan
2020-02-21  8:05 ` Saravana Kannan [this message]
2020-03-24 20:03   ` [PATCH v2 3/3] driver core: Skip unnecessary work when device doesn't have sync_state() Davide Caratti
2020-03-24 20:14     ` Saravana Kannan
2020-03-25  7:44     ` Greg Kroah-Hartman
2020-03-25  9:11       ` Davide Caratti
2020-03-25  9:17         ` Greg Kroah-Hartman
2020-03-04 12:49 ` [PATCH v2 0/3] driver core: sync state fixups Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200221080510.197337-4-saravanak@google.com \
    --to=saravanak@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.