* [PATCH v2] ARM: l2c: Fix prefetch settings dt parsing
@ 2015-03-10 8:59 Fabrice GASNIER
2015-03-12 14:57 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Fabrice GASNIER @ 2015-03-10 8:59 UTC (permalink / raw)
To: linux-arm-kernel
Allow prefetch settings overriding by device tree, in case
l2x0_cache_size_of_parse() returns value, prefetch tuning
properties are silently ignored. E.g. arm,double-linefill* and
arm,prefetch*.
This happens for example, when "cache-size" or "cache-sets"
properties haven't been filled in l2c dt node.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
---
V2: fix typo in commit message
s/prefect/prefetch/ and s/of tree/device tree/
---
arch/arm/mm/cache-l2x0.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index c6c7696..8f15f70 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -1131,23 +1131,22 @@ static void __init l2c310_of_parse(const struct device_node *np,
}
ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_512K);
- if (ret)
- return;
-
- switch (assoc) {
- case 16:
- *aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK;
- *aux_val |= L310_AUX_CTRL_ASSOCIATIVITY_16;
- *aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK;
- break;
- case 8:
- *aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK;
- *aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK;
- break;
- default:
- pr_err("L2C-310 OF cache associativity %d invalid, only 8 or 16 permitted\n",
- assoc);
- break;
+ if (!ret) {
+ switch (assoc) {
+ case 16:
+ *aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK;
+ *aux_val |= L310_AUX_CTRL_ASSOCIATIVITY_16;
+ *aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK;
+ break;
+ case 8:
+ *aux_val &= ~L2X0_AUX_CTRL_ASSOC_MASK;
+ *aux_mask &= ~L2X0_AUX_CTRL_ASSOC_MASK;
+ break;
+ default:
+ pr_err("L2C-310 OF cache associativity %d invalid, only 8 or 16 permitted\n",
+ assoc);
+ break;
+ }
}
prefetch = l2x0_saved_regs.prefetch_ctrl;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] ARM: l2c: Fix prefetch settings dt parsing
2015-03-10 8:59 [PATCH v2] ARM: l2c: Fix prefetch settings dt parsing Fabrice GASNIER
@ 2015-03-12 14:57 ` Russell King - ARM Linux
2015-03-12 16:12 ` Fabrice Gasnier
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2015-03-12 14:57 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Mar 10, 2015 at 09:59:01AM +0100, Fabrice GASNIER wrote:
> Allow prefetch settings overriding by device tree, in case
> l2x0_cache_size_of_parse() returns value, prefetch tuning
> properties are silently ignored. E.g. arm,double-linefill* and
> arm,prefetch*.
> This happens for example, when "cache-size" or "cache-sets"
> properties haven't been filled in l2c dt node.
>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Patch is okay, but I think the commit message needs to be better :)
"Allow device tree to override the L2C prefetch settings, even when
l2x0_cache_size_of_parse() fails to parse the cache geometry due to (eg)
missing "cache-size" or "cache-sets" properties."
I think with something along those lines, the patch can be put in my
patch system for when I next get around to applying some kernel patches
instead of reading email. :)
Thanks.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] ARM: l2c: Fix prefetch settings dt parsing
2015-03-12 14:57 ` Russell King - ARM Linux
@ 2015-03-12 16:12 ` Fabrice Gasnier
0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Gasnier @ 2015-03-12 16:12 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russel,
I just sent a V3 to follow your remark.
If this is ok, l'll add it to your patch system.
Thanks for your review.
BR,
Fabrice
On 03/12/2015 03:57 PM, Russell King - ARM Linux wrote:
> On Tue, Mar 10, 2015 at 09:59:01AM +0100, Fabrice GASNIER wrote:
>> Allow prefetch settings overriding by device tree, in case
>> l2x0_cache_size_of_parse() returns value, prefetch tuning
>> properties are silently ignored. E.g. arm,double-linefill* and
>> arm,prefetch*.
>> This happens for example, when "cache-size" or "cache-sets"
>> properties haven't been filled in l2c dt node.
>>
>> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
> Patch is okay, but I think the commit message needs to be better :)
>
> "Allow device tree to override the L2C prefetch settings, even when
> l2x0_cache_size_of_parse() fails to parse the cache geometry due to (eg)
> missing "cache-size" or "cache-sets" properties."
>
> I think with something along those lines, the patch can be put in my
> patch system for when I next get around to applying some kernel patches
> instead of reading email. :)
>
> Thanks.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-12 16:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 8:59 [PATCH v2] ARM: l2c: Fix prefetch settings dt parsing Fabrice GASNIER
2015-03-12 14:57 ` Russell King - ARM Linux
2015-03-12 16:12 ` Fabrice Gasnier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).