From patchwork Fri Dec 10 06:49:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 522728 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp2169006imb; Thu, 9 Dec 2021 22:51:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9WByZEgBZvA5Xa2w41aFPSUIPWjO+uJXkxQqMqfjZ4Gg+2QRcoGwTXg2H00ezD/+CxOad X-Received: by 2002:a17:907:3d88:: with SMTP id he8mr21803122ejc.565.1639119077035; Thu, 09 Dec 2021 22:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639119077; cv=none; d=google.com; s=arc-20160816; b=A+Zg7zRUQ/eRAYB2sVyUpe3N6vaJK/70k/0bf2mgzB5gni4BvtM2TOxi5Xa0MJgHsF wFdSE29FazUgr0avbD0KzwylGiB2TuRP0qzDjMGT1/GYK3eGIOY01sG3M/lidVMHgsNN YDHi2og/vsqF3l7vfOxNO36RfXkgiP5bJESy3XaUEunBdGEZleKOTU+2YSt1VFgGBJjK EO3jlI+ScIOT+AJf/BCZFF4yyW8ya9T2cwjmJ+AghUwiXwBaS4OJBBr4h0yh5D29POjH pykhEoo7/ahX/chMjriBkbk3OtFy4CmZqnYOF1GuVOlRiwQckW9cD8iZFPaQEavSU1cL Ximw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=74wqDPeORcXuh+mDzjDs/7A1t3UgXTLsYe1yBw20K2M=; b=SKtK4LsdcRoc0ZsuYGzAb76YKGGCPvUaTI35+LbeRBv5ijR2a1H0HIQFlf+LO5kq4B 01GG0+m0JUkdSE7mMP2dmZKd+HOV+6wkWTa8/Fuxj+nUUrNU47pJUL6LDBJzFL25ZQwU 3pX5dK8OlnHO9EM7ypslQFMCkmx7oVmW5+vqDXEmT2OFR34PPEMZv7E2g6/H0n0BjeuO iFd3XkUqQkVw7XuxHfrsv5H9U0PxX3IxU2m+61RkvZqwwCG6CPkd7zK8L30bH3vK2Azs MGKngedXIlbY3+TZUFd8A+iyK3IboxRNywawzBFulTifJgk3Hb5C4rd1K/HvtxJUnz2T TkKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ljb8vjE1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id dn19si4590063ejc.462.2021.12.09.22.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:51:17 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ljb8vjE1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F6648340A; Fri, 10 Dec 2021 07:50:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ljb8vjE1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2BC2830C5; Fri, 10 Dec 2021 07:50:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 163AF830A7 for ; Fri, 10 Dec 2021 07:50:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x102e.google.com with SMTP id np3so6145566pjb.4 for ; Thu, 09 Dec 2021 22:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=74wqDPeORcXuh+mDzjDs/7A1t3UgXTLsYe1yBw20K2M=; b=ljb8vjE15rll8UHRtfaL183gpwlbEgRcM4gmMwYtxd9gOrCnTeZaaCbvNOU5aMGumI 2smOu6VLyv6DKpNFoXwPtWK2spVkmE8O5vtImWyIg+dmRU3lQz0AOuQCAAoC7lSlfYji Oj3Ht9+wzR0pMBkFqyBTTYy16UCE8yXU0zWNjkxSck+3jckLO7k7G3lzt6b9QT2DWrsa TLW24EsfKPbQlABdrynibbjgfoLkprfLXWpc17k2t9w3PMtAOpNtVgrLlywnyd39Q75a WMZvWp0PmGjE+N+rakeulzd2n7C859y56/Nt8csxIs0ZMusx3D6vnxfJLiWBsawGH+3a YW5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=74wqDPeORcXuh+mDzjDs/7A1t3UgXTLsYe1yBw20K2M=; b=eTY5fSYmnRoaW0OtQZNk+cZizbCKhQB+Wniu3ISpbPqQnWvf+sx8UGOWHI8TOI833O TblMf3c//I1bBDH0P+pQMGDmJZF+FO67NCIxR0Bec100DKqfPzV57e5Q1vBKf3XQFMOi P11vUsqeYj4bGCwUTC1DB97h1fHe9/swSptvDRhph9UqXsGroO2YPpE4ZW+/gSEkzfK3 5QR67qnXyDYcuRz87JI7WQKQVF+aNZyFv3ctdY7bm5WxGeHhs/sWmxvLDuXzRyQt6JmP jzdzSUhxRQGXNA/POMPcA1ri8/I/ROfqAlDgtsAZRzggIh49D+5RvltdSdjKaHMG/EYe +5zA== X-Gm-Message-State: AOAM532s/P7xpUD1ftJ2uDyeY+crbM6LYH37LlPzYjuhH66E9Jmgz29s hBu9fGhO2sT4Tm07DUPRPHuF6w== X-Received: by 2002:a17:903:1210:b0:143:a088:7932 with SMTP id l16-20020a170903121000b00143a0887932mr74539452plh.11.1639119033469; Thu, 09 Dec 2021 22:50:33 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:75dd:4e0e:4542:936e]) by smtp.gmail.com with ESMTPSA id nn4sm1639035pjb.38.2021.12.09.22.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:50:32 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: masami.hiramatsu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC v2 05/20] mmc: call device_probe() after scanning Date: Fri, 10 Dec 2021 15:49:32 +0900 Message-Id: <20211210064947.73361-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211210064947.73361-1-takahiro.akashi@linaro.org> References: <20211210064947.73361-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Every time a mmc bus/port is scanned and a new device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- drivers/mmc/mmc-uclass.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 3ee92d03ca23..6c907b65fde7 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -418,6 +418,7 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) bdesc->part_type = cfg->part_type; mmc->dev = dev; mmc->user_speed_mode = MMC_MODES_END; + return 0; } @@ -467,6 +468,18 @@ static int mmc_blk_probe(struct udevice *dev) return ret; } + ret = device_probe(dev); + if (ret) { + debug("Can't probe\n"); + + if (IS_ENABLED(CONFIG_MMC_UHS_SUPPORT) || + IS_ENABLED(CONFIG_MMC_HS200_SUPPORT) || + IS_ENABLED(CONFIG_MMC_HS400_SUPPORT)) + mmc_deinit(mmc); + + return ret; + } + return 0; }