Refreshed all patches.
Altered patches:
- 400-mtd-add-rootfs-split-support.patch
Compile-tested on: ar71xx
Runtime-tested on: ar71xx
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
LINUX_RELEASE?=1
-LINUX_VERSION-4.9 = .205
+LINUX_VERSION-4.9 = .206
LINUX_VERSION-4.14 = .156
-LINUX_KERNEL_HASH-4.9.205 = 98b9e8644706acc0cf51022372bb263b59a1d2bbe3ccd7ce6bd9bc7378c78b05
+LINUX_KERNEL_HASH-4.9.206 = 1df27899a9bc4dd874f3830ab9e7b638f0026dffd67a2e230444e5d2805ccad6
LINUX_KERNEL_HASH-4.14.156 = f8889feb0cbd7df36ff35bd4c72c1e2010567621bfcb218fcfa501bc5c7787c0
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -807,6 +807,27 @@ static const char * const default_mtd_pa
+@@ -832,6 +832,27 @@ static const char * const default_mtd_pa
NULL
};
/**
* parse_mtd_partitions - parse MTD partitions
* @master: the master partition (describes whole MTD device)
-@@ -847,16 +868,10 @@ int parse_mtd_partitions(struct mtd_info
+@@ -872,16 +893,10 @@ int parse_mtd_partitions(struct mtd_info
parser ? parser->name : NULL);
if (!parser)
continue;
static struct mtd_part *allocate_partition(struct mtd_info *master,
const struct mtd_partition *part, int partno,
uint64_t cur_offset)
-@@ -675,6 +649,48 @@ int mtd_add_partition(struct mtd_info *m
+@@ -686,6 +660,48 @@ err_remove_part:
}
EXPORT_SYMBOL_GPL(mtd_add_partition);
int mtd_del_partition(struct mtd_info *master, int partno)
{
struct mtd_part *slave, *next;
-@@ -686,12 +702,7 @@ int mtd_del_partition(struct mtd_info *m
+@@ -697,12 +713,7 @@ int mtd_del_partition(struct mtd_info *m
(slave->mtd.index == partno)) {
sysfs_remove_files(&slave->mtd.dev.kobj,
mtd_partition_attrs);
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -660,6 +660,8 @@ static int __mtd_del_partition(struct mt
+@@ -671,6 +671,8 @@ static int __mtd_del_partition(struct mt
{
int err;
err = del_mtd_device(&priv->mtd);
if (err)
return err;
-@@ -700,8 +702,6 @@ int mtd_del_partition(struct mtd_info *m
+@@ -711,8 +713,6 @@ int mtd_del_partition(struct mtd_info *m
list_for_each_entry_safe(slave, next, &mtd_partitions, list)
if ((slave->master == master) &&
(slave->mtd.index == partno)) {
if (IS_ERR(new))
return PTR_ERR(new);
-@@ -683,7 +689,7 @@ int del_mtd_partitions(struct mtd_info *
+@@ -694,7 +700,7 @@ int del_mtd_partitions(struct mtd_info *
mutex_lock(&mtd_partitions_mutex);
list_for_each_entry_safe(slave, next, &mtd_partitions, list)
ret = __mtd_del_partition(slave);
if (ret < 0)
err = ret;
-@@ -700,7 +706,7 @@ int mtd_del_partition(struct mtd_info *m
+@@ -711,7 +717,7 @@ int mtd_del_partition(struct mtd_info *m
mutex_lock(&mtd_partitions_mutex);
list_for_each_entry_safe(slave, next, &mtd_partitions, list)
(slave->mtd.index == partno)) {
ret = __mtd_del_partition(slave);
break;
-@@ -933,6 +939,6 @@ uint64_t mtd_get_device_size(const struc
+@@ -958,6 +964,6 @@ uint64_t mtd_get_device_size(const struc
if (!mtd_is_partition(mtd))
return mtd->size;
&parent->dev :
parent->dev.parent;
slave->mtd.dev.of_node = part->of_node;
-@@ -664,8 +664,17 @@ EXPORT_SYMBOL_GPL(mtd_add_partition);
+@@ -675,8 +675,17 @@ EXPORT_SYMBOL_GPL(mtd_add_partition);
*/
static int __mtd_del_partition(struct mtd_part *priv)
{
sysfs_remove_files(&priv->mtd.dev.kobj, mtd_partition_attrs);
err = del_mtd_device(&priv->mtd);
-@@ -680,16 +689,16 @@ static int __mtd_del_partition(struct mt
+@@ -691,16 +700,16 @@ static int __mtd_del_partition(struct mt
/*
* This function unregisters and destroy all slave MTD objects which are
ret = __mtd_del_partition(slave);
if (ret < 0)
err = ret;
-@@ -699,14 +708,14 @@ int del_mtd_partitions(struct mtd_info *
+@@ -710,14 +719,14 @@ int del_mtd_partitions(struct mtd_info *
return err;
}
(slave->mtd.index == partno)) {
ret = __mtd_del_partition(slave);
break;
-@@ -939,6 +948,6 @@ uint64_t mtd_get_device_size(const struc
+@@ -964,6 +973,6 @@ uint64_t mtd_get_device_size(const struc
if (!mtd_is_partition(mtd))
return mtd->size;
static struct mtd_part *allocate_partition(struct mtd_info *parent,
const struct mtd_partition *part, int partno,
uint64_t cur_offset)
-@@ -758,6 +787,8 @@ int add_mtd_partitions(struct mtd_info *
+@@ -778,6 +807,8 @@ int add_mtd_partitions(struct mtd_info *
+ }
- add_mtd_device(&slave->mtd);
mtd_add_partition_attrs(slave);
+ if (parts[i].types)
+ mtd_parse_part(slave, parts[i].types);
#include "mtdcore.h"
-@@ -886,6 +887,92 @@ static int mtd_part_do_parse(struct mtd_
+@@ -911,6 +912,92 @@ static int mtd_part_do_parse(struct mtd_
}
/**
* parse_mtd_partitions - parse MTD partitions
* @master: the master partition (describes whole MTD device)
* @types: names of partition parsers to try or %NULL
-@@ -917,19 +1004,30 @@ int parse_mtd_partitions(struct mtd_info
+@@ -942,19 +1029,30 @@ int parse_mtd_partitions(struct mtd_info
types = default_mtd_part_types;
for ( ; *types; types++) {
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -932,7 +932,7 @@ static int mtd_part_of_parse(struct mtd_
+@@ -957,7 +957,7 @@ static int mtd_part_of_parse(struct mtd_
struct device_node *np;
struct property *prop;
const char *compat;
int ret, err = 0;
np = of_get_child_by_name(mtd_get_of_node(master), "partitions");
-@@ -952,7 +952,7 @@ static int mtd_part_of_parse(struct mtd_
+@@ -977,7 +977,7 @@ static int mtd_part_of_parse(struct mtd_
of_node_put(np);
/*
}
static struct mtd_part *allocate_partition(struct mtd_info *parent,
-@@ -973,30 +960,27 @@ static int mtd_part_of_parse(struct mtd_
+@@ -998,30 +985,27 @@ static int mtd_part_of_parse(struct mtd_
}
/**
struct mtd_part_parser *parser;
int ret, err = 0;
-@@ -1010,7 +994,7 @@ int parse_mtd_partitions(struct mtd_info
+@@ -1035,7 +1019,7 @@ int parse_mtd_partitions(struct mtd_info
* handled in a separated function.
*/
if (!strcmp(*types, "ofpart")) {
} else {
pr_debug("%s: parsing partitions %s\n", master->name,
*types);
-@@ -1021,13 +1005,17 @@ int parse_mtd_partitions(struct mtd_info
+@@ -1046,13 +1030,17 @@ int parse_mtd_partitions(struct mtd_info
parser ? parser->name : NULL);
if (!parser)
continue;
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
-@@ -1079,7 +1079,7 @@ static int c_can_poll(struct napi_struct
+@@ -1105,7 +1105,7 @@ static int c_can_poll(struct napi_struct
end:
if (work_done < quota) {
}
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
-@@ -1532,7 +1532,7 @@ static int atl1e_clean(struct napi_struc
+@@ -1534,7 +1534,7 @@ static int atl1e_clean(struct napi_struc
/* If no Tx and not enough Rx work done, exit the polling mode */
if (work_done < budget) {
quit_polling:
static struct mtd_part *allocate_partition(struct mtd_info *parent,
const struct mtd_partition *part, int partno,
uint64_t cur_offset)
-@@ -775,8 +759,8 @@ int add_mtd_partitions(struct mtd_info *
+@@ -795,8 +779,8 @@ int add_mtd_partitions(struct mtd_info *
+ }
- add_mtd_device(&slave->mtd);
mtd_add_partition_attrs(slave);
- if (parts[i].types)
- mtd_parse_part(slave, parts[i].types);
cur_offset = slave->offset + slave->mtd.size;
}
-@@ -852,6 +836,12 @@ static const char * const default_mtd_pa
+@@ -877,6 +861,12 @@ static const char * const default_mtd_pa
NULL
};
static int mtd_part_do_parse(struct mtd_part_parser *parser,
struct mtd_info *master,
struct mtd_partitions *pparts,
-@@ -922,7 +912,9 @@ static int mtd_part_of_parse(struct mtd_
+@@ -947,7 +937,9 @@ static int mtd_part_of_parse(struct mtd_
const char *fixed = "fixed-partitions";
int ret, err = 0;
of_property_for_each_string(np, "compatible", prop, compat) {
parser = mtd_part_get_compatible_parser(compat);
if (!parser)
-@@ -985,7 +977,8 @@ int parse_mtd_partitions(struct mtd_info
+@@ -1010,7 +1002,8 @@ int parse_mtd_partitions(struct mtd_info
int ret, err = 0;
if (!types)
#include <linux/err.h>
#include <linux/of.h>
-@@ -827,6 +828,42 @@ void deregister_mtd_parser(struct mtd_pa
+@@ -852,6 +853,42 @@ void deregister_mtd_parser(struct mtd_pa
EXPORT_SYMBOL_GPL(deregister_mtd_parser);
/*
* Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
* are changing this array!
*/
-@@ -975,6 +1012,13 @@ int parse_mtd_partitions(struct mtd_info
+@@ -1000,6 +1037,13 @@ int parse_mtd_partitions(struct mtd_info
struct mtd_partitions pparts = { };
struct mtd_part_parser *parser;
int ret, err = 0;
if (!types)
types = mtd_is_partition(master) ? default_subpartition_types :
-@@ -1016,6 +1060,7 @@ int parse_mtd_partitions(struct mtd_info
+@@ -1041,6 +1085,7 @@ int parse_mtd_partitions(struct mtd_info
if (ret < 0 && !err)
err = ret;
}
/*
* Given a pointer to the MTD object in the mtd_part structure, we can retrieve
* the pointer to that structure.
-@@ -650,6 +654,7 @@ int mtd_add_partition(struct mtd_info *p
- mutex_unlock(&mtd_partitions_mutex);
+@@ -653,6 +657,7 @@ int mtd_add_partition(struct mtd_info *p
+ if (ret)
+ goto err_remove_part;
- add_mtd_device(&new->mtd);
+ mtd_partition_split(parent, new);
-
mtd_add_partition_attrs(new);
-@@ -728,6 +733,35 @@ int mtd_del_partition(struct mtd_info *m
+ return 0;
+@@ -739,6 +744,35 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
/*
* 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
-@@ -759,6 +793,7 @@ int add_mtd_partitions(struct mtd_info *
- mutex_unlock(&mtd_partitions_mutex);
+@@ -779,6 +813,7 @@ int add_mtd_partitions(struct mtd_info *
+ goto err_del_partitions;
+ }
- add_mtd_device(&slave->mtd);
+ mtd_partition_split(master, slave);
mtd_add_partition_attrs(slave);
/* Look for subpartitions */
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -1115,6 +1115,62 @@ void mtd_part_parser_cleanup(struct mtd_
+@@ -1140,6 +1140,62 @@ void mtd_part_parser_cleanup(struct mtd_
}
}
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -733,6 +733,36 @@ int mtd_del_partition(struct mtd_info *m
+@@ -744,6 +744,36 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME
#else
-@@ -741,6 +771,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
+@@ -752,6 +782,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition);
static void split_firmware(struct mtd_info *master, struct mtd_part *part)
{
}
void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
-@@ -755,6 +786,12 @@ static void mtd_partition_split(struct m
+@@ -766,6 +797,12 @@ static void mtd_partition_split(struct m
if (rootfs_found)
return;
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -763,6 +763,17 @@ run_parsers_by_type(struct mtd_part *sla
+@@ -774,6 +774,17 @@ run_parsers_by_type(struct mtd_part *sla
return nr_parts;
}
#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME
#else
-@@ -1225,6 +1236,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -1250,6 +1261,24 @@ int mtd_is_partition(const struct mtd_in
}
EXPORT_SYMBOL_GPL(mtd_is_partition);
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
-@@ -379,6 +379,8 @@ static struct iommu_group *acpihid_devic
+@@ -383,6 +383,8 @@ static struct iommu_group *acpihid_devic
if (!entry->group)
entry->group = generic_device_group(dev);
return entry->group;
}
-@@ -3193,9 +3195,10 @@ static bool amd_iommu_capable(enum iommu
+@@ -3197,9 +3199,10 @@ static bool amd_iommu_capable(enum iommu
return false;
}
struct unity_map_entry *entry;
int devid;
-@@ -3204,41 +3207,56 @@ static void amd_iommu_get_dm_regions(str
+@@ -3208,41 +3211,56 @@ static void amd_iommu_get_dm_regions(str
return;
list_for_each_entry(entry, &amd_iommu_unity_map, list) {
{
struct dma_ops_domain *dma_dom = to_dma_ops_domain(to_pdomain(domain));
unsigned long start, end;
-@@ -3262,9 +3280,9 @@ static const struct iommu_ops amd_iommu_
+@@ -3266,9 +3284,9 @@ static const struct iommu_ops amd_iommu_
.add_device = amd_iommu_add_device,
.remove_device = amd_iommu_remove_device,
.device_group = amd_iommu_device_group,