[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-28-gbaba768
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2014-01-13 09:48:40
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via baba7687191cc3ef5f2908354e3e1b41bf4e10f2 (commit)
from 4b40e916a922b6b3e8e9ff7e3440ace918174e6c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit baba7687191cc3ef5f2908354e3e1b41bf4e10f2
Author: Sébastien Szymanski <ss...@us...>
Date: Mon Jan 13 10:48:16 2014 +0100
[LINUX] 3.12: apf6q: fix mmc driver to be able to enable emmc boot
partition.
-----------------------------------------------------------------------
Summary of changes:
...c-core-Update-ext_csd-if-touched-by-ioctl.patch | 97 ++++++++++++++++++++
1 files changed, 97 insertions(+), 0 deletions(-)
create mode 100644 patches/linux/3.12/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch
diff --git a/patches/linux/3.12/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch b/patches/linux/3.12/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch
new file mode 100644
index 0000000..6ddfb29
--- /dev/null
+++ b/patches/linux/3.12/0480-RFC-mmc-core-Update-ext_csd-if-touched-by-ioctl.patch
@@ -0,0 +1,97 @@
+diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
+index 1a3163f..0a4bd62 100644
+--- a/drivers/mmc/card/block.c
++++ b/drivers/mmc/card/block.c
+@@ -132,6 +132,8 @@ enum {
+ module_param(perdev_minors, int, 0444);
+ MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
+
++int mmc_update_ext_csd(struct mmc_card *card);
++
+ static inline int mmc_blk_part_switch(struct mmc_card *card,
+ struct mmc_blk_data *md);
+ static int get_card_status(struct mmc_card *card, u32 *status, int retries);
+@@ -600,6 +602,18 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
+ __func__, status, err);
+ }
+
++ if ((cmd.opcode == MMC_SWITCH) && ((cmd.arg >> 24) & 0x3)) {
++ /*
++ * In case the IOCTL has modified the EXT_CSD,
++ * update it, i.e. re-read the EXT_CSD.
++ */
++ err = mmc_update_ext_csd(card);
++ if (err)
++ dev_err(mmc_dev(card->host),
++ "%s: EXT_CSD update failed, error %d\n",
++ __func__, err);
++ }
++
+ cmd_rel_host:
+ mmc_put_card(card);
+
+diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
+index 6d02012..5db9d8c 100644
+--- a/drivers/mmc/core/mmc.c
++++ b/drivers/mmc/core/mmc.c
+@@ -269,7 +269,7 @@ static void mmc_select_card_type(struct mmc_card *card)
+ /*
+ * Decode extended CSD.
+ */
+-static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
++static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd, int update)
+ {
+ int err = 0, idx;
+ unsigned int part_size;
+@@ -348,7 +348,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
+ * There are two boot regions of equal size, defined in
+ * multiples of 128K.
+ */
+- if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_boot_partition_access(card->host)) {
++ if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_boot_partition_access(card->host) &&
++ !update) {
+ for (idx = 0; idx < MMC_NUM_BOOT_PARTITION; idx++) {
+ part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17;
+ mmc_part_add(card, part_size,
+@@ -519,7 +520,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
+ * RPMB regions are defined in multiples of 128K.
+ */
+ card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT];
+- if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_cmd23(card->host)) {
++ if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_cmd23(card->host) &&
++ !update) {
+ mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17,
+ EXT_CSD_PART_CONFIG_ACC_RPMB,
+ "rpmb", 0, false,
+@@ -983,7 +985,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
+ err = mmc_get_ext_csd(card, &ext_csd);
+ if (err)
+ goto free_card;
+- err = mmc_read_ext_csd(card, ext_csd);
++ err = mmc_read_ext_csd(card, ext_csd, 0);
+ if (err)
+ goto free_card;
+
+@@ -1634,6 +1636,22 @@ static void mmc_attach_bus_ops(struct mmc_host *host)
+ mmc_attach_bus(host, bus_ops);
+ }
+
++int mmc_update_ext_csd(struct mmc_card *card)
++{
++ u8 *new_ext_csd;
++ int err;
++
++ err = mmc_get_ext_csd(card, &new_ext_csd);
++ if (err || new_ext_csd == NULL)
++ goto out;
++
++ err = mmc_read_ext_csd(card, new_ext_csd, 1);
++
++out:
++ mmc_free_ext_csd(new_ext_csd);
++ return err;
++}
++
+ /*
+ * Starting point for MMC card init.
+ */
hooks/post-receive
--
armadeus
|