aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-07-27 21:54:08 +0200
committerRafał Miłecki <rafal@milecki.pl>2018-07-27 22:16:24 +0200
commit2a598bbaa3f75b7051c2453a6ccf706191cf2153 (patch)
treed0f84b7cea12e91a390a53705249e6febfee626b /target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch
parent4c1aa64b4d804e77dfaa8d53e5ef699fcced4b18 (diff)
downloadupstream-2a598bbaa3f75b7051c2453a6ccf706191cf2153.tar.gz
upstream-2a598bbaa3f75b7051c2453a6ccf706191cf2153.tar.bz2
upstream-2a598bbaa3f75b7051c2453a6ccf706191cf2153.zip
kernel: backport mtd support for subpartitions in DT
This is a new & warm feature that allows nesting partiitons in DT and mixing their types (e.g. static vs. dynamic). It's very useful for boards that have most partitions static but some of them require extra parsing (e.g. a "firmware" partition). It's required to successfully backport support for new devices using that new syntax in their DT files. Since brcm63xx has a custom alternative patch the upstream one is being reverted for it. The plan is to make brcm63xx use the upstream implementation. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch')
-rw-r--r--target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch10
1 files changed, 5 insertions, 5 deletions
diff --git a/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch
index 10be7a16ab..b0cb273141 100644
--- a/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch
@@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Given a pointer to the MTD object in the mtd_part structure, we can retrieve
* the pointer to that structure.
-@@ -666,6 +670,7 @@ int mtd_add_partition(struct mtd_info *p
+@@ -650,6 +654,7 @@ int mtd_add_partition(struct mtd_info *p
mutex_unlock(&mtd_partitions_mutex);
add_mtd_device(&new->mtd);
@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
mtd_add_partition_attrs(new);
-@@ -744,6 +749,35 @@ int mtd_del_partition(struct mtd_info *m
+@@ -728,6 +733,35 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
@@ -104,14 +104,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* This function, given a master MTD object and a partition table, creates
* and registers slave MTD objects which are bound to the master according to
-@@ -775,6 +809,7 @@ int add_mtd_partitions(struct mtd_info *
+@@ -759,6 +793,7 @@ int add_mtd_partitions(struct mtd_info *
mutex_unlock(&mtd_partitions_mutex);
add_mtd_device(&slave->mtd);
+ mtd_partition_split(master, slave);
mtd_add_partition_attrs(slave);
- if (parts[i].types)
- mtd_parse_part(slave, parts[i].types);
+ /* Look for subpartitions */
+ parse_mtd_partitions(&slave->mtd, parts[i].types, NULL);
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -110,5 +110,7 @@ int mtd_add_partition(struct mtd_info *m