public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/11] DM: add block device core
Date: Fri, 21 Sep 2012 21:17:43 +0200	[thread overview]
Message-ID: <201209212117.43219.marex@denx.de> (raw)
In-Reply-To: <35486878.3eJx0ajLPm@bloomfield>

Dear Pavel Herrmann,

> On Friday 21 of September 2012 20:00:10 Marek Vasut wrote:
> > Dear Pavel Herrmann,
> > 
> > [...]
> > 
> > > > > you should have a blockdev driver for USB flash and SD, but not
> > > > > blockctrl
> > > > 
> > > > I'm lost again. Do I also need a blockdev driver for SATA controller
> > > > now that I need a blockdev driver for SD card controller ?
> > > 
> > > you need a blockdev for a blockctrl (see [5/11]), and you need a
> > > blockctrl driver for your SATA controller
> > 
> > So "blockctrl" == The controller driver? Viva abbrevs. Rename it to
> > block_controller_driver .
> 
> thats far too long, dont you think? we only have 80 cols in code...

So what? You can abbrev. the variable name, so it won't get in the way. As you 
can see, I was confused by the name, do you expect others not to be?

> > > you can either implement your SD as a blockctrl and use that blockdev
> > 
> > SD as in ... SD card or SD host controller ? Use what blockdev ?
> 
> either we say we only have SD memory (and will never ever have other SDIO
> cards), implement SD controller with blockctrl API (and change it slightly,
> because SD is inherently flash and therefore has an erase operation)
> 
> on the other hand, we could have a separate API for SD controllers (richer
> than the blockctrl, to eventually suport non-memory SD cards), and then
> have a device that provides blockdev API on one end, and uses this SD API
> on the other (much like blockdev_ata in [5/11] does for blockctrl API).
> this is the original idea; for this reason, blockdev API already has an
> erase operation, even though blockctrl does not support it.
> 
> > > , or
> > > implement a separate blockdev for your SD card (this is the original
> > > intention)
> > 
> > Ok, so the general abstration is to have a block_controller_driver
> > (blockctrl in your parlance) for each and every driver in drivers/block
> 
> yes
> 
> > _and_ which provides only basic read/write block for the downstream
> > drivers (block_device) attached to it
> 
> yes
> 
> > _and_ proxifies them for particular device type handlers?
> 
> not sure what you mean there. what device type handlers? is that
> SATA/SCSI/PATA? that should disappear, only reason i have it in code is
> because i am wrapping old APIs into the new one.

I mean the particular block_controller_driver instance routes the "read/write 
block" request from downstream block_device through SATA/SD/SCSI/whatever 
"library" or "layer" back into itself. But the later "itself" is the 
implementation of the "library" or "layer" API. Once the library call returns, 
the "read/write block" operation is complete and the result can be passed back 
to the downstream "block_device". Yes?

> > Now block_device (blockdev) is either a whole disc, partition, or
> > subpartition. It exports read/write block operations, but to complete
> > them, it uses upcalls into it's parent, yes?
> 
> yes
> 
> > These upcalls stop at first block_controller_driver, correct?
> 
> in case of a hard disk, yes. in case of a USB flash, it uses USB calls to
> its parent (USB hub or whatever) to complete the task at hand

Let me reformulate -- there is only single block_controller_driver instance the 
request crosses on it's way up the driver tree. Yes?

[...]

Best regards,
Marek Vasut

  reply	other threads:[~2012-09-21 19:17 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 19:37 [U-Boot] [PATCH 00/11] Add DM blockdev subsystem Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 01/11] DM: add block device core Pavel Herrmann
2012-09-20 19:58   ` Marek Vasut
2012-09-21  7:11     ` Pavel Herrmann
2012-09-21 12:39       ` Marek Vasut
2012-09-21 13:27         ` Pavel Herrmann
2012-09-21 13:53           ` Marek Vasut
2012-09-21 14:57             ` Pavel Herrmann
2012-09-21 15:34               ` Marek Vasut
2012-09-21 15:48                 ` Pavel Herrmann
2012-09-21 15:55                   ` Marek Vasut
2012-09-21 17:19                     ` Pavel Herrmann
2012-09-21 18:00                       ` Marek Vasut
2012-09-21 18:53                         ` Pavel Herrmann
2012-09-21 19:17                           ` Marek Vasut [this message]
2012-09-21 19:29                             ` Pavel Herrmann
2012-09-21 21:11                               ` Marek Vasut
2012-09-21 23:43                                 ` Pavel Herrmann
2012-09-22  0:09                                   ` Marek Vasut
2012-09-22  9:39                                     ` Pavel Herrmann
2012-09-22 13:33                                       ` Marek Vasut
2012-09-22 13:59                                         ` Pavel Herrmann
2012-09-24 12:23                                           ` Pavel Herrmann
2012-09-20 20:49   ` [U-Boot] [U-Boot-DM] " Vikram Narayanan
2012-09-21  7:09     ` Pavel Herrmann
2012-09-21 12:39       ` Marek Vasut
2012-09-20 19:37 ` [U-Boot] [PATCH 02/11] DM: add support for scanning DOS partitions to blockdev core Pavel Herrmann
2012-09-20 20:03   ` Marek Vasut
2012-09-21  7:22     ` Pavel Herrmann
2012-09-21 12:47       ` Marek Vasut
2012-09-21 13:18         ` Pavel Herrmann
2012-09-21 13:54           ` Marek Vasut
2012-09-20 19:37 ` [U-Boot] [PATCH 03/11] DM: add block controller core Pavel Herrmann
2012-09-20 20:05   ` Marek Vasut
2012-09-21  7:21     ` Pavel Herrmann
2012-09-21 12:51       ` Marek Vasut
2012-09-21 13:14         ` Pavel Herrmann
2012-09-21 13:56           ` Marek Vasut
2012-09-21 15:04             ` Pavel Herrmann
2012-09-21 13:33         ` Pavel Herrmann
2012-09-21 13:58           ` Marek Vasut
2012-09-21 15:09             ` Pavel Herrmann
2012-09-21 15:39               ` Marek Vasut
2012-09-21 15:46                 ` Pavel Herrmann
2012-09-21 16:08                   ` Marek Vasut
2012-09-21 17:22                     ` Pavel Herrmann
2012-09-21 18:01                       ` Marek Vasut
2012-09-21 19:15                         ` Pavel Herrmann
2012-09-21 19:22                           ` Marek Vasut
2012-09-20 19:37 ` [U-Boot] [PATCH 04/11] DM: add sata_legacy driver for blockctrl Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 05/11] DM: add ata and partition blockdev drivers Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 06/11] DM: add cmd_block command Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 07/11] DM: use new blockdev API in FAT Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 08/11] DM: use new blockdev API in ext2 Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 09/11] DM: use new blockdev API in reiserfs Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 10/11] DM: use new blockdev API in ZFS Pavel Herrmann
2012-09-20 19:37 ` [U-Boot] [PATCH 11/11] DM: switch sandbox to DM blockdev Pavel Herrmann

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=201209212117.43219.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox