lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 062/139] ARM: 9007/1: l2c: fix prefetch bits init in L2X0_AUX_CTRL using DT values
    Date
    From: Guillaume Tucker <guillaume.tucker@collabora.com>

    [ Upstream commit 8e007b367a59bcdf484c81f6df9bd5a4cc179ca6 ]

    The L310_PREFETCH_CTRL register bits 28 and 29 to enable data and
    instruction prefetch respectively can also be accessed via the
    L2X0_AUX_CTRL register. They appear to be actually wired together in
    hardware between the registers. Changing them in the prefetch
    register only will get undone when restoring the aux control register
    later on. For this reason, set these bits in both registers during
    initialisation according to the devicetree property values.

    Link: https://lore.kernel.org/lkml/76f2f3ad5e77e356e0a5b99ceee1e774a2842c25.1597061474.git.guillaume.tucker@collabora.com/

    Fixes: ec3bd0e68a67 ("ARM: 8391/1: l2c: add options to overwrite prefetching behavior")
    Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
    Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    arch/arm/mm/cache-l2x0.c | 16 ++++++++++++----
    1 file changed, 12 insertions(+), 4 deletions(-)

    diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
    index d1870c777c6e2..3a465bfa7d4a2 100644
    --- a/arch/arm/mm/cache-l2x0.c
    +++ b/arch/arm/mm/cache-l2x0.c
    @@ -1252,20 +1252,28 @@ static void __init l2c310_of_parse(const struct device_node *np,

    ret = of_property_read_u32(np, "prefetch-data", &val);
    if (ret == 0) {
    - if (val)
    + if (val) {
    prefetch |= L310_PREFETCH_CTRL_DATA_PREFETCH;
    - else
    + *aux_val |= L310_PREFETCH_CTRL_DATA_PREFETCH;
    + } else {
    prefetch &= ~L310_PREFETCH_CTRL_DATA_PREFETCH;
    + *aux_val &= ~L310_PREFETCH_CTRL_DATA_PREFETCH;
    + }
    + *aux_mask &= ~L310_PREFETCH_CTRL_DATA_PREFETCH;
    } else if (ret != -EINVAL) {
    pr_err("L2C-310 OF prefetch-data property value is missing\n");
    }

    ret = of_property_read_u32(np, "prefetch-instr", &val);
    if (ret == 0) {
    - if (val)
    + if (val) {
    prefetch |= L310_PREFETCH_CTRL_INSTR_PREFETCH;
    - else
    + *aux_val |= L310_PREFETCH_CTRL_INSTR_PREFETCH;
    + } else {
    prefetch &= ~L310_PREFETCH_CTRL_INSTR_PREFETCH;
    + *aux_val &= ~L310_PREFETCH_CTRL_INSTR_PREFETCH;
    + }
    + *aux_mask &= ~L310_PREFETCH_CTRL_INSTR_PREFETCH;
    } else if (ret != -EINVAL) {
    pr_err("L2C-310 OF prefetch-instr property value is missing\n");
    }
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-10-27 15:05    [W:4.137 / U:0.440 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site