u-boot-brain/drivers/block
Simon Glass e48eeb9ea3 dm: blk: Improve block device claiming
The intention with block devices is that the device number (devnum field
in its descriptor) matches the alias of its parent device. For example,
with:

	aliases {
		mmc0 = "/sdhci@700b0600";
		mmc1 = "/sdhci@700b0400";
	}

we expect that the block devices for mmc0 and mmc1 would have device
numbers of 0 and 1 respectively.

Unfortunately this does not currently always happen. If there is another
MMC device earlier in the driver model data structures its block device
will be created first. It will therefore get device number 0 and mmc0
will therefore miss out. In this case the MMC device will have sequence
number 0 but its block device will not.

To avoid this, allow a device to request a device number and bump any
existing device number that is using it. This all happens during the
binding phase so it is safe to change these numbers around. This allows
device numbers to match the aliases in all circumstances.

Add a test to verify the behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:05 -06:00
..
ahci-uclass.c
ahci.c dm: Add support for scsi/sata based devices 2016-12-20 09:15:27 +01:00
blk_legacy.c
blk-uclass.c dm: blk: Improve block device claiming 2017-06-01 07:03:05 -06:00
blkcache.c
dwc_ahci.c dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
dwc_ahsata.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
dwc_ahsata.h
fsl_sata.c fsl/sata: correctly identify failed malloc 2017-04-18 10:29:24 -04:00
fsl_sata.h
ftide020.c
ftide020.h
ide.c Kconfig: Add a CONFIG_IDE option 2017-05-22 12:45:27 -04:00
Kconfig Kconfig: Add a CONFIG_IDE option 2017-05-22 12:45:27 -04:00
libata.c
Makefile Kconfig: Add a CONFIG_IDE option 2017-05-22 12:45:27 -04:00
mvsata_ide.c
mxc_ata.c
sandbox_scsi.c
sandbox.c dm: core: Add flags parameter to device_remove() 2017-04-04 20:15:10 -06:00
sata_ceva.c dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
sata_dwc.c treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
sata_dwc.h
sata_mv.c sata: sata_mv: Fix misaligned cache warnings 2016-12-05 13:53:42 +01:00
sata_sandbox.c
sata_sil3114.c
sata_sil3114.h
sata_sil.c
sata_sil.h
scsi-uclass.c dm: Add support for scsi/sata based devices 2016-12-20 09:15:27 +01:00
sil680.c Kconfig: Add a CONFIG_IDE option 2017-05-22 12:45:27 -04:00
sym53c8xx.c drivers: squash lines for immediate return 2016-09-23 17:53:54 -04:00
systemace.c