From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D498C433F5 for ; Mon, 11 Oct 2021 01:10:49 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90B2960EE9 for ; Mon, 11 Oct 2021 01:10:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 90B2960EE9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8BD308354E; Mon, 11 Oct 2021 03:10:41 +0200 (CEST) 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="gemEkPuh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 410CB83578; Mon, 11 Oct 2021 03:10:39 +0200 (CEST) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 881D183475 for ; Mon, 11 Oct 2021 03:10:35 +0200 (CEST) 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-pg1-x52f.google.com with SMTP id s75so9266408pgs.5 for ; Sun, 10 Oct 2021 18:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=QTRSBZ3+eXr7jWCJrSZrMDLbtnjPYGiX+9qZPBHYnEE=; b=gemEkPuhY4adcM/NbFRcFtGuugCrTeI/9I8nwsWLPhgXknDWCwf1/Cj4YQLlkXZYvH 9FUjEbv8TwaOM2/hLjpTar2KHFYSUC8UjlVN7D6zLYDWjNZ+385oiQiIhVlOdcGLyAk2 WoNHuWDW/6cg5hHBt3ndBPo074CaophFMn6T88dyjpqJHRmKniAcD1FT73lQSGJBLcwA dxDn6zxp11J2IKc8P5/MgoOs6bqhPQnC6o9GeKLaK5x5eDtIP9RhiaQhWku23bf7qTb7 BAMTrHY/Gjyd+BUPmcAUeLbEUJRbO2ohSfgdXEzzuA/eUPBK5fCG3rcbWKia0l+GM10n qlQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=QTRSBZ3+eXr7jWCJrSZrMDLbtnjPYGiX+9qZPBHYnEE=; b=q+zY5DlzCitaLvfqAbGmom68OZ0+jxPkBC3j2sIE3E4z8BfKxiumOkxvHsS0vaMP3j akpHtqDMQ+9OiAddEJ9BmXfknhDNr/71jSgdpqf6y6ZYQwmOnmtJnuxlb3IO2/Dv33mG xpWhyWjpsEiBbbUeQw6XZ2vKlnIxSErRHFVwUKAO0cjFi4nwPNkC0bHBQ00Zu93h7ofW B3UpuW+E3AvL/H11hoipn6NljfhUXLrpigY7qm4S42gaZ3XVRYc1/KFSffm+Fg/tAPRD fVc/23uxmB0h2fw2vcUVSg1FKM/XlfPxJMfZHy1oDFZPIFZg+yZPitaRljiGGor19+LJ 3Wlg== X-Gm-Message-State: AOAM532K0mRsJ/FYTpii3U8BMLBksMEcwa2xYIWGtqITHG/gM4J/LjsI 1V6ZVosgNeXOIDPiw9hoUdFBBA== X-Google-Smtp-Source: ABdhPJyUGKGPXlE4Xm1mWo6cD98Dmnkss1LEs4LUkCTJuo8c8jCYPccMjZgBfZCQbgm4NeGDeXlCsw== X-Received: by 2002:a65:6648:: with SMTP id z8mr16044164pgv.418.1633914633696; Sun, 10 Oct 2021 18:10:33 -0700 (PDT) Received: from laputa (122-100-26-39m5.mineo.jp. [122.100.26.39]) by smtp.gmail.com with ESMTPSA id x17sm5032803pfa.209.2021.10.10.18.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Oct 2021 18:10:33 -0700 (PDT) Date: Mon, 11 Oct 2021 10:10:27 +0900 From: AKASHI Takahiro To: Simon Glass Cc: Heinrich Schuchardt , Alex Graf , Ilias Apalodimas , U-Boot Mailing List Subject: Re: [RFC 03/22] mmc: call device_probe() after scanning Message-ID: <20211011011027.GB44356@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , Heinrich Schuchardt , Alex Graf , Ilias Apalodimas , U-Boot Mailing List References: <20211001050228.55183-1-takahiro.akashi@linaro.org> <20211001050228.55183-6-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 On Sun, Oct 10, 2021 at 08:14:09AM -0600, Simon Glass wrote: > Hi Takahiro, > > On Thu, 30 Sept 2021 at 23:03, AKASHI Takahiro > wrote: > > > > 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 | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c > > index 3ee92d03ca23..07b5c1736439 100644 > > --- a/drivers/mmc/mmc-uclass.c > > +++ b/drivers/mmc/mmc-uclass.c > > @@ -418,6 +418,13 @@ 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; > > + > > + ret = device_probe(dev); > > + if (ret) { > > + device_unbind(dev); > > + return ret; > > + } > > We cannot probe a device within a bind() method. Can this be moved to > mmc_blk_probe(), perhaps? Ok, I will fix it. Thanks, -Takahiro Akashi > Regards, > Simon