From patchwork Tue Mar 8 11:36:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 549271 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp2538909mag; Tue, 8 Mar 2022 03:38:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJz15ALPFtT1rc+STXQPjwKpi35TQ/8BXE3sXypNaulltqVJj0WjdBH8RVbgFc/RfWEJAwp9 X-Received: by 2002:a17:906:4987:b0:6ce:88fc:3c88 with SMTP id p7-20020a170906498700b006ce88fc3c88mr12422826eju.608.1646739517531; Tue, 08 Mar 2022 03:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646739517; cv=none; d=google.com; s=arc-20160816; b=a5kFirtgr6+aCFoJTn2AFCJqqlVQc+LCq2qpYD05MH/yPFXLJYjjOKDBG09kQg3MwO WT1zRoARaZnH4TFcuZENDROOoZHL7+NEEaFlCrX4VjIOxU+h0B7QM3Zpbpn7c7zwEd4g ST0RYIi+UkQGwdH7yRWNS0NKBXppKUPGehRQ/3JvU+wf0dwjd9lhAPVSzb44t2P3z+gz b0X1swJMVyndTMpiSPjSbHIjwYiXZVXNOIGGau7kfmyUMLfcN/u9AgV10vxkzjFUcErT PXlAUf6YOEyfhlMacn8yQxU6hB0ZY9LmNquhI2OlHzPN7Mz9NjA/iBHzE7SPu3x4SBWR eC7A== 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=EXdNq0qBEE26U3ZlUbhrUpN1iSNf2k9z8bsAluDd/S0=; b=wY6Gw1UUu52IrQ9abktqtpTla1v8fPUikibY2FjVxlOxkMhDcEMQin6LAcrJLaeygx OiQ/il0KIvxqsGBBy/gVkobEIvadgibF/Okvs/nR6B1yvdQlAwCWY6uvCKqqDpUQm26L xaONoo8fTSOapKcJaD1c0KIN+z0UMtD+i+hZ5mWRhmLHWdIHuuYMwrvFvakNuV2e+jb3 4s9nmbTENkZysJdRMX9sY687gMVsJqbQxV3CyC01MSJGBuZ86Z1Fk1L4mgCXu+FcsqnX epmBNx+yJLI9mn97bStrY54sOegPe5XN3HGRPEow1pzQt8lKNJydGrIvO4c+CZvZaR+d 5how== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PvvQxo7C; 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 y15-20020a50d8cf000000b0040f13a5a14bsi11410536edj.95.2022.03.08.03.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 03:38:37 -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=PvvQxo7C; 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 6582C83994; Tue, 8 Mar 2022 12:38:30 +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="PvvQxo7C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0F828397F; Tue, 8 Mar 2022 12:38:11 +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=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (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 0814C83930 for ; Tue, 8 Mar 2022 12:37:55 +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-x1036.google.com with SMTP id p3-20020a17090a680300b001bbfb9d760eso1962075pjj.2 for ; Tue, 08 Mar 2022 03:37:54 -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=EXdNq0qBEE26U3ZlUbhrUpN1iSNf2k9z8bsAluDd/S0=; b=PvvQxo7CRGfuqrHJXVbalgO4qoKXK/Z86Ykovl0KLIULjfXP0d5DGAEhdKslcCtoeD idpMa9QowQju2c7fF2wCseMTuY4jc5tabH7+0wg7Iir+AlGuO6v2EN/1zzMJCO4VfQAG 6ctJx7Ez2CJllzwAk0mU6CAIEyk7s4H3wBAvH0l3Ta/b146/qE7c5X08pEOSCuPxR+WB RFx1sBLH/gub/92Inhqew3AwEmbywetjtd7ixKrFoCPL7t2E7kVb8r2YFoUrNfwWXzsQ 5VtI6AQ0kYIezGPpjQMalZJaWdPVFr2TF20vhr4S0cavZ5uetVAVxXc9dC/mS+s1Rxua fqdw== 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=EXdNq0qBEE26U3ZlUbhrUpN1iSNf2k9z8bsAluDd/S0=; b=Jml74NTtaS9L4PpVrfcZ0uVQdTi3rFWxVCkpCj7ZkGrmSdMD/CmHhbqOQj6iyDuGep hzUVOEAS8IM1Hy/gJZmiR/nBVqiC95IgdgOxvsl7Zh/ySTluugabUYgo7/bLNliBcdDl tf5gTlb817aMLeR2eB6/txUQXaEBdKQz5fAcMBJjSy2sHXDQSgnr1MwcgsPUYdIz+OXF G03FK+BZVZIM0zfva2CSzC73zkuOj4yNAt+p8zTz3XINbk9mzpychnZMKuAlnp1IeUEY 6EMhpHD4WlLs+bpn28IJFd0LtgMaFvZeq49OC8WRwmOLUGvoXqU4dqHfML7BvIdce2YL gNlQ== X-Gm-Message-State: AOAM530GUTJ2xcfCBQlNIB7WOyQWuGmL+Ta3PUTPuSk5vz/X0p7bKFnB zwasJU27AkVO6FyW2qrh+yJr9g== X-Received: by 2002:a17:902:c40d:b0:151:c3f9:e425 with SMTP id k13-20020a170902c40d00b00151c3f9e425mr17146778plk.45.1646739473368; Tue, 08 Mar 2022 03:37:53 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:b94a:f47a:3d51:185c]) by smtp.gmail.com with ESMTPSA id z2-20020a17090a170200b001bf2d530d64sm3434677pjd.2.2022.03.08.03.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 03:37:53 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, peng.fan@nxp.com, jh80.chung@samsung.com, bmeng.cn@gmail.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 v3 03/19] mmc: call device_probe() after scanning Date: Tue, 8 Mar 2022 20:36:41 +0900 Message-Id: <20220308113657.221101-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220308113657.221101-1-takahiro.akashi@linaro.org> References: <20220308113657.221101-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..57da788ad805 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 (CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) || + CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) || + CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)) + mmc_deinit(mmc); + + return ret; + } + return 0; }