All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Anton Antonov <Anton.Antonov@arm.com>,
	Bin Meng <bmeng@tinylab.org>
Subject: Re: [PATCH v3 4/5] blkmap: store type of blkmap device in corresponding structure
Date: Mon, 20 Jan 2025 15:36:15 +0100	[thread overview]
Message-ID: <874j1t7dsw.fsf@waldekranz.com> (raw)
In-Reply-To: <CADg8p96jX0eDKpxTuBLKS5vx=UJ=QLeBxnmfroUFYZ8VJWv1Pg@mail.gmail.com>

On mån, jan 20, 2025 at 19:30, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
> On Mon, 20 Jan 2025 at 17:55, Tobias Waldekranz <tobias@waldekranz.com> wrote:
>>
>> On mån, jan 20, 2025 at 16:20, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>> > Add information about the type of blkmap device in the blkmap
>> > structure. Currently, the blkmap device is used for mapping to either
>> > a memory based block device, or another block device (linear
>> > mapping). Put information in the blkmap structure to identify if it is
>> > associated with a memory or linear mapped device. Which can then be
>> > used to take specific action based on the type of blkmap device.
>>
>> Is this restriction really necessary? Why should it not be possible to
>> setup a block map like this:
>>
>>  myblkmap:
>> .--------.      .-----.
>> | slice0 +------> RAM |
>> :--------:      '-----'     .-------.
>> | slice1 +------------------> eMMC0 |
>> :--------:      .-------.   '-------'
>> | slice2 +------> eMMC1 |
>> '........'      '-------'
>>
>> Linux's "device mapper", after which blkmaps are modeled, works in this
>> way.  I.e. a blkmap is just a collection of slices, and it is up to each
>> slice how its data is provided, meaning that the user is free to compose
>> their virtual block device in whatever way they need.
>
> The blkmap structure, the way it is designed, is pointing to the
> underlying block device. How can a single blkmap then be associated

The `struct udevice *blk` from `struct blkmap` is a reference to the
block device which represents the block map itself ("myblkmap" in the
picture above), not any lower device.

> with slices of different types? Would that not contravene with the
> idea of a block device associating with a blkmap?

For slices which are linear mappings (and are thus backed by some other
underlying block device), their reference to that lower device ("eMMC0"
and "eMMC1" above) is stored in the `struct udevice *blk` member of
`struct blkmap_linear`.

Slices which are backed by memory does not have any reference to a lower
device, but merely a pointer to the start of the mapping - `void *addr`
in `struct blkmap_mem`.

The overarching idea is that the block map does not have to know
anything about the implementation of how any individual slice chooses to
provide its data.  It only knows about their sizes and offsets.  Based
on that information, it simply routes incoming read/write requests to
the correct slice.

>>
>> Looking at the pmem patch that follows this one, I am not able to find
>> anything that would motivate restricting the functionality either.
>
> The subsequent patch is adding the persistent memory node to the
> device-tree. The pmem node that is to be added is the memory mapped
> blkmap device. The logic does check for the type of the blkmap device
> and then proceeds to add the pmem node only for the memory mapped
> blkmaps.

Sorry I am confused.  Why do you need a block map device to add the pmem
node to the device tree?

  reply	other threads:[~2025-01-20 14:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20 10:50 [PATCH v3 0/5] Add pmem node for preserving distro ISO's Sughosh Ganu
2025-01-20 10:50 ` [PATCH v3 1/5] fdt: add support for adding pmem nodes Sughosh Ganu
2025-01-20 12:31   ` Heinrich Schuchardt
2025-01-20 14:02     ` Sughosh Ganu
2025-01-24 10:56       ` Sughosh Ganu
2025-01-20 10:50 ` [PATCH v3 2/5] efi_loader: add a function to remove memory from the EFI map Sughosh Ganu
2025-01-20 12:36   ` Heinrich Schuchardt
2025-01-20 10:50 ` [PATCH v3 3/5] efi_loader: preserve installer images in pmem Sughosh Ganu
2025-01-20 10:50 ` [PATCH v3 4/5] blkmap: store type of blkmap device in corresponding structure Sughosh Ganu
2025-01-20 12:25   ` Tobias Waldekranz
2025-01-20 14:00     ` Sughosh Ganu
2025-01-20 14:36       ` Tobias Waldekranz [this message]
2025-01-20 15:40         ` Sughosh Ganu
2025-01-20 16:20           ` Tobias Waldekranz
2025-01-20 19:25             ` Sughosh Ganu
2025-01-20 21:36               ` Tobias Waldekranz
2025-01-21  6:43                 ` Sughosh Ganu
2025-01-21 15:54   ` Ilias Apalodimas
2025-01-21 16:02     ` Sughosh Ganu
2025-01-21 21:47       ` Ilias Apalodimas
2025-01-22  6:38         ` Sughosh Ganu
2025-01-20 10:50 ` [PATCH v3 5/5] blkmap: add pmem nodes for blkmap mem mapping devices Sughosh Ganu
2025-01-24 11:39 ` [PATCH v3 0/5] Add pmem node for preserving distro ISO's Ilias Apalodimas
2025-01-24 19:18   ` Tom Rini
2025-01-24 21:19   ` Tobias Waldekranz
2025-01-27  6:46   ` Sughosh Ganu
2025-01-27 11:44     ` Ilias Apalodimas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874j1t7dsw.fsf@waldekranz.com \
    --to=tobias@waldekranz.com \
    --cc=Anton.Antonov@arm.com \
    --cc=bmeng@tinylab.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.