From patchwork Thu Feb 10 08:11:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 541397 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp2038644imo; Thu, 10 Feb 2022 00:12:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaApOZTF7vV9AwRbiRNyiA+tPLVMe6gEXmj2FfBjKYoIwAC7ABImlUrgjxZ49NkTDiEot3 X-Received: by 2002:a17:906:6a20:: with SMTP id qw32mr5370268ejc.40.1644480768084; Thu, 10 Feb 2022 00:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644480768; cv=none; d=google.com; s=arc-20160816; b=ZaRxABh6I7+BjNfBEcWByM1kewl3q5AN12rOTdjk3pKfzs97wsrHASrmZ/06PzJGYN FV8MZdvxsQdMik6wpek15Vm3z0Ac7H4vJ0sfmO0ffWnjnFAlzsUNOB1dzS3SeGYsuNE8 DUKMVUGGgRzo1bdcA24CSCbTbnrzCKn0ZS3GI9MEo7DGM4ZJVy2FEmSGjASjV6gnHEFn oRxJqB+w08SZOXR/qguGqQhCdg0K6Ggbma2Xr9Twjc44p/4p81Pol+dtJ9MbMvkCC0gk VnXgj2c649Ctg2vgJkkVRI9kGliE0HvIkFtkuaKBMFLfkIzDbRejrC0R/O3wJxHGODGv 5rSg== 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=8MQeMEgxA8Fzplo3qyKWRVNh/30V422w+bdA2E6g2KY=; b=hMQYHjjre3zrCge6tn7Rv+EVZzvFow8e5tV3Xm/XDaA2zilw5OIhSC/daaxJz/KXo5 RQN44XfEx/9Ld5NDjTqRSSgcvAHRe5X0y3veo2SKb1R09ZHbjNN0CqLYVDKf3X6k2uGV +k8HgKzXOMS+umXLlKWCTJSYzVxZCBvTuzmYKLOFmK+QjoGLDhwHy3D47cr+STyGSIdS g/Z6KOZPh3AYbkCuTSqYBD2ESJbOBMX8iAN4CjfbmF0obgYJs9A3KJ8dm7mKOVUr34h1 re+S4F7ocFbMlcAQ3bi5/yzyFg3eVXUVFFQjsiZebUM+uU23zZ5o2W5IGqBFBpjbn1iF tPzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKh6V3RT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id m4si10953630ejn.639.2022.02.10.00.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 00:12:48 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKh6V3RT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 9D2FB8307A; Thu, 10 Feb 2022 09:12:36 +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="TKh6V3RT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 397468141A; Thu, 10 Feb 2022 09:12:33 +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, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 0F71083055 for ; Thu, 10 Feb 2022 09:12:26 +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 t14-20020a17090a3e4e00b001b8f6032d96so4825798pjm.2 for ; Thu, 10 Feb 2022 00:12:25 -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=8MQeMEgxA8Fzplo3qyKWRVNh/30V422w+bdA2E6g2KY=; b=TKh6V3RTJIb4+rIW+tUJ+Ry1zFd5GO8fcJfo/qPgIMTMJmx94cNV2hAV4mnlgNoJIv QBYwpao+3PYDRiaDFTnOOyfw0HR0iHj4VR2+dEb8QSSOlGTw602p+YryOnEQ9bgr6m0m Tn8p+9QouLY7RI6OnHQobwAoderW0pXTL1sAX0FGLG9pleX2ZiNdQEpCFnYezsH6fMgH zf4VsRKb/r6Bve+NMypqkf2UiBfo7fBjLuhVC7ZPC8jl7TBIvjc+gLyhSCvdg39uJki8 0XPZwhOS0CvvnbSoxl3nyyObXzGej8VXkgkrR9ntYMv2pVYYqGok17hdIll1JnE1O782 d2ag== 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=8MQeMEgxA8Fzplo3qyKWRVNh/30V422w+bdA2E6g2KY=; b=T33q6YQmqrh+5abFmjucZyNHVWQtr9oDCCEcCpKie5MJZ5fG835DZqMlQqMuSmSTN0 X+BwnKgNkrNzve+TvSn5NErOAmMiLJ3hAK186gb1tw14aCd0BPJd9yLyX16GBsGMJmSA NCIGxYAWewrC30moBXE5QKPAcppt/pdMElH+jxWKzY718S47zoeFbSH2MynrZkPI7z9u BqG6XiSWDElh/RKWpDeBsKdF4FHvTWEMftRBVykR9YQuabZES9LQfGf+3EkXydn8us/Z wz0NB1prOuWKt8AVf6NW35KM6aWsO3j/F1Hcf2h1D1EW4VnvEg9eZdTZ4xqKF2q7hd2l NZwg== X-Gm-Message-State: AOAM532glsQRE5SxcwBmMoAqZdz+dmIeuhAy6Zilh+tsuITbPJRILi0+ le8dHKYg2f3+VtWOOK+PHSbMBw== X-Received: by 2002:a17:90b:4a8d:: with SMTP id lp13mr1542516pjb.206.1644480742567; Thu, 10 Feb 2022 00:12:22 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:412e:384:fab9:f24]) by smtp.gmail.com with ESMTPSA id lk8sm1529208pjb.40.2022.02.10.00.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 00:12:22 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, peng.fan@nxp.com, jh80.chung@samsung.com, bmeng.cn@gmail.com, peng.ma@nxp.com, sr@denx.de, xypron.glpk@gmx.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: masami.hiramatsu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v2 03/20] mmc: call device_probe() after scanning Date: Thu, 10 Feb 2022 17:11:07 +0900 Message-Id: <20220210081124.86612-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220210081124.86612-1-takahiro.akashi@linaro.org> References: <20220210081124.86612-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 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 Reviewed-by: Jaehoon Chung --- drivers/mmc/mmc-uclass.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index b80e838066ca..aa2ab5d8c753 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -467,6 +467,18 @@ static int mmc_blk_probe(struct udevice *dev) return ret; } + ret = device_probe(dev); + if (ret) { + debug("Probing %s failed (err=%d)\n", dev->name, ret); + + 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; }