public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Ganapatrao Kulkarni <gpkulkarni@gmail.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>,
	linux-acpi@vger.kernel.org, devel@acpica.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Lv Zheng <lv.zheng@intel.com>,
	Robert Moore <robert.moore@intel.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Jayachandran C <jnair@caviumnetworks.com>,
	Hanjun Guo <hanjun.guo@linaro.org>
Subject: Re: [PATCH 2/2] acpi, gicv3-its, numa: Adding numa node mapping for gic-its units
Date: Thu, 15 Jun 2017 11:43:06 +0100	[thread overview]
Message-ID: <889cbfe3-e381-2805-7925-11dca09aaa2a@arm.com> (raw)
In-Reply-To: <20170615103508.GA15815@red-moon>

On 15/06/17 11:35, Lorenzo Pieralisi wrote:
> On Wed, Jun 14, 2017 at 03:23:17PM +0530, Ganapatrao Kulkarni wrote:
> 
> [...]
> 
>>>> +static int __init
>>>> +acpi_parse_its_affinity(struct acpi_subtable_header *header,
>>>> +                      const unsigned long end)
>>>> +{
>>>> +     struct acpi_srat_its_affinity *its_affinity;
>>>> +
>>>> +     its_affinity = (struct acpi_srat_its_affinity *)header;
>>>> +     if (!its_affinity)
>>>> +             return -EINVAL;
>>>> +
>>>> +     acpi_table_print_srat_entry(header);
> 
> You can leave this info printing but see below.
> 
>>>> +
>>>> +     /* let architecture-dependent part to do it */
>>>> +     acpi_numa_its_affinity_init(its_affinity);
>>>> +
>>>> +     return 0;
>>>> +}
>>>> +
>>>>  static int __initdata parsed_numa_memblks;
>>>>
>>>>  static int __init
>>>> @@ -445,7 +473,7 @@ int __init acpi_numa_init(void)
>>>>
>>>>       /* SRAT: Static Resource Affinity Table */
>>>>       if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
>>>> -             struct acpi_subtable_proc srat_proc[3];
>>>> +             struct acpi_subtable_proc srat_proc[4];
>>>>
>>>>               memset(srat_proc, 0, sizeof(srat_proc));
>>>>               srat_proc[0].id = ACPI_SRAT_TYPE_CPU_AFFINITY;
>>>> @@ -454,6 +482,8 @@ int __init acpi_numa_init(void)
>>>>               srat_proc[1].handler = acpi_parse_x2apic_affinity;
>>>>               srat_proc[2].id = ACPI_SRAT_TYPE_GICC_AFFINITY;
>>>>               srat_proc[2].handler = acpi_parse_gicc_affinity;
>>>> +             srat_proc[3].id = ACPI_SRAT_TYPE_GIC_ITS_AFFINITY;
>>>> +             srat_proc[3].handler = acpi_parse_its_affinity;
>>>>
>>>>               acpi_table_parse_entries_array(ACPI_SIG_SRAT,
>>>>                                       sizeof(struct acpi_table_srat),
>>>> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
>>>> index 45ea1933..84936da 100644
>>>> --- a/drivers/irqchip/irq-gic-v3-its.c
>>>> +++ b/drivers/irqchip/irq-gic-v3-its.c
>>>> @@ -1861,7 +1861,8 @@ static int __init gic_acpi_parse_madt_its(struct acpi_subtable_header *header,
>>>>               goto dom_err;
>>>>       }
>>>>
>>>> -     err = its_probe_one(&res, dom_handle, NUMA_NO_NODE);
>>>> +     err = its_probe_one(&res, dom_handle,
>>>> +                     acpi_numa_get_its_nid(its_entry->translation_id));
>>>
>>> If that's the only usage I wonder whether we really need all arm64
>>> arch code/data, instead of parsing the SRAT in ITS code driver straight
>>> away at probe, retrieve its node and be done with this.
>>>
>>> I understand you replicated what x86/GICC does with APIC code, I would
>>> like to understand though if we see a reason why (or better, why we keep
>>> the relevant stashed data in arch/arm64 instead of the ITS driver).
>>
>> it is been thought to do ITS sub table parse along with other SRAT
>> tables.  and use the mapping later when ITS devices are
>> initialised/probed.  IMO, it is more appropriate to keep all SRAT sub
>> table parsing to same function/place rather than moving to driver.
> 
> I do not follow. If it is just used in ITS driver code to set the ITS
> affinity node what's the point of stashing data and adding callbacks
> when you can simply parse the SRAT and be done with it ?
> 
> Or you have something on top of these patches that require ITS node
> information and the calls you added ? If so post the code please.
> 
> Regardless, it's ITS specific information, ITS is managed through an
> irqchip driver on ARM64 so even if you decided to stash the SRAT ITS
> information it does not belong in arch/arm64 IMO, you can implement
> acpi_numa_its_affinity_init() in the ITS driver but AFAICS for the time
> being it would be just useless that's the point I am making.

Agreed. As long as there is only the ITS as a consumer of that
information, there is no need to pollute the rest of the kernel with it.
Once we have another consumer, we can look at making that code common.
In the meantime, keeping it in the ITS code is the right thing to do.

Thanks,

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

  reply	other threads:[~2017-06-15 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 12:56 [PATCH 0/2] acpi, gicv3-its, numa: Adding numa node mapping for its Ganapatrao Kulkarni
2017-06-06 12:56 ` [PATCH 1/2] ACPICA: ACPI 6.2: Add support for new SRAT subtable Ganapatrao Kulkarni
2017-06-06 12:56 ` [PATCH 2/2] acpi, gicv3-its, numa: Adding numa node mapping for gic-its units Ganapatrao Kulkarni
2017-06-07  3:39   ` Ganapatrao Kulkarni
2017-06-12 10:53   ` Lorenzo Pieralisi
2017-06-14  9:53     ` Ganapatrao Kulkarni
2017-06-15 10:35       ` Lorenzo Pieralisi
2017-06-15 10:43         ` Marc Zyngier [this message]
2017-06-15 10:55           ` Ganapatrao Kulkarni

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=889cbfe3-e381-2805-7925-11dca09aaa2a@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=devel@acpica.org \
    --cc=ganapatrao.kulkarni@cavium.com \
    --cc=gpkulkarni@gmail.com \
    --cc=hanjun.guo@linaro.org \
    --cc=jason@lakedaemon.net \
    --cc=jnair@caviumnetworks.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lv.zheng@intel.com \
    --cc=robert.moore@intel.com \
    --cc=tglx@linutronix.de \
    --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