--- linux-org/drivers/mmc/card/Kconfig	2014-02-07 00:05:20.000000000 +0100
+++ linux-7f280334068b7c875ade51f8f3921ab311f0c824/drivers/mmc/card/Kconfig	2015-09-29 23:12:27.205337449 +0200
@@ -50,6 +50,33 @@
 
 	  If unsure, say Y here.
 
+config MMC_SLOTINDEX
+	bool "Use host index for enumerating mmxblkN"
+	depends on MMC_BLOCK
+	default n
+	help
+	  On embedded devices, often there is a combination of
+	  removable mmc devices (e.g. MMC/SD cards) and hard
+	  wired ones (e.g. eMMC). Depending on the hardware
+	  configuration, the 'mmcblkN' node might change if
+	  the removable device is available or not at boot time.
+
+	  E.g. if the removable device is attached at boot time,
+	  it might become mmxblk0. And the hard wired one mmcblk1.
+	  But if the removable device isn't there at boot time,
+	  the hard wired one will become mmcblk0. This makes it
+	  somehow difficult to hard code the root device to the
+	  non-removable device and boot fast.
+
+	  Enabling this option will simply associating 'N' of
+	  'mmcblkN' with the slot index instead of the dynamic
+	  name index. The slot index is always the same, ensuring
+	  that the non-removable mmc device is associated always
+	  with the same mmcblkN. Independent of the availability of
+	  the removable one.
+
+	  If unsure, say N here.
+
 config SDIO_UART
 	tristate "SDIO UART/GPS class support"
 	depends on TTY
--- linux-org/drivers/mmc/card/block.c	2014-02-07 00:05:20.000000000 +0100
+++ linux-7f280334068b7c875ade51f8f3921ab311f0c824/drivers/mmc/card/block.c	2015-09-29 23:15:11.545345811 +0200
@@ -2098,7 +2098,7 @@
 	 */
 
 	snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
-		 "mmcblk%d%s", md->name_idx, subname ? subname : "");
+		 "mmcblk%d%s", NAMEIDX, subname ? subname : "");
 
 	if (mmc_card_mmc(card))
 		blk_queue_logical_block_size(md->queue.queue,
--- linux-org/include/linux/mmc/host.h	2014-02-07 00:05:20.000000000 +0100
+++ linux-7f280334068b7c875ade51f8f3921ab311f0c824/include/linux/mmc/host.h	2015-09-29 23:22:48.889369085 +0200
@@ -487,4 +487,11 @@
 	return host->ios.clock;
 }
 #endif
+
+#ifdef CONFIG_MMC_SLOTINDEX
+#define NAMEIDX (card->host->index)
+#else
+#define NAMEIDX (md->name_idx)
+#endif
+
 #endif /* LINUX_MMC_HOST_H */
