All of lore.kernel.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: smp_scu: Add the enable speculative linefills operation
Date: Sat, 28 Jun 2014 17:02:16 +0200	[thread overview]
Message-ID: <20140628170216.0c1965cf@free-electrons.com> (raw)
In-Reply-To: <1403822608-31158-3-git-send-email-gregory.clement@free-electrons.com>

Dear Gregory CLEMENT,

On Fri, 27 Jun 2014 00:43:25 +0200, Gregory CLEMENT wrote:
> Quotin the ARM datasheet "When set, coherent linefill requests are

Quotin -> Quoting

> sent speculatively to the L2C-310 in parallel with the tag look-up. If
> the tag look-up misses, the confirmed linefill is sent to the L2C-310
> and gets RDATA earlier because the data request was already initiated
> by the speculative request. "
> 
> Some SoC (such as the Armada 375/38x) can benefit of this feature. As

benefit of -> benefit from.

>  #if defined(CONFIG_SMP) && defined(CONFIG_HAVE_ARM_SCU)
> diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
> index cfea41b41ad0..3fd21a495028 100644
> --- a/arch/arm/kernel/smp_scu.c
> +++ b/arch/arm/kernel/smp_scu.c
> @@ -18,6 +18,7 @@
>  
>  #define SCU_CTRL		0x00
>  #define SCU_CTRL_ENABLE		    BIT(1)
> +#define SCU_CTRL_SPEC_LINEFILLS	    BIT(3)
>  #define SCU_CONFIG		0x04
>  #define SCU_CPU_STATUS		0x08
>  #define SCU_INVALIDATE		0x0c
> @@ -88,3 +89,24 @@ int scu_power_mode(void __iomem *scu_base, unsigned int mode)
>  
>  	return 0;
>  }
> +
> +/*
> + * When enabled, coherent linefill requests are sent speculatively to
> + * the L2C-310 in parallel with the tag look-up
> + *
> + */
> +void scu_spec_linefills_enable(void __iomem *scu_base, bool enable)
> +{
> +	u32 scu_ctrl;
> +
> +	scu_ctrl = readl_relaxed(scu_base + SCU_CTRL);
> +	/* already enabled? */

Comment not needed, since SCU_CTRL_ENABLE already documents what's
happening. Or a more useful comment would be: "We cannot change the SCU
configuration while it is enabled".

> +	if (scu_ctrl & SCU_CTRL_ENABLE)
> +		return;

Return an error in this case maybe?

> +	if (enable)
> +		scu_ctrl |= SCU_CTRL_SPEC_LINEFILLS;
> +	else
> +		scu_ctrl &= ~SCU_CTRL_SPEC_LINEFILLS;
> +
> +	writel_relaxed(scu_ctrl, scu_base + SCU_CTRL);
> +}

Instead of having a separate function to do this (and the standby
operation), what about doing that directly in scu_enable() ? Either
unconditionally if that is fine for all SCU users, or through a flags
argument?

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Russell King <linux@arm.linux.org.uk>,
	Shawn Guo <shawn.guo@freescale.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Lior Amsalem <alior@marvell.com>,
	Tawfik Bayouk <tawfik@marvell.com>,
	linux-kernel@vger.kernel.org, Nadav Haklai <nadavh@marvell.com>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/5] ARM: smp_scu: Add the enable speculative linefills operation
Date: Sat, 28 Jun 2014 17:02:16 +0200	[thread overview]
Message-ID: <20140628170216.0c1965cf@free-electrons.com> (raw)
In-Reply-To: <1403822608-31158-3-git-send-email-gregory.clement@free-electrons.com>

Dear Gregory CLEMENT,

On Fri, 27 Jun 2014 00:43:25 +0200, Gregory CLEMENT wrote:
> Quotin the ARM datasheet "When set, coherent linefill requests are

Quotin -> Quoting

> sent speculatively to the L2C-310 in parallel with the tag look-up. If
> the tag look-up misses, the confirmed linefill is sent to the L2C-310
> and gets RDATA earlier because the data request was already initiated
> by the speculative request. "
> 
> Some SoC (such as the Armada 375/38x) can benefit of this feature. As

benefit of -> benefit from.

>  #if defined(CONFIG_SMP) && defined(CONFIG_HAVE_ARM_SCU)
> diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
> index cfea41b41ad0..3fd21a495028 100644
> --- a/arch/arm/kernel/smp_scu.c
> +++ b/arch/arm/kernel/smp_scu.c
> @@ -18,6 +18,7 @@
>  
>  #define SCU_CTRL		0x00
>  #define SCU_CTRL_ENABLE		    BIT(1)
> +#define SCU_CTRL_SPEC_LINEFILLS	    BIT(3)
>  #define SCU_CONFIG		0x04
>  #define SCU_CPU_STATUS		0x08
>  #define SCU_INVALIDATE		0x0c
> @@ -88,3 +89,24 @@ int scu_power_mode(void __iomem *scu_base, unsigned int mode)
>  
>  	return 0;
>  }
> +
> +/*
> + * When enabled, coherent linefill requests are sent speculatively to
> + * the L2C-310 in parallel with the tag look-up
> + *
> + */
> +void scu_spec_linefills_enable(void __iomem *scu_base, bool enable)
> +{
> +	u32 scu_ctrl;
> +
> +	scu_ctrl = readl_relaxed(scu_base + SCU_CTRL);
> +	/* already enabled? */

Comment not needed, since SCU_CTRL_ENABLE already documents what's
happening. Or a more useful comment would be: "We cannot change the SCU
configuration while it is enabled".

> +	if (scu_ctrl & SCU_CTRL_ENABLE)
> +		return;

Return an error in this case maybe?

> +	if (enable)
> +		scu_ctrl |= SCU_CTRL_SPEC_LINEFILLS;
> +	else
> +		scu_ctrl &= ~SCU_CTRL_SPEC_LINEFILLS;
> +
> +	writel_relaxed(scu_ctrl, scu_base + SCU_CTRL);
> +}

Instead of having a separate function to do this (and the standby
operation), what about doing that directly in scu_enable() ? Either
unconditionally if that is fine for all SCU users, or through a flags
argument?

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-06-28 15:02 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 22:43 [PATCH 0/5] ARM: Centralize the access to the SCU register Gregory CLEMENT
2014-06-26 22:43 ` Gregory CLEMENT
2014-06-26 22:43 ` [PATCH 1/5] ARM: smp_scu: Used defined value instead of literal constant Gregory CLEMENT
2014-06-26 22:43   ` Gregory CLEMENT
2014-06-26 22:55   ` Gregory CLEMENT
2014-06-26 22:55     ` Gregory CLEMENT
2014-06-27 12:08     ` Jason Cooper
2014-06-27 12:08       ` Jason Cooper
2014-06-26 22:43 ` [PATCH 2/5] ARM: smp_scu: Add the enable speculative linefills operation Gregory CLEMENT
2014-06-26 22:43   ` Gregory CLEMENT
2014-06-28 15:02   ` Thomas Petazzoni [this message]
2014-06-28 15:02     ` Thomas Petazzoni
2014-06-30 12:21     ` Gregory CLEMENT
2014-06-30 12:21       ` Gregory CLEMENT
2014-06-26 22:43 ` [PATCH 3/5] ARM: smp_scu: Add the enable standby operation Gregory CLEMENT
2014-06-26 22:43   ` Gregory CLEMENT
2014-06-26 22:43 ` [PATCH 4/5] ARM: mvebu: Enable SCU Speculative linefills to L2 for Armada 375/38x Gregory CLEMENT
2014-06-26 22:43   ` Gregory CLEMENT
2014-06-28 15:04   ` Thomas Petazzoni
2014-06-28 15:04     ` Thomas Petazzoni
2014-06-26 22:43 ` [PATCH 5/5] ARM: imx6q: Use the new function scu_standby_enable() Gregory CLEMENT
2014-06-26 22:43   ` Gregory CLEMENT
2014-06-26 22:56 ` [PATCH 0/5] ARM: Centralize the access to the SCU register Rob Herring
2014-06-26 22:56   ` Rob Herring
2014-06-26 23:01   ` Gregory CLEMENT
2014-06-26 23:01     ` Gregory CLEMENT
2014-07-01  7:42     ` Shawn Guo
2014-07-01  7:42       ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140628170216.0c1965cf@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.