Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp595007pxx; Wed, 28 Oct 2020 11:59:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaFJT/JNwK+OZdmX5VxM6QPNw6fDYPR+RNYdBuOUJUDyootqQTMSI5DvuXcGcutqcI4CB1 X-Received: by 2002:a17:906:364d:: with SMTP id r13mr450891ejb.521.1603911597526; Wed, 28 Oct 2020 11:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603911597; cv=none; d=google.com; s=arc-20160816; b=x7XgvZ1I3Fgky/5TidfOs6ogsYIYdrwZbNwz8QcS/hpJDOZbPjzmOOnD7wYwGav6/Z yHGdhrr7x1Nn4jVuu4GbtS5SnFzmMHAHBlpQgN7n1oSFB24SyjLaoNOeR9FxOGjqPeXA QnuYcMM0X43oT5U4t8sTBmd/R8vG9K4ochH48xK/dXBELJrTWn7TvrrrqBuAkb6XFs5a tPY0JHQfs11lzp3UKCB/hwcthBkjY/dVsx+/tXxabixc2iMInpFtis9oDHIz2kML+O4W eIYbbZXDP2b8XOZzKNhCjJgJgWOMbu7eG7tpera+lGyXh/lcT5V23oJovS0xgA1/st5J IICw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IFK105IiI+qurOJEHzzI8+9Q9BMqeZ2hxmsq6xIfBjQ=; b=BZU1Lp1+fOYhMTTP+4yWckVh/+w2vRefnMztiF8G9Iumm1Iff/m5hf5eNUhXCScFwH MLKuNQEq6vY/2+NpiCk7Z7aBQzqBhvPdl0slO38pahC9PX+2SaOfojsEcrftWUi4Vs3m NDkwuI4nWT8CWEjUKRYHBXl50am5oWC+4FwiSxIlSQqmi4B30E8BWgva4EnwXHaHa++r JJwPvx1sGNHghhrocSO2W7NEm0xvw9dchUzIjcvgq8kgbvYxCrMNPAk2FsMJrVP8/ECf g54cZKLFU/G7uQKmUSwa84KHCQ1560MUquy9Vpmbnzm76kzu/sbd6e+c+vvIuh6jFv3x 99Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cSTgKovL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si6073edt.484.2020.10.28.11.59.27; Wed, 28 Oct 2020 11:59:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cSTgKovL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1826105AbgJ0SQN (ORCPT + 99 others); Tue, 27 Oct 2020 14:16:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:33098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756222AbgJ0OMF (ORCPT ); Tue, 27 Oct 2020 10:12:05 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3910B22202; Tue, 27 Oct 2020 14:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807923; bh=5EFZ7UiGEd0C5xhLQEBHGIKueJO0jvZT1OxPnZ6CPQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cSTgKovLAfCPqC59G/RloDZMlZrtFjmns9gJ+dei/bNUCY4S43hUpmcQou6ethNQH D/9ALFkPDh1/Nro89QrDBWvtBhhWPp7zJx7DBo+0CGOaGIrYtFEvkjabiHkOu/z+Cj JaOFCRdbSTrEWwqLS/T9zYg3sdiC5i65LQmv/eKQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Tucker , Russell King , Sasha Levin Subject: [PATCH 4.14 091/191] ARM: 9007/1: l2c: fix prefetch bits init in L2X0_AUX_CTRL using DT values Date: Tue, 27 Oct 2020 14:49:06 +0100 Message-Id: <20201027134914.066110186@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guillaume Tucker [ 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 Signed-off-by: Russell King Signed-off-by: Sasha Levin --- 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 808efbb89b88c..02f613def40dc 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -1261,20 +1261,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