public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Robert Richter <rrichter@caviumnetworks.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Cc: Will Deacon <will.deacon@arm.com>,
	Tomasz Nowicki <tn@semihalf.com>,
	David Daney <david.daney@caviumnetworks.com>,
	Ashok Kumar <ashoks@broadcom.com>,
	Robert Richter <rrichter@cavium.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip, gicv3-its, numa: Enable Cavium ThunderX #23144 workaround for ACPI
Date: Tue, 3 May 2016 08:40:47 +0100	[thread overview]
Message-ID: <572855FF.4030207@arm.com> (raw)
In-Reply-To: <1462207100-4373-1-git-send-email-rrichter@caviumnetworks.com>

Hi Robert,

On 02/05/16 17:38, Robert Richter wrote:
> From: Robert Richter <rrichter@cavium.com>
> 
> In case of acpi the firmware does not provide node ids for cpus and
> its devices. Determine it from system topology special to Cavium
> ThunderX systems. This enables #23144 workaround for ACPI.
> 
> Signed-off-by: Robert Richter <rrichter@cavium.com>
> ---
>  drivers/irqchip/irq-gic-v3-its.c | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 494395274cf7..6eac0f3c1e56 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -1107,11 +1107,13 @@ static void its_cpu_init_collection(void)
>  
>  		/* avoid cross node collections and its mapping */
>  		if (its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) {
> -			struct device_node *cpu_node;
> -
> -			cpu_node = of_get_cpu_node(cpu, NULL);
> +			int nid = of_node_to_nid(of_get_cpu_node(cpu, NULL));
> +			if (nid == NUMA_NO_NODE) {
> +				pr_warn_once("ITS: Updating cpu numa node ids\n");

I don't really understand the meaning of that message. What are you
updating here?

> +				nid = MPIDR_AFFINITY_LEVEL(read_cpuid_mpidr(), 2);
> +			}
>  			if (its->numa_node != NUMA_NO_NODE &&
> -				its->numa_node != of_node_to_nid(cpu_node))

So you're going from something that was relatively generic
(of_node_to_nid) to something that is now completely hardcoding the
Cavium view of CPU topology. Doesn't ACPI have similar abstractions?

> +				its->numa_node != nid)
>  				continue;
>  		}
>  
> @@ -1443,6 +1445,15 @@ static void __maybe_unused its_enable_quirk_cavium_23144(void *data)
>  {
>  	struct its_node *its = data;
>  
> +	if (!IS_ENABLED(CONFIG_NUMA))
> +		return;
> +
> +	if (its->numa_node == NUMA_NO_NODE) {
> +		/* make ACPI work */
> +		its->numa_node = (its->phys_base >> 44) & 0x3;

How is that ACPI specific?

> +		pr_warn_once("ITS: Updating ITS numa node ids\n");
> +	}
> +
>  	its->flags |= ITS_FLAGS_WORKAROUND_CAVIUM_23144;
>  }
>  
> 

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2016-05-03  7:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 16:38 [PATCH] irqchip, gicv3-its, numa: Enable Cavium ThunderX #23144 workaround for ACPI Robert Richter
2016-05-03  7:40 ` Marc Zyngier [this message]
2016-05-11 16:27   ` Robert Richter

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=572855FF.4030207@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=ashoks@broadcom.com \
    --cc=david.daney@caviumnetworks.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rrichter@cavium.com \
    --cc=rrichter@caviumnetworks.com \
    --cc=tglx@linutronix.de \
    --cc=tn@semihalf.com \
    --cc=will.deacon@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox