mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Thierry Reding <thierry.reding@gmail.com>
Subject: [PATCH 1/2] PM / sleep: ensure deferred probe workqueue is finished in wait_for_device_probe
Date: Thu, 8 Oct 2015 11:57:06 -0500	[thread overview]
Message-ID: <1444323427-6822-2-git-send-email-grygorii.strashko@ti.com> (raw)
In-Reply-To: <1444323427-6822-1-git-send-email-grygorii.strashko@ti.com>

Now wait_for_device_probe() waits for currently executing probes to finish,
but it doesn't take into account deferred probing mechanism. As result,
nothing prevents deferred probe workqueue to continue probing devices right
after wait_for_device_probe() is finished.

Hence, lest ensure deferred probe workqueue is finished in
wait_for_device_probe() before proceeding.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/base/dd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index be0eb46..98de1a5 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -391,6 +391,10 @@ int driver_probe_done(void)
  */
 void wait_for_device_probe(void)
 {
+	/* wait for the deferred probe workqueue to finish */
+	if (driver_deferred_probe_enable)
+		flush_workqueue(deferred_wq);
+
 	/* wait for the known devices to complete their probing */
 	wait_event(probe_waitqueue, atomic_read(&probe_count) == 0);
 	async_synchronize_full();
-- 
2.5.1


  reply	other threads:[~2015-10-08 16:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 16:57 [PATCH 0/2] PM / sleep: prohibit devices probing during suspend/hibernation Grygorii Strashko
2015-10-08 16:57 ` Grygorii Strashko [this message]
2015-10-08 20:50   ` [PATCH 1/2] PM / sleep: ensure deferred probe workqueue is finished in wait_for_device_probe Rafael J. Wysocki
2015-10-08 20:53     ` Alan Stern
2015-10-09 14:38       ` Grygorii Strashko
2015-10-09 21:16         ` Rafael J. Wysocki
2015-10-13 18:25           ` Grygorii Strashko
2015-10-08 16:57 ` [PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation Grygorii Strashko
2015-10-08 17:24   ` Alan Stern
2015-10-08 18:54     ` Grygorii Strashko
2015-10-08 19:20       ` Alan Stern
2015-10-08 19:48         ` Grygorii Strashko
2015-10-08 20:05           ` Alan Stern
2015-10-08 20:46         ` Rafael J. Wysocki
2015-10-09 14:31           ` Grygorii Strashko

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=1444323427-6822-2-git-send-email-grygorii.strashko@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    --cc=thierry.reding@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®