Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp231025pxx; Wed, 28 Oct 2020 03:32:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+ko7sJv7VJa9FBucKm8ZtgBn7rGScRFSTIeviFqPeQ6Nchtr1GMcDE3pbY7XWn7vczWJq X-Received: by 2002:a17:906:6d48:: with SMTP id a8mr6689533ejt.502.1603881142737; Wed, 28 Oct 2020 03:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881142; cv=none; d=google.com; s=arc-20160816; b=pT71awhyQ1Tnfw1RtKq+6jBU6O7eYPbAJ/uOWhKToyuK0dx/bt1iEDtfsYgAAWNZrb Mn4olikAt27GSF3MnEEI3YIipsqxJDLfwP6lKYkllyLvFqu0Zd5Fbbi/MbUvM4NIxrH2 p2+rq430vb4iRpk7rV/Mhgh4TIe8S3dgLw2Reyn1b8gNL9CW+xR/xJANLeev6NIDv9ji O4dRfuE9mD6e4jL0eAY//eB07xVTxBEcULwNMzURitybl2WYkYzmqID1JtiLTmCuScq6 juoN2NuLCjnJ+suOWseLzXTVghR0qFQQmJPFrr18RkD2xCB/EgrJKFi+CxcgS0THb8Br pC0g== 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=wDTlcO9Smjmwi8vT/GVGSuDhHqzmD1LT+hT9vCr2p3c=; b=IMouOt1aKOspdRqqnCfu+eeQm9HyJn486b/FN52GF54JZItr5MGY/yo2UfpeeHSzIx fA6J9NYsGAPN9K9v54C+OLSOwG7ELwspxUT63ft1lGJy3/h+kLzg3XOIwNnlI9K9Xrhu 5qIbJ6/aStFYkrzcFDEQIIdnUB7ZZNEAqifmoEgO7wQch3m4oZyJ+NKuIZ1iYw/BA6zT Z5jQqkTx5zqtetyi9ZU5p/d7Y6RWzzgFr05fb8fvaq1KbZwT7zG0z8p+ch9Dmd4YaLKd /AXq83nldEKFTiK1CdQs5fQOdGL4zGpb43jfy2JKysNffWhZzxgj2lM3Fxj82CNoR/72 YNeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CXzSF2JQ; 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 d2si2953320edn.245.2020.10.28.03.32.00; Wed, 28 Oct 2020 03:32:22 -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=CXzSF2JQ; 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 S1762441AbgJ0Omz (ORCPT + 99 others); Tue, 27 Oct 2020 10:42:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:37234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761124AbgJ0OiC (ORCPT ); Tue, 27 Oct 2020 10:38:02 -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 837C8206B2; Tue, 27 Oct 2020 14:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809482; bh=oCslFUlESiEpVn7iFFjf5E+c/u+6AHCQp4TdHxfD4dQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXzSF2JQr+y9OVwNcJG4lx2PqmJQ9mrQ+LA1O8sLgfMY+VZeau+RRYMkRKTLarj0e xEoY2NhzMC7MWi0UBaC3/Ber2DLVmF26yO2ra3xvnYPqjgeB7+xV7jYMtLhYNgj8PF vISnFqzeycCj1chhUkTlIaF1rJ5C5TmYNEEo/L6A= 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 5.4 210/408] ARM: 9007/1: l2c: fix prefetch bits init in L2X0_AUX_CTRL using DT values Date: Tue, 27 Oct 2020 14:52:28 +0100 Message-Id: <20201027135504.838719771@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 12c26eb88afbc..43d91bfd23600 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -1249,20 +1249,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