linux/drivers
Matthias Schiffer a920d2b2cf UPSTREAM: mmc: core: Allow setting slot index via device tree alias
As with GPIO, UART and others, allow specifying the device index via the
aliases node in the device tree.

On embedded devices, there is often a combination of removable (e.g.
SD card) and non-removable MMC devices (e.g. eMMC).
Therefore the index might change depending on

* host of removable device
* removable card present or not

This makes it difficult to hardcode the root device, if it is on the
non-removable device. E.g. if SD card is present eMMC will be mmcblk1,
if SD card is not present at boot, eMMC will be mmcblk0.

Alternative solutions like PARTUUIDs do not cover the case where multiple
mmcblk devices contain the same image. This is a common issue on devices
that can boot both from eMMC (for regular boot) and SD cards (as a
temporary boot medium for development). When a firmware image is
installed to eMMC after a test boot via SD card, there will be no
reliable way to refer to a specific device using (PART)UUIDs oder
LABELs.

The demand for this feature has led to multiple attempts to implement
it, dating back at least to 2012 (see
https://www.spinics.net/lists/linux-mmc/msg26586.html for a previous
discussion from 2014).

All indices defined in the aliases node will be reserved for use by the
respective MMC device, moving the indices of devices that don't have an
alias up into the non-reserved range. If the aliases node is not found,
the driver will act as before.

This is a rebased and cleaned up version of
https://www.spinics.net/lists/linux-mmc/msg26588.html .

Based-on-patch-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lkml.org/lkml/2020/8/5/194
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20200901085004.2512-2-matthias.schiffer@ew.tq-group.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

 Conflicts:
	drivers/mmc/core/host.c

Change-Id: I86a98bab7767d630172a552e0dc72d90aaebc2a3
(cherry picked from commit fa2d0aa969)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2020-12-01 08:58:42 +08:00
..
accessibility
acpi This is the 4.19.149 stable release 2020-10-01 16:49:05 +02:00
amba
android binder: fix UAF when releasing todo list 2020-10-29 09:54:56 +01:00
ata ata: sata_mv, avoid trigerrable BUG_ON 2020-10-01 13:14:54 +02:00
atm atm: eni: fix the missed pci_disable_device() for eni_init_one() 2020-10-01 13:14:51 +02:00
auxdisplay
base Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
bcma
block This is the 4.19.146 stable release 2020-09-17 13:59:19 +02:00
bluetooth Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
bus bus: hisi_lpc: Fixup IO ports addresses to avoid use-after-free in host removal 2020-10-01 13:14:35 +02:00
cdrom
char Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
clk clk: rockchip: rv1126: Add CLK_32K_IOE support 2020-11-30 17:37:45 +08:00
clocksource Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
connector
cpufreq cpufreq: dt-platdev: Add rk3568 project into blacklist 2020-11-09 17:30:37 +08:00
cpuidle This is the 4.19.144 stable release 2020-09-09 19:48:58 +02:00
crypto Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
dax
dca
devfreq Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
dio
dma dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size 2020-11-14 18:12:31 +08:00
dma-buf Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
edac This is the 4.19.153 stable release 2020-10-29 11:36:20 +01:00
eisa
energy_model
extcon extcon: Create named extcon link nowarn 2020-11-09 15:39:02 +08:00
firewire
firmware Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
fmc
fpga fpga: dfl: fix bug in port reset handshake 2020-07-29 10:16:48 +02:00
fsi
gnss This is the 4.19.129 stable release 2020-06-22 10:50:54 +02:00
gpio pinctrl: rockchip: support output-high/low pin configure 2020-11-10 11:07:32 +08:00
gpu drm/rockchip: vop2: add support bcsh 2020-11-30 19:11:30 +08:00
headset_observe rk_headset: Add support for driver to be built as module 2020-09-15 20:12:09 +08:00
hid Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
hsi
hv Drivers: hv: vmbus: Add timeout to vmbus_wait_for_unload 2020-09-23 12:10:59 +02:00
hwmon This is the 4.19.153 stable release 2020-10-29 11:36:20 +01:00
hwspinlock
hwtracing This is the 4.19.140 stable release 2020-08-19 08:43:22 +02:00
i2c Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
ide
idle
iio UPSTREAM: iio: adc: rockchip_saradc: move all of probe to devm-functions 2020-11-19 20:49:11 +08:00
infiniband This is the 4.19.154 stable release 2020-10-30 11:43:26 +01:00
input input: sensor: add ak09918 driver 2020-11-24 09:09:47 +08:00
iommu iommu/rockchip: fix v2 log_iova 2020-11-12 19:05:56 +08:00
ipack ipack: tpci200: fix error return code in tpci200_register() 2020-05-27 17:37:43 +02:00
irqchip Merge tag 'ASB-2020-09-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-09-24 17:59:50 +08:00
isdn PCI: add USR vendor id and use it in r8169 and w6692 driver 2020-06-22 09:05:23 +02:00
leds Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
lightnvm
macintosh drivers/macintosh: Fix memleak in windfarm_pm112 driver 2020-06-22 09:05:29 +02:00
mailbox Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
mcb
md dm table: Avoid null pointer dereference 2020-11-17 15:20:08 +08:00
media media: i2c: gc2053 supports modifying frame rate 2020-11-30 19:32:44 +08:00
memory memory: fsl-corenet-cf: Fix handling of platform_get_irq() error 2020-10-30 10:38:24 +01:00
memstick
message scsi: mptscsih: Fix read sense data size 2020-07-16 08:17:23 +02:00
mfd mfd: Add RK630 mfd driver 2020-11-24 14:39:11 +08:00
misc misc: pir-aschip: Fix pir_aschip_remove() section mismatch 2020-11-13 11:20:14 +08:00
mmc UPSTREAM: mmc: core: Allow setting slot index via device tree alias 2020-12-01 08:58:42 +08:00
mtd Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
mux
net net: wireless: rockchip_wlan: realtek wifi: fix device_name and nego_ssid overflow in ioctl p2p interface 2020-11-25 15:20:43 +08:00
nfc Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
ntb NTB: hw: amd: fix an issue about leak system resources 2020-10-30 10:38:25 +01:00
nubus
nvdimm This is the 4.19.127 stable release 2020-06-07 14:25:43 +02:00
nvme nvmet: fix uninitialized work for zero kato 2020-10-30 10:38:25 +01:00
nvmem nvmem: rockchip-otp: Add support for rk3568-otp 2020-11-19 17:27:42 +08:00
of Merge tag 'ASB-2020-09-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-09-24 17:59:50 +08:00
opp PM / OPP: Call opp_debug_init() later when CONFIG_ROCKCHIP_THUNDER_BOOT=y 2020-05-25 18:20:22 +08:00
oprofile
parisc parisc: mask out enable and reserved bits from sba imask 2020-08-19 08:15:07 +02:00
parport
pci PCI: rockchip: dw: Add LTSSM dump for debug 2020-11-27 10:37:39 +08:00
pcmcia
perf drivers/perf: xgene_pmu: Fix uninitialized resource struct 2020-10-29 09:55:00 +01:00
phy phy: rockchip: naneng-combphy: enable rx adpt for SATA 2020-11-30 18:41:13 +08:00
pinctrl pinctrl: rockchip: fix rk3568 uart7 mux mode 2020-11-26 17:44:00 +08:00
platform This is the 4.19.153 stable release 2020-10-29 11:36:20 +01:00
pnp
power power: rk817-battery: update battery info after plug in/out charger 2020-11-23 18:17:40 +08:00
powercap
pps
ps3
ptp
pwm Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
rapidio rapidio: fix the missed put_device() for rio_mport_add_riodev 2020-10-30 10:38:21 +01:00
ras
regulator regulator: DIO5632: add regulator driver for DIO5632 2020-11-19 18:59:38 +08:00
remoteproc remoteproc: qcom: q6v5: Update running state before requesting stop 2020-08-21 11:05:34 +02:00
reset
rk_nand drivers: rk_nand: update nand flash drivers 2020-11-30 18:42:39 +08:00
rkflash drivers: rkflash: Support new spi flash 2020-11-21 11:40:39 +08:00
rpmsg rpmsg: smd: Fix a kobj leak in in qcom_smd_parse_edge() 2020-10-30 10:38:21 +01:00
rtc Merge tag 'ASB-2020-10-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-10-10 18:38:14 +08:00
s390 s390/zcrypt: Fix ZCRYPT_PERDEV_REQCNT ioctl 2020-10-01 13:14:54 +02:00
sbus
scsi This is the 4.19.154 stable release 2020-10-30 11:43:26 +01:00
sfi
sh
siox
slimbus slimbus: qcom-ngd-ctrl: disable ngd in qmi server down callback 2020-10-29 09:55:12 +01:00
smc
sn
soc soc: rockchip: opp_select: Fix getting leakage twice for V1 2020-11-19 14:30:52 +08:00
soundwire
spi spi: rockchip: Add compatible string for rk3568 2020-11-04 09:00:28 +08:00
spmi
ssb
staging Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
switch
target scsi: target: tcmu: Fix warning: 'page' may be used uninitialized 2020-10-29 09:55:14 +01:00
tc
tee
testcode
thermal thermal: rockchip: Support RK3568 SoCs in the thermal driver 2020-11-13 17:13:01 +08:00
thunderbolt thunderbolt: Drop duplicated get_switch_at_route() 2020-05-27 17:37:40 +02:00
tty Merge tag 'ASB-2020-11-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-11-03 18:36:42 +08:00
uio uio_pdrv_genirq: fix use without device tree and no interrupt 2020-07-22 09:32:11 +02:00
usb CHROMIUM: usb: gadget: configfs: Fix KASAN use-after-free 2020-11-26 17:43:26 +08:00
uwb
vfio This is the 4.19.154 stable release 2020-10-30 11:43:26 +01:00
vhost This is the 4.19.150 stable release 2020-10-07 08:45:35 +02:00
video video/rockchip: rga2: Ion can be used below kernel4.4. 2020-11-30 16:22:04 +08:00
virt drivers/virt/fsl_hypervisor: Fix error handling path 2020-10-29 09:55:09 +01:00
virtio This is the 4.19.142 stable release 2020-08-26 11:07:03 +02:00
visorbus
vlynq
vme
w1 w1: omap-hdq: cleanup to add missing newline for some dev_dbg 2020-06-22 09:05:30 +02:00
watchdog UPSTREAM: watchdog: dw_wdt: Support devices with asynch clocks 2020-11-15 15:40:03 +08:00
xen xen/xenbus: Fix granting of vmalloc'd memory 2020-09-09 19:04:24 +02:00
zorro
Kconfig Merge tag 'ASB-2020-09-05_4.19-stable' of https://android.googlesource.com/kernel/common 2020-09-24 17:59:50 +08:00
Makefile