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 584E5C433F5 for ; Sun, 10 Oct 2021 14:18:07 +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 D3567610C7 for ; Sun, 10 Oct 2021 14:18:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D3567610C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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 0E375836F7; Sun, 10 Oct 2021 16:16:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="l7YX6qSm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3FA17836C0; Sun, 10 Oct 2021 16:15:21 +0200 (CEST) Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (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 54DF2836A9 for ; Sun, 10 Oct 2021 16:15:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-oi1-x22c.google.com with SMTP id q129so165164oib.0 for ; Sun, 10 Oct 2021 07:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MGMIpV3Vqy8GqgOsWlX+MYK52dOhU/R4BQwesevtyBs=; b=l7YX6qSm0dSLB598lGDJgrnO0ZHjXd/BRcsr2feOn1RaV+OWta8sCm7A0KWY6EOXwM 4IaTCRTlpE7Q04zRQnoOCDMkq8rAEnOAqI42ZjGW8Z4WGwtzZa1NMzW6KJ1PEES7aE0v THJnqKayvj3elreNPhZXIIiPEUCQxwDBu/9Wg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MGMIpV3Vqy8GqgOsWlX+MYK52dOhU/R4BQwesevtyBs=; b=BHmQMAOmwiJ6PgD6rQnSqJTymEAPCb8S1ZJiVvn7HTF3ELh8c54nH87FPMY9EwAmzn 4dBsO00w+AjRqZ6rrEOKmCkgc2+4s6kk1TMQel5JD1+LZp5hZ+fmvomITT29MJq07dhx SPbBRtaaIwhnSdV6v2QLxK0Id8AzBnzlucgK7GZS1LkBwZtAYmRaEgWwsMQxYE2oJV+d wuf7h+WluK3Q/XyNDJ1vUF9zviPar1nQVJOI9RG/kCxaAEgeflSKWA6GfV/Cbvw4UyMQ Yo3s+A1kodJAm4LBSKVzm66VltF2giLbkaa/jiOibpNQ2k0DHTWSBp54xnHoTLoKAvSp F3oQ== X-Gm-Message-State: AOAM53041r0I7lky7ZL38kW4SJhuOANbyO3sw0DjAd+nYQHn8AI1GCBi /KeqBYR+5AF6Wzup2ZfAyzyWljx15f2yeqVxWO1PJw== X-Google-Smtp-Source: ABdhPJxi2eC9B43AgXWe/VY5FIh2lgKs3iTp3iBhCbLr5rhcAgW/0IzhR7r1sXAThwcduoQFr1eP1SFsCcrt/n6dDpQ= X-Received: by 2002:a54:4818:: with SMTP id j24mr14821834oij.150.1633875307661; Sun, 10 Oct 2021 07:15:07 -0700 (PDT) MIME-Version: 1.0 References: <20211001050228.55183-1-takahiro.akashi@linaro.org> <20211001050228.55183-17-takahiro.akashi@linaro.org> In-Reply-To: <20211001050228.55183-17-takahiro.akashi@linaro.org> From: Simon Glass Date: Sun, 10 Oct 2021 08:14:14 -0600 Message-ID: Subject: Re: [RFC 08/22] dm: blk: add a device-probe hook for scanning disk partitions To: AKASHI Takahiro Cc: Heinrich Schuchardt , Alex Graf , Ilias Apalodimas , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" 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 Thu, 30 Sept 2021 at 23:03, AKASHI Takahiro wrote: > > Now that all the block device drivers have enable a probe hook, we will > call blk_create_partitions() to enumerate all the partitions and create > associated udevices when a block device is detected. > > Signed-off-by: AKASHI Takahiro > --- > drivers/block/blk-uclass.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > Reviewed-by: Simon Glass But I don't see blk_create_partitions() in this patch. > diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c > index dd7f3c0fe31e..6ba11a8fa7f7 100644 > --- a/drivers/block/blk-uclass.c > +++ b/drivers/block/blk-uclass.c > @@ -741,11 +741,25 @@ static int blk_post_probe(struct udevice *dev) > struct blk_desc *desc = dev_get_uclass_plat(dev); > > part_init(desc); > + > + if (desc->part_type != PART_TYPE_UNKNOWN && > + blk_create_partitions(dev)) > + debug("*** creating partitions failed\n"); > } > > return 0; > } > > +static int blk_part_post_probe(struct udevice *dev) > +{ > + /* > + * TODO: > + * If we call blk_creat_partitions() here, it would allow for > + * "partitions in a partition". > + */ Would that be useful? > + return 0; > +} > + > UCLASS_DRIVER(blk) = { > .id = UCLASS_BLK, > .name = "blk", > @@ -821,6 +835,7 @@ U_BOOT_DRIVER(blk_partition) = { > > UCLASS_DRIVER(partition) = { > .id = UCLASS_PARTITION, > + .post_probe = blk_part_post_probe, > .per_device_plat_auto = sizeof(struct disk_part), > .name = "partition", > }; > -- > 2.33.0 >