LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ferry Toth <fntoth@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/3] driver core: Read atomic counter once in driver_probe_done()
Date: Thu, 19 Mar 2020 00:49:09 +0100 [thread overview]
Message-ID: <80e2fbb3-c69d-c2a8-f177-25c304062b29@gmail.com> (raw)
In-Reply-To: <20200309141111.40576-2-andriy.shevchenko@linux.intel.com>
Op 09-03-2020 om 15:11 schreef Andy Shevchenko:
> Between printing the debug message and actual check atomic counter can be
> altered. For better debugging experience read atomic counter value only once.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <fntoth@gmail.com>
> ---
> drivers/base/dd.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index 43720beb5300..efd0e4c16ba5 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -669,9 +669,10 @@ static int really_probe_debug(struct device *dev, struct device_driver *drv)
> */
> int driver_probe_done(void)
> {
> - pr_debug("%s: probe_count = %d\n", __func__,
> - atomic_read(&probe_count));
> - if (atomic_read(&probe_count))
> + int local_probe_count = atomic_read(&probe_count);
> +
> + pr_debug("%s: probe_count = %d\n", __func__, local_probe_count);
> + if (local_probe_count)
> return -EBUSY;
> return 0;
> }
>
next prev parent reply other threads:[~2020-03-19 0:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 14:11 [PATCH v1 1/3] driver core: Break infinite loop when deferred probe can't be satisfied Andy Shevchenko
2020-03-09 14:11 ` [PATCH v1 2/3] driver core: Read atomic counter once in driver_probe_done() Andy Shevchenko
2020-03-18 23:49 ` Ferry Toth [this message]
2020-03-09 14:11 ` [PATCH v1 3/3] driver core: Replace open-coded list_last_entry() Andy Shevchenko
2020-03-11 8:32 ` [PATCH v1 1/3] driver core: Break infinite loop when deferred probe can't be satisfied Peter Ujfalusi
2020-03-12 10:54 ` Andy Shevchenko
2020-03-13 7:35 ` Peter Ujfalusi
2020-03-13 8:50 ` Andy Shevchenko
2020-03-18 23:47 ` Ferry Toth
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=80e2fbb3-c69d-c2a8-f177-25c304062b29@gmail.com \
--to=fntoth@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--subject='Re: [PATCH v1 2/3] driver core: Read atomic counter once in driver_probe_done()' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).