public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@amd.com>
To: 허종만 <jongman.heo@samsung.com>
Cc: linux-mmc@vger.kernel.org
Subject: Re: typo in Documentation/devices.txt  ?
Date: Mon, 9 Jan 2012 16:41:05 +0800	[thread overview]
Message-ID: <20120109084103.GA26745@ladygaga> (raw)
In-Reply-To: <31861576.535331325747307853.JavaMail.weblogic@epml02>

Hi,

On Thu, Jan 05, 2012 at 07:08:27AM +0000, 허종만 wrote:
> 
> Hi, all..
> 
> Here is description for MMC block devices in Documentation/devices.txt :
> 
>     179 block       MMC block devices
>                       0 = /dev/mmcblk0      First SD/MMC card
>                       1 = /dev/mmcblk0p1    First partition on first MMC card
>                       8 = /dev/mmcblk1      Second SD/MMC card
>                       ^^^^^^^^^^^^^^^^^^
>                     The start of next SD/MMC card can be configured with
>                     CONFIG_MMC_BLOCK_MINORS, or overridden at boot/modprobe
>                     time using the mmcblk.perdev_minors option. That would
>                     bump the offset between each card to be the configured
>                     value instead of the default 8.
> 
> 
> Shouldn't  "8 = /dev/mmcblk1" be "9 = /dev/mmcblk1" ?

No, mmcblk1's minor is 8, mmcblk2's minor is 16, etc...

> 
> If we have 8 partitions on first MMC card, we need mmcblk0p1 ~ mmcblk0p8 devices, with minor number 1 ~ 8.
> Am I misunderstanding?

Each mmc block device by default has 8 minors, not 8 partitions. Minor 0
represent the whole disk. So each mmc block device at most has 7
partitions instead of 8.

See code in function mmc_blk_alloc_req on assigning minor value to the
whole disk of the block device:
md->disk->first_minor = devidx * perdev_minors;

And code in function blk_alloc_devt on checking partition number against
disk minors:
	/* in consecutive minor range? */
	if (part->partno < disk->minors) {
		*devt = MKDEV(disk->major, disk->first_minor + part->partno);
		return 0;
	}

-Aaron

> 
> Regards,
> Jongman Heo.


      reply	other threads:[~2012-01-09  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05  7:08 typo in Documentation/devices.txt ? 허종만
2012-01-09  8:41 ` Aaron Lu [this message]

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=20120109084103.GA26745@ladygaga \
    --to=aaron.lu@amd.com \
    --cc=jongman.heo@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    /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