aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-2.6.35/nokia900/inconsistent-mmc-fix-2.6.35.patch
blob: 12ade34e7e5b0dd3c6fe6df0107b9230dd7e1ea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Index: linux-2.6.35/arch/arm/mach-omap2/board-rx51-peripherals.c
===================================================================
--- linux-2.6.35.orig/arch/arm/mach-omap2/board-rx51-peripherals.c	2010-09-19 11:01:36.480370002 +0200
+++ linux-2.6.35/arch/arm/mach-omap2/board-rx51-peripherals.c	2010-09-19 11:02:56.730370000 +0200
@@ -475,6 +475,7 @@
 static struct omap2_hsmmc_info mmc[] __initdata = {
 	{
 		.name		= "external",
+		.mmcblk_devidx	= 1,
 		.mmc		= 1,
 		.wires		= 4,
 		.cover_only	= true,
@@ -484,6 +485,7 @@
 	},
 	{
 		.name		= "internal",
+		.mmcblk_devidx	= 0,
 		.mmc		= 2,
 		.wires		= 8, /* See also rx51_mmc2_remux */
 		.gpio_cd	= -EINVAL,
Index: linux-2.6.35/arch/arm/mach-omap2/hsmmc.c
===================================================================
--- linux-2.6.35.orig/arch/arm/mach-omap2/hsmmc.c	2010-09-19 11:01:13.140370002 +0200
+++ linux-2.6.35/arch/arm/mach-omap2/hsmmc.c	2010-09-19 11:03:48.490370007 +0200
@@ -257,6 +257,7 @@
 			snprintf(hc->name, ARRAY_SIZE(hc->name),
 				"mmc%islot%i", c->mmc, 1);
 		mmc->slots[0].name = hc->name;
+		mmc->slots[0].mmcblk_devidx = c->mmcblk_devidx;
 		mmc->nr_slots = 1;
 		mmc->slots[0].wires = c->wires;
 		mmc->slots[0].internal_clock = !c->ext_clock;
Index: linux-2.6.35/arch/arm/mach-omap2/hsmmc.h
===================================================================
--- linux-2.6.35.orig/arch/arm/mach-omap2/hsmmc.h	2010-09-19 11:01:13.150370002 +0200
+++ linux-2.6.35/arch/arm/mach-omap2/hsmmc.h	2010-09-19 11:04:09.070370002 +0200
@@ -21,6 +21,7 @@
 	char	*name;		/* or NULL for default */
 	struct device *dev;	/* returned: pointer to mmc adapter */
 	int	ocr_mask;	/* temporary HACK */
+	int	mmcblk_devidx;  /* preferred mmcblkX device index */
 	/* Remux (pad configuation) when powering on/off */
 	void (*remux)(struct device *dev, int slot, int power_on);
 };
Index: linux-2.6.35/arch/arm/plat-omap/include/plat/mmc.h
===================================================================
--- linux-2.6.35.orig/arch/arm/plat-omap/include/plat/mmc.h	2010-09-19 11:04:43.480369999 +0200
+++ linux-2.6.35/arch/arm/plat-omap/include/plat/mmc.h	2010-09-19 11:05:06.150370000 +0200
@@ -132,6 +132,7 @@
 		int (*get_cover_state)(struct device *dev, int slot);
 
 		const char *name;
+		int mmcblk_devidx; /* preferred mmcblkX index for this slot */
 		u32 ocr_mask;
 
 		/* Card detection IRQs */
Index: linux-2.6.35/drivers/mmc/card/block.c
===================================================================
--- linux-2.6.35.orig/drivers/mmc/card/block.c	2010-09-19 11:05:25.060370002 +0200
+++ linux-2.6.35/drivers/mmc/card/block.c	2010-09-19 11:07:06.980369995 +0200
@@ -482,7 +482,7 @@
 	struct mmc_blk_data *md;
 	int devidx, ret;
 
-	devidx = find_first_zero_bit(dev_use, MMC_NUM_MINORS);
+	devidx = find_next_zero_bit(dev_use, MMC_NUM_MINORS, card->host->mmcblk_devidx);
 	if (devidx >= MMC_NUM_MINORS)
 		return ERR_PTR(-ENOSPC);
 	__set_bit(devidx, dev_use);
Index: linux-2.6.35/drivers/mmc/host/omap_hsmmc.c
===================================================================
--- linux-2.6.35.orig/drivers/mmc/host/omap_hsmmc.c	2010-09-19 11:07:22.040370005 +0200
+++ linux-2.6.35/drivers/mmc/host/omap_hsmmc.c	2010-09-19 11:08:05.310369999 +0200
@@ -2157,6 +2157,7 @@
 	}
 
 	mmc->ocr_avail = mmc_slot(host).ocr_mask;
+	mmc->mmcblk_devidx = mmc_slot(host).mmcblk_devidx;
 
 	/* Request IRQ for card detect */
 	if ((mmc_slot(host).card_detect_irq)) {
Index: linux-2.6.35/include/linux/mmc/host.h
===================================================================
--- linux-2.6.35.orig/include/linux/mmc/host.h	2010-09-19 11:09:55.410370002 +0200
+++ linux-2.6.35/include/linux/mmc/host.h	2010-09-19 11:10:17.200370002 +0200
@@ -210,7 +210,7 @@
 #endif
 
 	struct dentry		*debugfs_root;
-
+	unsigned int		mmcblk_devidx; /* preferred mmc block device index (mmcblkX) */
 	struct mutex		*port_mutex;
 
 	unsigned long		private[0] ____cacheline_aligned;