Skip to contentSkip to conversation

typo in Documentation/devices.txt ?

DISCUSSION 허종만 2 participants 2 messages Jan 5, 2012 – Jan 9, 2012 MMC, SD and SDIO

lore
Share & tools
lore

허종만

author
#0 lore raw

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" ?

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

Regards,
Jongman Heo.

#1 lore raw

Hi,

Quoted 17 lines · 허종만

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.

Quoted 1 line

Shouldn't "8 = /dev/mmcblk1" be "9 = /dev/mmcblk1" ?

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

Quoted 3 lines

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

Quoted 3 lines

Regards,
Jongman Heo.