Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5090373rwp; Sun, 16 Jul 2023 19:23:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlE1im1XiGDTb7PD/l3ASxnwZULqQK8b+X0Wgx1yLESjEgh9TuaKohcF4Qn3pkVadjwtEiTV X-Received: by 2002:a05:6a20:394a:b0:134:a4e2:fbee with SMTP id r10-20020a056a20394a00b00134a4e2fbeemr3082225pzg.3.1689560601495; Sun, 16 Jul 2023 19:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689560601; cv=none; d=google.com; s=arc-20160816; b=1CM6HNcdGLc8gepF6joEnrkRTG7OcoRCyNviG8/XkZSCknBenUqwxoZ43e0n5aDBhO EczJAP7E9F+QoJjKjblCLMCG39DLrjgShEnp0dzEDw7/6boWF2DOULrTUAJA/z1mSU+X sr8cGE/XfRx646BNb/4KUbTNjyeZBaNvaJFkwgwi4V1r7NHiVEMFk81lh73AmFCo9VgE RFwEaZObX2SQwDI9uso8wrIlUYRLiZMhXOiUi2OrrxyzQp0npX2V/ATW+zKvkvN4wxPH 3wO3tLincDKMCfLdNu4+Ch00ZYskLaVxBsjETpdbTRw2wiSX4kDIADzi/muai1IdijDZ DTfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=iWG5WrewmZyGOqX9g3fBInai637V8c0IB0YAxIq934s=; fh=U5vWEVeEEIpRtSreVpVgBycJHnICPQPFcvuisbinS/M=; b=ouFgrdAS6JoPJS2ad6o7EyCgeEydXdznEuVtcAJ5jVIOGP7W4xFDXR9XH1Z0Ov1xav pg+OL2zD/ggsJ79R58xfiTC36Ma1CAEc3VdfzskWRH0XeD3DCa7EbhczGKV7HQxFF0VF nT0jix1PfjWSeb2PSp467NxzoblBUqPy8PXaNrQilG7JQlOesrizxZSVw87tBfIkZbHC QvQ1K42fWihWm4iCyzWMhsd4jBg0/XB0MdXcObDWPsuf4l2Ei0CeKJFi3ddExCSCoadZ D22pwUAxSpdrnf9PnTblIsSlL0VJTxTVYygRbRFJaZdC9TGrUx6sRs8YvpbKcZn/AyA9 3edw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=erb0pqvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b185-20020a6334c2000000b0055c66f42eebsi9649146pga.512.2023.07.16.19.23.07; Sun, 16 Jul 2023 19:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=erb0pqvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230292AbjGQB5r (ORCPT + 99 others); Sun, 16 Jul 2023 21:57:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjGQB5p (ORCPT ); Sun, 16 Jul 2023 21:57:45 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C34DE52; Sun, 16 Jul 2023 18:57:36 -0700 (PDT) X-UUID: 496abba0244511eeb20a276fd37b9834-20230717 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=iWG5WrewmZyGOqX9g3fBInai637V8c0IB0YAxIq934s=; b=erb0pqvQU+77Z4XObw+hivyQ+0zdsAr1thX+qnIhHLllmdUuYUWQwIN5eNfMcJYYmVXNudGBrDHyZtR1wf8NfP1wtPNZ7PQbv/PUQeIapz+UetzG7QI22VfF1OiE8L7J+khBQoLo/cBvzSpzVGMTkE3b/CTpJuizmLqEOhGYqWM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.28,REQID:77017d85-47d1-496b-a3d9-dd56ef0fafbd,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:51,FILE:0,BULK:28,RULE:Release_Ham,ACTIO N:release,TS:79 X-CID-INFO: VERSION:1.1.28,REQID:77017d85-47d1-496b-a3d9-dd56ef0fafbd,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:51,FILE:0,BULK:28,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:79 X-CID-META: VersionHash:176cd25,CLOUDID:6c33c64c-06c1-468b-847d-5b62d44dbb9b,B ulkID:2307162316286AMI74JA,BulkQuantity:18,Recheck:0,SF:19|48|29|28|17|102 ,TC:nil,Content:0|-5,EDM:-3,IP:nil,URL:0,File:nil,Bulk:40|20,QS:nil,BEC:ni l,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0 X-CID-BVR: 1,FCT|NGT X-CID-BAS: 1,FCT|NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_OBB,TF_CID_SPAM_FCD, TF_CID_SPAM_SNR,TF_CID_SPAM_SDM,TF_CID_SPAM_ASC X-UUID: 496abba0244511eeb20a276fd37b9834-20230717 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1800077516; Mon, 17 Jul 2023 09:57:29 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 17 Jul 2023 09:57:28 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 17 Jul 2023 09:57:28 +0800 From: Mark-PK Tsai To: CC: , , , , , , , , , , , , , Subject: Re: [PATCH 5.15] dm init: add dm-mod.waitfor to wait for asynchronously probed block devices Date: Mon, 17 Jul 2023 09:57:28 +0800 Message-ID: <20230717015728.12641-1-mark-pk.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, RDNS_NONE,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sun, Jul 16, 2023, 11:16 AM Greg KH wrote: > > > On Thu, Jul 13, 2023 at 01:58:37PM +0800, Mark-PK Tsai wrote: > > > From: Peter Korsgaard > > > > > > Just calling wait_for_device_probe() is not enough to ensure that > > > asynchronously probed block devices are available (E.G. mmc, usb), so > > > add a "dm-mod.waitfor=[,..,]" parameter to get > > > dm-init to explicitly wait for specific block devices before > > > initializing the tables with logic similar to the rootwait logic that > > > was introduced with commit cc1ed7542c8c ("init: wait for > > > asynchronously scanned block devices"). > > > > > > E.G. with dm-verity on mmc using: > > > dm-mod.waitfor="PARTLABEL=hash-a,PARTLABEL=root-a" > > > > > > [ 0.671671] device-mapper: init: waiting for all devices to be > > available before creating mapped devices > > > [ 0.671679] device-mapper: init: waiting for device PARTLABEL=hash-a > > ... > > > [ 0.710695] mmc0: new HS200 MMC card at address 0001 > > > [ 0.711158] mmcblk0: mmc0:0001 004GA0 3.69 GiB > > > [ 0.715954] mmcblk0boot0: mmc0:0001 004GA0 partition 1 2.00 MiB > > > [ 0.722085] mmcblk0boot1: mmc0:0001 004GA0 partition 2 2.00 MiB > > > [ 0.728093] mmcblk0rpmb: mmc0:0001 004GA0 partition 3 512 KiB, > > chardev (249:0) > > > [ 0.738274] mmcblk0: p1 p2 p3 p4 p5 p6 p7 > > > [ 0.751282] device-mapper: init: waiting for device PARTLABEL=root-a > > ... > > > [ 0.751306] device-mapper: init: all devices available > > > [ 0.751683] device-mapper: verity: sha256 using implementation > > "sha256-generic" > > > [ 0.759344] device-mapper: ioctl: dm-0 (vroot) is ready > > > [ 0.766540] VFS: Mounted root (squashfs filesystem) readonly on > > device 254:0. > > > > > > Signed-off-by: Peter Korsgaard > > > Signed-off-by: Mike Snitzer > > > Cc: stable@vger.kernel.org > > > Signed-off-by: Mark-PK Tsai > > > --- > > > .../admin-guide/device-mapper/dm-init.rst | 8 +++++++ > > > drivers/md/dm-init.c | 22 ++++++++++++++++++- > > > 2 files changed, 29 insertions(+), 1 deletion(-) > > > > What is the git commit id of this change in Linus's tree? > > > > thanks, > > > > greg k-h > > > > > > Hey Greg, > > This change shouldn't be backported to stable@. It is a feature, if > Mark-PK feels they need it older kernels they need to carry the change > in their own tree. Or at a minimum they need to explain why this > change is warranted in stable@. Thanks for your comment. The reason why we think this should be backported to stable kernel is that it actually fix the potential race condition when make block device probe async in stable kernel. And we'd like to fix this upstream rather than just take it in our custom tree. > > But to answer your original question the upstream commit is: > > 035641b01e72 dm init: add dm-mod.waitfor to wait for asynchronously probed block devices > > Thanks, > Mike