From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A48B0DDC3 for ; Thu, 26 Mar 2026 22:54:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.5 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774565688; cv=pass; b=cl7i9ulq0UkRuKjW4+s4VNJCZfH41n1ES6i85Sj00XGnH+Sv6eIwwPYirwDQYInwDfY2FJhzX8Jnt5PtHLWgogcMZNXeHWhtvT8r6o8Y7n8HkhAMADxyhZvfD6w7UKQIcVMVDm9HmDQgHE3yDT6E8UcO4NXT67xk/Rw0p4ZvsGI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774565688; c=relaxed/simple; bh=TD6QzufwjRbyRho7i+euphSon2LVQrATAr4yg/zjNJ0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XcyeL1ii3l1k1Ln50Zb01+KE8SeNi1hjjlJ5jjtKdjw/bt0hkvv6rmIpIQ+eM08n+CSa7HdfOMGp2ZvsBHmebAHHzclkGrqdTPDyohQGs0pBApt28ZVNVovGXS/AHsBZHXdsjEHsCrZ2Vp6S0GO5PP8qWhOHtmzAGZOUd/PObwo= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=ajQCC6BL; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=RFrZFFB2; arc=pass smtp.client-ip=185.56.87.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="ajQCC6BL"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="RFrZFFB2" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-73dl.prod.antispam.mailspamprotection.com; s=arckey; t=1774565686; b=Tz7gotxncAThmewBS+QDKDXgLN9NfnI7u3+j4grz4cgLaDkpKPBwEEfYVv+H9cRyv2xFs3bv2f Y3H2Oi7zbvupaQNBj5Oi35Pb0SOOnBsSlPRy3NynkmTx1kNLGVMwGAxwmJCvruFTPZJdcO74Sm 31uSusTwFem1k7YsrnrZOXeW95QuZhBj1tkLg1bJvv2doZ2r5RGjwCMm1i9UB3ZRkv8BxS7kLa CFQwjJXKY1HKU97LDI5GWt/d6oj7rvqdOzssI2bUDlqMEk08wvlAlbWZzlmGefWUhltkFNOnnX PTIfl26nMz19Va6ygVj9XM7CcoO6JF6kchlNAeTH/NSkHw==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-73dl.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-73dl.prod.antispam.mailspamprotection.com; s=arckey; t=1774565686; bh=TD6QzufwjRbyRho7i+euphSon2LVQrATAr4yg/zjNJ0=; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To: From:Date:DKIM-Signature:DKIM-Signature; b=etyDGIRUEC3bUO6DAVTzV5H/fQYfoKKducr4jWE3AfA8/Tjh8NOxXBHg7LyWIsw+Oni1IRoH4e w7JMSr0mRuLqOrIh/CNtbGGIk0OWkA77IQo7p8Cwmtid5GQZ3s1llb8KhQ/iJRSgyeyPzl50Ft UGujTZ5rknXD71SFZVeCqtJrGN3Xu2Y7Gk/5BxFBmOOShMWDGSjHN+CrERR28fH60+aWjVgoUN ukuMx91DMrRIZaqJGtLblHjAlKGJokaL0/39EUuu47/pQHLyEiWKgrzZDy/W/36up2+I+z5Z7V ZBGInHDIrlgGS1yBZjFrz/VdRXWBFFB7ONAVD2AJGAkiFQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: List-Unsubscribe:Content-Transfer-Encoding; bh=IE8UXNQghoxYUP5G4/PQqWXQx/CNBEavtp/EjW4PSPw=; b=ajQCC6BL4ZGWYTqtDqx02Hl7Q3 bTTDFVhN45TOWQfjDtwgN/DrbOBuUuSLHq1ylKEwUiC9Q8raxA/cmS/P7H1owHmYUcfrF7IGeFnXz BOZsF7OOorbIBM6b3AbhFG2D++ihX3uBwSArimntMgQ0yUfWFdmP0IRR9AHiAve8Lhls=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-73dl.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1w5sS5-0000000C79v-3gBh for linux-kernel@vger.kernel.org; Thu, 26 Mar 2026 21:41:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Subject:Cc:To:From:Date:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=IE8UXNQghoxYUP5G4/PQqWXQx/CNBEavtp/EjW4PSPw=; b=RFrZFFB261G64UG6ljIxzg6KGH uWL8TCbC1OZwIxBdYKdV+knST67L+gjohduBOwsll3pVR/NO9sI6FXGclapHWc8G3wUbs2vemQp/k FAXA/WKCxjCZksgZM5hZLXkYhCEr4xRbbIlI8UZ7og8lU/COWmHG0Qo38i5yDKy1biIA=; Received: from [95.248.129.24] (port=63479 helo=bywater) by esm19.siteground.biz with essmtpa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.1) (envelope-from ) id 1w5sRh-00000000DRW-0ciV; Thu, 26 Mar 2026 21:40:53 +0000 Date: Thu, 26 Mar 2026 22:40:51 +0100 From: Francesco Valla To: Guillaume Gonnet Cc: Alasdair Kergon , Mike Snitzer , Mikulas Patocka , Benjamin Marzinski , Peter Korsgaard , dm-devel@schwermer.no, chanho.min@lge.com, jaeyuel.im@lge.com, dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dm init: ensure device probing has finished in dm-mod.waitfor= Message-ID: References: <20260317213229.18371-1-ggonnet.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260317213229.18371-1-ggonnet.linux@gmail.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 1e43d61d452ab61cb5fd1025c1070d67 X-AntiAbuse: ID - 1e43d61d452ab61cb5fd1025c1070d67 AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1w5sS5-0000000C79v-3gBh-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-73dl.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none Hello Guillaume, On Tue, Mar 17, 2026 at 10:32:28PM +0100, Guillaume Gonnet wrote: > The early_lookup_bdev() function returns successfully when the disk > device is present but not necessarily its partitions. In this situation, > dm_early_create() fails as the partition block device does not exist > yet. > > In my case, this phenomenon occurs quite often because the device is > an SD card with slow reading times, on which kernel takes time to > enumerate available partitions. > I am now in the same situation, but I have seen the behavior also on "fast" eMMC devices probing on slow single-core processors. > Fortunately, the underlying device is back to "probing" state while > enumerating partitions. Waiting for all probing to end is enough to fix > this issue. > > That's also the reason why this problem never occurs with rootwait= > parameter: the while loop inside wait_for_root() explicitly waits for > probing to be done and then the function calls async_synchronize_full(). > These lines were omitted in 035641b, even though the commit says it's > based on the rootwait logic... > > Anyway, calling wait_for_device_probe() after our while loop does the > job (it both waits for probing and calls async_synchronize_full). > > Fixes: 035641b01e72 ("dm init: add dm-mod.waitfor to wait for asynchronously probed block devices") > Signed-off-by: Guillaume Gonnet > --- > > Hello, > > This patch is my attempt to fix the dm-mod.waitfor= issue. I had this > fix for quite a while now, but I've never made the effort to contribute > until recently. > > Some have tried to fix it this issue in the past but without finding > its real root cause (ie. not waiting for device probe to end). > > Here are the links to those patches, for reference: > https://lore.kernel.org/all/b5c5cd56-b9dd-4368-a8e1-b9e0a07b79b4@schwermer.no/ > https://lore.kernel.org/all/20250410080056.43247-1-chanho.min@lge.com/ > https://lore.kernel.org/dm-devel/20251211073426.123026-1-jaeyuel.im@lge.com/ > > drivers/md/dm-init.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/md/dm-init.c b/drivers/md/dm-init.c > index 7403823384c5..c1bacba92c65 100644 > --- a/drivers/md/dm-init.c > +++ b/drivers/md/dm-init.c > @@ -303,8 +303,10 @@ static int __init dm_init_init(void) > } > } > > - if (waitfor[0]) > + if (waitfor[0]) { > + wait_for_device_probe(); > DMINFO("all devices available"); > + } > > list_for_each_entry(dev, &devices, list) { > if (dm_early_create(&dev->dmi, dev->table, > -- > 2.43.0 > Reviewed-by: Francesco Valla Tested-by: Francesco Valla Thank you! Regards, Francesco