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 411C0C433EF for ; Tue, 12 Oct 2021 03:27:06 +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 5570360238 for ; Tue, 12 Oct 2021 03:27:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5570360238 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 55CBC83305; Tue, 12 Oct 2021 05:27:01 +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="kHj/u9Gm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6BCD83424; Tue, 12 Oct 2021 05:26:59 +0200 (CEST) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 7546D832CD for ; Tue, 12 Oct 2021 05:26:55 +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-x531.google.com with SMTP id q5so4541667pgr.7 for ; Mon, 11 Oct 2021 20:26:55 -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=nmNMvnoMXVrN/1pcNkvBv79DK9/mpRmm8ifUpPoncdw=; b=kHj/u9GmPsYn06cm1gOChd1KdK9MtWR4crSOGe02EDulAsXQtRqBNJqiKHnl0h3KHf TNjV71K6Yhpl25miIIduqMqcGaweHDmM8dlw7liaT5w5I7a0TqVjurGH3NSwa5k32sd8 J3Idv31vEs/317HCTWiG8hDU3aXKlDQBjZ8zIKeI2aTWfJMG7mLmIRiqEZdsSJ/8508t 1hjHfXtgXduMKfcpC1T0Y6G/l2cwKc/R/JlkChu8rA41+f+e7qDSgzY2pfUqxVtdwU8P XdH11+4RqT5h+iWbxZfBp2e/bqzf1nsN9pQyufv6kobP2AbCocK/a9QSGZOiddkedmFg MivQ== 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=nmNMvnoMXVrN/1pcNkvBv79DK9/mpRmm8ifUpPoncdw=; b=Y75DtiGkTlTY32tvZgob9DY8OFN0tBdOphCi8szqaHqR+FSkW1FQaWjYUvHjDWXolQ d2t4exBxi4cVsxgepoIBCuAqBVx4tQy+LF+ymE5JK9ZQPv5xKWSQ1Ek5a4WVmNCTAYDX X5wS6dxiMJr3h46cYOO1bjWxWJKIYRsBQEDSb6chJ1W9Ewqn+nAPv+MfM20bNYpD3/jS 8VBCFVwVKEFGJzsuhNatexV0RMH+lyP9rYin2HebcPVO0XPdss5UjbwpqM5xep557IMe 7FW8tbd/ysizurRvbLcaT6F5aPMVtfzvwDf3FMPo6W9wUe/VHW6neHrvbMOmQAxYCrXQ vJWQ== X-Gm-Message-State: AOAM531RTNNeItbcQgNCHJkOTjUER5Qyt/9Wlp2iqZI1rkJ+r5u7FbKW gV/ali4mvUn7xRTWY82UbGN81A== X-Google-Smtp-Source: ABdhPJxWmdy/KUtw25ggvJ/sNCi45cQLufHUgHydfrw/Sv+hjkHYmHWFyFd4zRtDQqsqrZ+Fm2mWvA== X-Received: by 2002:a05:6a00:d63:b0:44d:186d:c4c0 with SMTP id n35-20020a056a000d6300b0044d186dc4c0mr10529296pfv.47.1634009213655; Mon, 11 Oct 2021 20:26:53 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:dbc:a6fe:8374:7fdb]) by smtp.gmail.com with ESMTPSA id y142sm9054237pfc.169.2021.10.11.20.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 20:26:53 -0700 (PDT) Date: Tue, 12 Oct 2021 12:26:49 +0900 From: AKASHI Takahiro To: Simon Glass Cc: Heinrich Schuchardt , Peter Robinson , Alex Graf , Ilias Apalodimas , U-Boot Mailing List Subject: Re: [RFC 01/22] part: call part_init() in blk_get_device_by_str() only for MMC Message-ID: <20211012032649.GE38222@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , Heinrich Schuchardt , Peter Robinson , Alex Graf , Ilias Apalodimas , U-Boot Mailing List References: <20211001050228.55183-1-takahiro.akashi@linaro.org> <20211001050228.55183-2-takahiro.akashi@linaro.org> <26d404a1-92d0-4e03-3c7f-5a34e04464cb@gmx.de> 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 Simon, Heinrich, On Mon, Oct 11, 2021 at 10:14:02AM -0600, Simon Glass wrote: > Hi Heinrich, > > On Mon, 11 Oct 2021 at 09:09, Heinrich Schuchardt wrote: > > > > > > > > On 10/11/21 16:32, Simon Glass wrote: > > > Hi Heinrich, > > > > > > On Mon, 11 Oct 2021 at 04:07, Heinrich Schuchardt wrote: > > >> > > >> > > >> > > >> On 10/1/21 13:48, Peter Robinson wrote: > > >>> On Fri, Oct 1, 2021 at 6:03 AM AKASHI Takahiro > > >>> wrote: > > >>>> > > >>>> In blk_get_device_by_str(), the comment says: "Updates the partition table > > >>>> for the specified hw partition." > > >>>> Since hw partition is supported only on MMC, it makes no sense to do so > > >>>> for other devices. > > >>> > > >>> Is it not also supported on UFS, and I believe it may also be an > > >>> option in the NVME spec too. > > >> > > >> An NVMe device may expose multiple namespaces. blk_create_devicef() is > > >> called for each namespace. > > >> > > >> A SCSI device may have multiple LUNs. blk_create_devicef() is called for > > >> each LUN. > > >> > > >> This is what the tree shown by 'dm tree' with on NVMe namespace and one LUN. > > >> > > >> Class Index Driver Name > > >> --------------------------------------------------------------------- > > >> root 0 root_driver root_driver > > >> simple_bus 0 simple_bus |- soc > > >> spi 1 sifive_spi | |- spi@10050000 > > >> mmc 0 mmc_spi | | `- mmc@0 > > >> blk 0 mmc_blk | | `- mmc@0.blk > > >> pci 0 pcie_sifive | |- pcie@e00000000 > > >> pci 1 pci_bridge_drv | | `- pci_0:0.0 > > >> pci 2 pci_bridge_drv | | `- pci_1:0.0 > > >> pci 5 pci_bridge_drv | | |- pci_2:3.0 > > >> ahci 0 ahci_pci | | | `- ahci_pci > > >> scsi 0 ahci_scsi | | | `- ahci_scsi > > >> blk 2 scsi_blk | | | `- ahci_scsi.id0lun0 > > >> pci 6 pci_bridge_drv | | |- pci_2:4.0 > > >> nvme 0 nvme | | | `- nvme#0 > > >> blk 1 nvme-blk | | | `- nvme#0.blk#1 > > >> > > >> Namespaces and LUNs are modeled as block devices (class = 'blk'). > > > > > > So multiple block devices per NVMe device? I did not know that was supported. > > > > > > We need a sandbox driver for NVMe as it has no tests at present. Since > > > it has no tests, I don't think we can expect people to know how to > > > maintain whatever functionality is there. > > > > NVMe drives with multiple namespaces exist for servers but not for > > consumer NVMe drives. > > > > In QEMU you can define an NVMe device with multiple namespaces. Cf. > > https://qemu.readthedocs.io/en/latest/system/devices/nvme.html?highlight=namespace#additional-namespaces > > > > So for a first glimpse at the handling I suggest to use QEMU. > > Well that's fine, but every uclass must have a test and a sandbox > emulator as well. Wait, it seems that you're discussing a different thing from my patch. While I don't know whether NVMe namespaces are a kind of "HW partitions", we don't care much here as long as any namespace can be handled simply as a normal block device, like scsi LUN's, in terms of U-Boot driver model. # On the other hand, we have to explicitly switch "hw partitions" # with blk_select_hwpart_devnum() on MMC devices even though we use # the *same* udevice(blk_desc). # See do_mmcrpmb() in cmd/mmc.c So I hope that *your* discussion doesn't make any difference to my patch. Right? -Takahiro Akashi > Regards, > Simon