diff options
author | David S. Miller <davem@davemloft.net> | 2014-11-14 01:01:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-14 01:01:12 -0500 |
commit | 076ce4482569ea1a2c27b4ca71a309adaf91d398 (patch) | |
tree | 2ae9e42612f35be897f190983fc292d7af781cd2 /arch/arm/mm/cache-l2x0.c | |
parent | d649a7a81f3b5bacb1d60abd7529894d8234a666 (diff) | |
parent | b23dc5a7cc6ebc9a0d57351da7a0e8454c9ffea3 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/chelsio/cxgb4vf/sge.c
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
sge.c was overlapping two changes, one to use the new
__dev_alloc_page() in net-next, and one to use s->fl_pg_order in net.
ixgbe_phy.c was a set of overlapping whitespace changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/arm/mm/cache-l2x0.c')
-rw-r--r-- | arch/arm/mm/cache-l2x0.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 55f9d6e0cc88..5e65ca8dea62 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -956,7 +956,7 @@ static u32 cache_id_part_number_from_dt; | |||
956 | * @associativity: variable to return the calculated associativity in | 956 | * @associativity: variable to return the calculated associativity in |
957 | * @max_way_size: the maximum size in bytes for the cache ways | 957 | * @max_way_size: the maximum size in bytes for the cache ways |
958 | */ | 958 | */ |
959 | static void __init l2x0_cache_size_of_parse(const struct device_node *np, | 959 | static int __init l2x0_cache_size_of_parse(const struct device_node *np, |
960 | u32 *aux_val, u32 *aux_mask, | 960 | u32 *aux_val, u32 *aux_mask, |
961 | u32 *associativity, | 961 | u32 *associativity, |
962 | u32 max_way_size) | 962 | u32 max_way_size) |
@@ -974,7 +974,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, | |||
974 | of_property_read_u32(np, "cache-line-size", &line_size); | 974 | of_property_read_u32(np, "cache-line-size", &line_size); |
975 | 975 | ||
976 | if (!cache_size || !sets) | 976 | if (!cache_size || !sets) |
977 | return; | 977 | return -ENODEV; |
978 | 978 | ||
979 | /* All these l2 caches have the same line = block size actually */ | 979 | /* All these l2 caches have the same line = block size actually */ |
980 | if (!line_size) { | 980 | if (!line_size) { |
@@ -1009,7 +1009,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, | |||
1009 | 1009 | ||
1010 | if (way_size > max_way_size) { | 1010 | if (way_size > max_way_size) { |
1011 | pr_err("L2C OF: set size %dKB is too large\n", way_size); | 1011 | pr_err("L2C OF: set size %dKB is too large\n", way_size); |
1012 | return; | 1012 | return -EINVAL; |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | pr_info("L2C OF: override cache size: %d bytes (%dKB)\n", | 1015 | pr_info("L2C OF: override cache size: %d bytes (%dKB)\n", |
@@ -1027,7 +1027,7 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, | |||
1027 | if (way_size_bits < 1 || way_size_bits > 6) { | 1027 | if (way_size_bits < 1 || way_size_bits > 6) { |
1028 | pr_err("L2C OF: cache way size illegal: %dKB is not mapped\n", | 1028 | pr_err("L2C OF: cache way size illegal: %dKB is not mapped\n", |
1029 | way_size); | 1029 | way_size); |
1030 | return; | 1030 | return -EINVAL; |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | mask |= L2C_AUX_CTRL_WAY_SIZE_MASK; | 1033 | mask |= L2C_AUX_CTRL_WAY_SIZE_MASK; |
@@ -1036,6 +1036,8 @@ static void __init l2x0_cache_size_of_parse(const struct device_node *np, | |||
1036 | *aux_val &= ~mask; | 1036 | *aux_val &= ~mask; |
1037 | *aux_val |= val; | 1037 | *aux_val |= val; |
1038 | *aux_mask &= ~mask; | 1038 | *aux_mask &= ~mask; |
1039 | |||
1040 | return 0; | ||
1039 | } | 1041 | } |
1040 | 1042 | ||
1041 | static void __init l2x0_of_parse(const struct device_node *np, | 1043 | static void __init l2x0_of_parse(const struct device_node *np, |
@@ -1046,6 +1048,7 @@ static void __init l2x0_of_parse(const struct device_node *np, | |||
1046 | u32 dirty = 0; | 1048 | u32 dirty = 0; |
1047 | u32 val = 0, mask = 0; | 1049 | u32 val = 0, mask = 0; |
1048 | u32 assoc; | 1050 | u32 assoc; |
1051 | int ret; | ||
1049 | 1052 | ||
1050 | of_property_read_u32(np, "arm,tag-latency", &tag); | 1053 | of_property_read_u32(np, "arm,tag-latency", &tag); |
1051 | if (tag) { | 1054 | if (tag) { |
@@ -1068,7 +1071,10 @@ static void __init l2x0_of_parse(const struct device_node *np, | |||
1068 | val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT; | 1071 | val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT; |
1069 | } | 1072 | } |
1070 | 1073 | ||
1071 | l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K); | 1074 | ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K); |
1075 | if (ret) | ||
1076 | return; | ||
1077 | |||
1072 | if (assoc > 8) { | 1078 | if (assoc > 8) { |
1073 | pr_err("l2x0 of: cache setting yield too high associativity\n"); | 1079 | pr_err("l2x0 of: cache setting yield too high associativity\n"); |
1074 | pr_err("l2x0 of: %d calculated, max 8\n", assoc); | 1080 | pr_err("l2x0 of: %d calculated, max 8\n", assoc); |
@@ -1125,6 +1131,7 @@ static void __init l2c310_of_parse(const struct device_node *np, | |||
1125 | u32 tag[3] = { 0, 0, 0 }; | 1131 | u32 tag[3] = { 0, 0, 0 }; |
1126 | u32 filter[2] = { 0, 0 }; | 1132 | u32 filter[2] = { 0, 0 }; |
1127 | u32 assoc; | 1133 | u32 assoc; |
1134 | int ret; | ||
1128 | 1135 | ||
1129 | of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag)); | 1136 | of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag)); |
1130 | if (tag[0] && tag[1] && tag[2]) | 1137 | if (tag[0] && tag[1] && tag[2]) |
@@ -1152,7 +1159,10 @@ static void __init l2c310_of_parse(const struct device_node *np, | |||
1152 | l2x0_base + L310_ADDR_FILTER_START); | 1159 | l2x0_base + L310_ADDR_FILTER_START); |
1153 | } | 1160 | } |
1154 | 1161 | ||
1155 | l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K); | 1162 | ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K); |
1163 | if (ret) | ||
1164 | return; | ||
1165 | |||
1156 | switch (assoc) { | 1166 | switch (assoc) { |
1157 | case 16: | 1167 | case 16: |
1158 | *aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK; | 1168 | *aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK; |
@@ -1164,8 +1174,8 @@ static void __init l2c310_of_parse(const struct device_node *np, | |||
1164 | *aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK; | 1174 | *aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK; |
1165 | break; | 1175 | break; |
1166 | default: | 1176 | default: |
1167 | pr_err("PL310 OF: cache setting yield illegal associativity\n"); | 1177 | pr_err("L2C-310 OF cache associativity %d invalid, only 8 or 16 permitted\n", |
1168 | pr_err("PL310 OF: %d calculated, only 8 and 16 legal\n", assoc); | 1178 | assoc); |
1169 | break; | 1179 | break; |
1170 | } | 1180 | } |
1171 | } | 1181 | } |