mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	linux-kernel@vger.kernel.org,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	Dirk Behme <dirk.behme@de.bosch.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v3 1/3] Revert "drivers: core: synchronize really_probe() and dev_uevent()"
Date: Thu, 3 Apr 2025 13:08:51 +0900	[thread overview]
Message-ID: <20250403130851.089bbaae4fe0d42b14a3266b@kernel.org> (raw)
In-Reply-To: <20250311052417.1846985-1-dmitry.torokhov@gmail.com>

On Mon, 10 Mar 2025 22:24:14 -0700
Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:

> This reverts commit c0a40097f0bc81deafc15f9195d1fb54595cd6d0.
> 
> Probing a device can take arbitrary long time. In the field we observed
> that, for example, probing a bad micro-SD cards in an external USB card
> reader (or maybe cards were good but cables were flaky) sometimes takes
> longer than 2 minutes due to multiple retries at various levels of the
> stack. We can not block uevent_show() method for that long because udev
> is reading that attribute very often and that blocks udev and interferes
> with booting of the system.
> 
> The change that introduced locking was concerned with dev_uevent()
> racing with unbinding the driver. However we can handle it without
> locking (which will be done in subsequent patch).
> 
> There was also claim that synchronization with probe() is needed to
> properly load USB drivers, however this is a red herring: the change
> adding the lock was introduced in May of last year and USB loading and
> probing worked properly for many years before that.
> 
> Revert the harmful locking.
> 

Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thanks,

> Cc: stable@vger.kernel.org
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/base/core.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> v3: no changes.
> 
> v2: added Cc: stable, no code changes.
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index d2f9d3a59d6b..f9c1c623bca5 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -2726,11 +2726,8 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr,
>  	if (!env)
>  		return -ENOMEM;
>  
> -	/* Synchronize with really_probe() */
> -	device_lock(dev);
>  	/* let the kset specific function add its keys */
>  	retval = kset->uevent_ops->uevent(&dev->kobj, env);
> -	device_unlock(dev);
>  	if (retval)
>  		goto out;
>  
> -- 
> 2.49.0.rc0.332.g42c0ae87b1-goog
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  parent reply	other threads:[~2025-04-03  4:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11  5:24 Dmitry Torokhov
2025-03-11  5:24 ` [PATCH v3 2/3] driver core: introduce device_set_driver() helper Dmitry Torokhov
2025-04-03 22:17   ` Masami Hiramatsu
2025-03-11  5:24 ` [PATCH v3 3/3] driver core: fix potential NULL pointer dereference in dev_uevent() Dmitry Torokhov
2025-04-03 22:20   ` Masami Hiramatsu
2025-04-03  4:08 ` Masami Hiramatsu [this message]
2026-03-20  6:16 ` [PATCH v3 1/3] Revert "drivers: core: synchronize really_probe() and dev_uevent()" Aditya Garg
2026-03-20  7:24   ` Dmitry Torokhov

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=20250403130851.089bbaae4fe0d42b14a3266b@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=dakr@kernel.org \
    --cc=dirk.behme@de.bosch.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=stable@vger.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 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®